@font-face {
  font-family: "HomePlanerSans";
  src: url("assets/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* Reference Pass 11: zentrale Personenfotos und stabile Zuordnungen */
.family-members-page {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--module-family, var(--accent)) 26%, var(--border));
}

.family-members-page .member-manage-list,
.family-member-management > .empty-state {
  margin-top: 0;
}

.family-member-add-button {
  justify-self: start;
}

.person-photo-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.person-photo-field[hidden] {
  display: none;
}

.person-photo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.person-photo-preview {
  display: inline-flex;
  flex: 0 0 auto;
}

.person-photo-preview .member-avatar,
.birthday-card > .member-avatar {
  width: 58px;
  height: 58px;
}

.birthday-card {
  align-items: start;
}

.birthday-link-label {
  margin-top: 7px;
  font-weight: 800;
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 7px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.task-assignee > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-unassigned {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-preview-list li.has-avatar {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 7px;
}

.dashboard-preview-list li.has-avatar > .member-avatar {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  align-self: center;
  font-size: 0.92rem;
}

.dashboard-preview-list li.has-avatar > span:not(.member-avatar),
.dashboard-preview-list li.has-avatar > small {
  grid-column: 2;
  min-width: 0;
}

.dashboard-preview-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-preview-list li.has-avatar > .dashboard-preview-button {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 7px;
}

.dashboard-preview-list li.has-avatar > .dashboard-preview-button > .member-avatar {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  align-self: center;
  font-size: 0.92rem;
}

.dashboard-preview-list li.has-avatar > .dashboard-preview-button > span:not(.member-avatar),
.dashboard-preview-list li.has-avatar > .dashboard-preview-button > small {
  grid-column: 2;
  min-width: 0;
}

@media (max-width: 360px) {
  .person-photo-row .product-image-actions {
    width: 100%;
  }

  .person-photo-row .product-image-actions > label {
    flex: 1 1 120px;
  }
}

@media (max-width: 520px) {
  .calendar-people-manager .section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .calendar-people-manager .section-header .compact-button {
    width: 100%;
  }

  .family-member-add-button {
    width: 100%;
  }
}

@font-face {
  font-family: "HomePlanerSerif";
  src: url("assets/fonts/Lora-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-sans: "HomePlanerSans", Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "HomePlanerSerif", Georgia, "Times New Roman", serif;
  --bg: #f7fbf9;
  --surface: #ffffff;
  --surface-soft: #eef8f5;
  --text: #0d3740;
  --muted: #687a7f;
  --border: #e2ece9;
  --accent: #0b8d82;
  --accent-strong: #05766e;
  --green: #2f9b75;
  --yellow: #d89421;
  --red: #d24a3c;
  --shadow: 0 12px 28px rgba(17, 63, 68, 0.07);
  --radius: 18px;
  --bottom-nav-height: 82px;
  font-family: var(--font-sans);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10141d;
    --surface: #171d28;
    --surface-soft: #1f2b3a;
    --text: #edf3fb;
    --muted: #a7b2c2;
    --border: #2b3545;
    --accent: #5fa8ff;
    --accent-strong: #8fc2ff;
    --green: #54c794;
    --yellow: #f3b35a;
    --red: #ff776f;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10141d;
  --surface: #171d28;
  --surface-soft: #1f2b3a;
  --text: #edf3fb;
  --muted: #a7b2c2;
  --border: #2b3545;
  --accent: #5fa8ff;
  --accent-strong: #8fc2ff;
  --green: #54c794;
  --yellow: #f3b35a;
  --red: #ff776f;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fbf9;
  --surface: #ffffff;
  --surface-soft: #eef8f5;
  --text: #0d3740;
  --muted: #687a7f;
  --border: #e2ece9;
  --accent: #0b8d82;
  --accent-strong: #05766e;
  --green: #2f9b75;
  --yellow: #d89421;
  --red: #d24a3c;
  --shadow: 0 12px 28px rgba(17, 63, 68, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

.app-shell.onboarding-active {
  padding-bottom: 0;
}

.onboarding-shell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  padding: calc(22px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
}

.onboarding-card {
  width: min(100%, 430px);
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.onboarding-dots {
  display: inline-flex;
  gap: 7px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 34%, transparent);
}

.onboarding-dot.active {
  width: 22px;
  background: var(--accent);
}

.onboarding-icon {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 4px auto 0;
  border-radius: 30px;
  background: var(--surface-soft);
  font-size: clamp(4rem, 20vw, 5.7rem);
  line-height: 1;
}

.onboarding-icon.logo {
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
  box-shadow: var(--shadow);
}

.onboarding-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.onboarding-copy {
  display: grid;
  gap: 10px;
  text-align: center;
}

.onboarding-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.onboarding-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.onboarding-highlights {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.onboarding-highlights li {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 56%, var(--surface));
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.onboarding-highlights li::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.onboarding-actions .button,
.onboarding-actions .secondary-button,
.onboarding-skip {
  min-height: 50px;
}

.onboarding-skip {
  width: 100%;
}

.start-assistant-card {
  width: min(100%, 540px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.assistant-eyebrow {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.assistant-head {
  display: grid;
  gap: 8px;
}

.assistant-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.assistant-head p,
.starter-offer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.assistant-option-grid {
  display: grid;
  gap: 10px;
}

.assistant-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.assistant-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-soft);
  font-size: 1.25rem;
}

.assistant-option strong,
.assistant-option small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.assistant-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
}

.starter-offer {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px dashed var(--border);
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.starter-offer h2 {
  margin: 0 0 5px;
  font-size: 1rem;
}

@media (max-width: 380px) {
  .today-home-actions {
    grid-template-columns: 1fr;
  }
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  backdrop-filter: blur(16px);
}

.top-bar > div {
  min-width: 0;
}

.brand-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
}

.app-logo-mark {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
  box-shadow: var(--shadow);
  object-fit: contain;
}

.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 8vw, 2.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.icon-button,
.small-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.small-icon-button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  box-shadow: none;
}

.content {
  width: min(100%, 760px);
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 16px 30px;
  overflow-x: hidden;
}

.household-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--bg)), color-mix(in srgb, var(--surface-soft) 46%, var(--surface)));
  color: var(--muted);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.household-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 1.25rem;
}

.household-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.household-copy strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.household-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.household-banner.has-switcher {
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 230px);
}

.household-dashboard-switcher {
  display: grid;
  gap: 5px;
  min-width: 0;
  justify-self: stretch;
}

.household-dashboard-switcher > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.household-dashboard-switcher select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  font-weight: 850;
  outline: 0;
}

.household-dashboard-switcher select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.grid {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.card,
.summary-card,
.empty-state,
.settings-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 7px;
  min-width: 0;
  min-height: 136px;
  padding: 16px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.summary-grid .summary-card:first-child {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 13px;
  min-height: 104px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.summary-grid .summary-card:first-child .summary-icon {
  grid-row: span 3;
  align-self: center;
}

.summary-icon {
  font-size: 1.55rem;
  line-height: 1;
}

.summary-label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.summary-value {
  min-width: 0;
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.summary-note {
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.more-grid {
  display: grid;
  gap: 11px;
}

.more-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.more-card::after {
  content: "›";
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 900;
}

.more-card .summary-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.more-card .summary-value {
  grid-column: 2;
  grid-row: 1;
  word-break: normal;
  overflow-wrap: anywhere;
}

.more-card .summary-note {
  grid-column: 2;
  grid-row: 2;
  word-break: normal;
  overflow-wrap: anywhere;
}

.template-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.template-intro h2,
.template-card h2,
.template-detail-head h2,
.template-apply h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.template-grid {
  display: grid;
  gap: 12px;
}

.template-card {
  display: grid;
  gap: 13px;
}

.template-card-head,
.template-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.template-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--surface-soft);
  font-size: 1.35rem;
}

.template-icon.large {
  width: 54px;
  height: 54px;
  font-size: 1.7rem;
}

.template-detail {
  display: grid;
  gap: 12px;
}

.template-back {
  justify-self: start;
}

.template-actions {
  margin-bottom: 0;
}

.template-point-list {
  display: grid;
  gap: 10px;
}

.template-point {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}

.template-point-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.template-apply {
  display: grid;
  gap: 12px;
}

.household-memory-intro {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.household-memory-intro .button {
  width: 100%;
}

.household-memory-card .item-actions {
  min-width: 0;
}

.today-home-card,
.room-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-home-card {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.today-home-header,
.room-panel-header,
.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.today-home-header > div {
  min-width: 0;
}

.today-home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.today-home-header .compact-button {
  inline-size: auto;
  max-inline-size: 100%;
  min-width: 0;
  justify-self: start;
  justify-content: flex-start;
  white-space: normal;
}

.today-kicker {
  margin: 0 0 6px !important;
  color: var(--accent) !important;
  font-size: 0.78rem !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.today-home-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.today-home-card .today-home-actions .today-action-button {
  inline-size: min(100%, calc(100vw - 64px)) !important;
  width: min(100%, calc(100vw - 64px)) !important;
  max-inline-size: calc(100vw - 64px) !important;
  max-width: calc(100vw - 64px) !important;
  min-width: 0;
  min-height: 46px;
  justify-content: center;
  justify-self: stretch;
  padding-right: 12px;
  padding-left: 12px;
  white-space: normal;
  overflow: hidden;
}

.today-home-header h2 {
  margin: 0 0 4px;
  font-size: 1.22rem;
}

.today-home-header p,
.today-progress-copy span {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.today-progress {
  display: grid;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
}

.today-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.today-progress-copy strong {
  min-width: 0;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 68%, transparent);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.today-home-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.today-home-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.today-home-entry-main {
  min-width: 0;
  max-width: 100%;
}

.today-home-entry-main .item-title,
.today-home-entry-main .item-meta {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.today-home-extras {
  display: grid;
  gap: 10px;
}

.today-mini-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.today-mini-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.today-mini-card-head strong,
.today-mini-card-head span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.today-mini-card-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.room-panel {
  margin-bottom: 14px;
}

.compact-panel {
  padding: 14px;
}

.waste-overview,
.waste-types-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.waste-next-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-soft));
}

.waste-next-card strong,
.waste-next-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.waste-next-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.waste-type-list {
  display: grid;
  gap: 10px;
}

.waste-type-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.waste-type-card > span:nth-child(2) {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.waste-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 1.25rem;
}

.waste-blue { background: color-mix(in srgb, #2f80ed 17%, var(--surface)); }
.waste-green { background: color-mix(in srgb, #2f9e44 17%, var(--surface)); }
.waste-yellow { background: color-mix(in srgb, #f2c94c 24%, var(--surface)); }
.waste-teal { background: color-mix(in srgb, #1ca8a8 17%, var(--surface)); }
.waste-red { background: color-mix(in srgb, #e03131 15%, var(--surface)); }
.waste-violet { background: color-mix(in srgb, #845ef7 16%, var(--surface)); }

.room-chip-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.room-chip-list::-webkit-scrollbar {
  display: none;
}

.room-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.room-chip.active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.room-manager-list {
  display: grid;
  gap: 8px;
}

.room-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface));
}

.room-card > span {
  min-width: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-row .section-title {
  margin-top: 0;
}

.compact-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding-right: 12px;
  padding-left: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar.wrap {
  align-items: stretch;
  flex-direction: column;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.toolbar-actions .button,
.toolbar-actions .secondary-button {
  width: 100%;
  min-width: 0;
}

.barcode-manager {
  margin-bottom: 14px;
}

.form-scan-button {
  width: fit-content;
}

.product-image-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.product-image-label {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.88rem;
}

.product-image-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.product-image-button {
  cursor: pointer;
}

.product-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-image-preview {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  font-size: 1.8rem;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-preview.empty {
  color: var(--muted);
}

.list-summary {
  margin: 10px 0 12px;
}

.barcode-code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.lookup-source {
  color: var(--accent);
  font-weight: 800;
}

.warning-text {
  color: var(--yellow);
  font-weight: 700;
}

.cloud-person-toggle {
  margin-top: 2px;
}
.shopping-search,
.search-panel {
  margin-bottom: 12px;
}

.pantry-search-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.pantry-scan-button {
  min-height: 46px;
}

.dashboard-task-range {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.dashboard-task-range .segmented {
  width: max-content;
  max-width: 100%;
}

.pantry-adjust-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.button {
  background: var(--accent);
  color: #ffffff;
}

.button:active {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.danger-button {
  background: color-mix(in srgb, var(--red) 14%, var(--surface));
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
}

.segmented {
  display: flex;
  gap: 6px;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 78%, var(--bg));
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segment-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segment-button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(21, 38, 72, 0.08);
}

.favorites-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.favorite-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.favorite-list::-webkit-scrollbar {
  display: none;
}

.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  max-width: 220px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.favorite-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-view {
  display: grid;
  gap: 13px;
}

.calendar-filter-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.member-filter-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.member-filter-list::-webkit-scrollbar {
  display: none;
}

.member-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  max-width: 190px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.member-filter-chip.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.member-filter-chip[class*="color-"] {
  border-color: color-mix(in srgb, var(--person-color, var(--accent)) 42%, var(--border));
  background: var(--person-bg, color-mix(in srgb, var(--accent) 10%, var(--surface)));
}

.member-filter-chip[class*="color-"].active {
  color: var(--text);
  border-color: var(--person-color, var(--accent));
  background: color-mix(in srgb, var(--person-color, var(--accent)) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--person-color, var(--accent)) 45%, transparent);
}

.member-filter-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-filter-chip strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.selected-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.selected-filter-label span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.calendar-month-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-month-title {
  min-width: 0;
  text-align: center;
}

.calendar-month-title h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  text-transform: capitalize;
}

.calendar-month-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-today-button {
  justify-self: center;
}

.calendar-month-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-month-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.calendar-month-grid {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, var(--bg));
  box-shadow: var(--shadow);
}

.calendar-month-day {
  display: grid;
  grid-template-rows: auto auto minmax(28px, 1fr);
  gap: 3px;
  min-width: 0;
  min-height: 86px;
  padding: 6px 5px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-month-day.outside-month {
  opacity: 0.48;
}

.calendar-month-day.today {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
}

.calendar-month-day.selected {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 56%, transparent);
}

.calendar-month-day.has-entries {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

.calendar-month-day-number {
  font-weight: 900;
  font-size: 0.88rem;
  line-height: 1;
}

.calendar-month-day-count {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  min-width: 18px;
  height: 18px;
  margin-top: -18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

.calendar-month-chip-list {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-self: end;
}

.calendar-month-entry,
.calendar-month-more {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  color: var(--text);
  font-size: 0.64rem;
  line-height: 1.2;
  font-weight: 850;
}

.calendar-month-entry.birthday {
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface-soft));
}

.calendar-month-entry.task {
  background: color-mix(in srgb, var(--green) 16%, var(--surface-soft));
}

.calendar-month-entry.waste {
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface-soft));
}

.calendar-month-entry[class*="person-color-"] {
  padding-left: 5px;
  border-left: 4px solid var(--person-color, var(--accent));
  background: var(--person-bg, color-mix(in srgb, var(--accent) 10%, var(--surface-soft)));
}

.calendar-month-more {
  color: var(--muted);
  text-align: center;
}

.calendar-selected-day {
  scroll-margin-top: 16px;
}

.calendar-month-agenda {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-compact-view {
  gap: 10px;
}

.calendar-compact-weekdays,
.calendar-compact-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-compact-weekdays {
  gap: 1px;
  padding: 0 2px;
}

.calendar-compact-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-compact-grid {
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  box-shadow: var(--shadow);
}

.calendar-compact-day {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
  min-height: 104px;
  padding: 4px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-compact-day.outside-month {
  opacity: 0.42;
}

.calendar-compact-day.today {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.calendar-compact-day.selected {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 62%, transparent);
}

.calendar-compact-day-head {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  line-height: 1;
}

.calendar-compact-day-number {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.calendar-compact-week-number {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
}

.calendar-compact-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: auto;
  padding: 0 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
}

.calendar-compact-event-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
}

.calendar-compact-event,
.calendar-compact-more {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  color: var(--text);
  font-size: 0.6rem;
  line-height: 1.15;
  font-weight: 850;
}

.calendar-compact-event[class*="person-color-"] {
  border-left: 3px solid var(--person-color, var(--accent));
  background: color-mix(in srgb, var(--person-color, var(--accent)) 16%, var(--surface));
}

.calendar-compact-event.birthday {
  background: color-mix(in srgb, var(--yellow) 22%, var(--surface));
}

.calendar-compact-event.task {
  background: color-mix(in srgb, var(--green) 18%, var(--surface));
}

.calendar-compact-event.waste {
  background: color-mix(in srgb, var(--yellow) 20%, var(--surface));
}

.calendar-compact-more {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
  color: var(--muted);
  text-align: center;
}

.compact-selected-day {
  margin-top: 2px;
}

.calendar-agenda-list {
  display: grid;
  gap: 8px;
}

.calendar-agenda-row {
  display: grid;
  grid-template-columns: minmax(72px, 86px) minmax(70px, 86px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.calendar-agenda-row > .small-icon-button {
  justify-self: end;
}

.calendar-agenda-row.birthday {
  border-color: color-mix(in srgb, var(--yellow) 32%, var(--border));
}

.calendar-agenda-row.task {
  border-color: color-mix(in srgb, var(--green) 30%, var(--border));
}

.calendar-agenda-row.waste {
  border-color: color-mix(in srgb, var(--yellow) 36%, var(--border));
}

.calendar-agenda-row[class*="person-color-"] {
  background: linear-gradient(90deg, var(--person-bg, var(--surface-soft)), color-mix(in srgb, var(--surface-soft) 70%, var(--surface)));
}

.calendar-agenda-date,
.calendar-agenda-time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-agenda-main {
  min-width: 0;
}

.calendar-agenda-main.has-avatar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.calendar-agenda-copy {
  min-width: 0;
}

.calendar-agenda-main strong,
.calendar-agenda-main small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.calendar-agenda-main strong {
  color: var(--text);
  line-height: 1.25;
}

.calendar-agenda-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.calendar-day-list,
.calendar-entry-list,
.member-manage-list {
  display: grid;
  gap: 11px;
}

.calendar-day-card,
.calendar-member-group {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-member-group[class*="person-color-"] {
  background: linear-gradient(90deg, var(--person-bg, var(--surface-soft)), var(--surface) 38%);
}

.calendar-member-group h3,
.calendar-day-header,
.member-card-name,
.family-member-manage .item-title {
  min-width: 0;
}

.calendar-member-group h3,
.calendar-day-header h3,
.family-member-manage .item-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.calendar-member-group h3,
.calendar-day-header h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.calendar-day-header > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.calendar-empty-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.calendar-entry {
  display: grid;
  grid-template-columns: minmax(68px, 84px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.calendar-entry.readonly {
  background: color-mix(in srgb, var(--surface-soft) 36%, var(--surface));
}

.calendar-entry.conflict {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
}

.person-color-neutral,
.member-filter-chip.color-neutral,
.member-badge.color-neutral,
.member-card.color-neutral,
.family-member-manage.color-neutral {
  --person-color: var(--muted);
  --person-bg: color-mix(in srgb, var(--muted) 9%, var(--surface));
}

.person-color-blue,
.member-filter-chip.color-blue,
.member-badge.color-blue,
.member-card.color-blue,
.family-member-manage.color-blue {
  --person-color: var(--accent);
  --person-bg: color-mix(in srgb, var(--accent) 13%, var(--surface));
}

.person-color-green,
.member-filter-chip.color-green,
.member-badge.color-green,
.member-card.color-green,
.family-member-manage.color-green {
  --person-color: var(--green);
  --person-bg: color-mix(in srgb, var(--green) 13%, var(--surface));
}

.person-color-yellow,
.member-filter-chip.color-yellow,
.member-badge.color-yellow,
.member-card.color-yellow,
.family-member-manage.color-yellow {
  --person-color: var(--yellow);
  --person-bg: color-mix(in srgb, var(--yellow) 16%, var(--surface));
}

.person-color-red,
.member-filter-chip.color-red,
.member-badge.color-red,
.member-card.color-red,
.family-member-manage.color-red {
  --person-color: var(--red);
  --person-bg: color-mix(in srgb, var(--red) 12%, var(--surface));
}

.person-color-violet,
.member-filter-chip.color-violet,
.member-badge.color-violet,
.member-card.color-violet,
.family-member-manage.color-violet {
  --person-color: #8b5cf6;
  --person-bg: color-mix(in srgb, #8b5cf6 13%, var(--surface));
}

.calendar-entry[class*="person-color-"],
.calendar-agenda-row[class*="person-color-"],
.calendar-member-group[class*="person-color-"] {
  border-left: 5px solid var(--person-color, var(--accent));
}

.calendar-entry[class*="person-color-"] {
  background: linear-gradient(90deg, var(--person-bg, var(--surface-soft)), color-mix(in srgb, var(--surface) 90%, var(--bg)));
}

.calendar-entry.readonly[class*="person-color-"] {
  background: linear-gradient(90deg, var(--person-bg, var(--surface-soft)), color-mix(in srgb, var(--surface-soft) 42%, var(--surface)));
}

.calendar-entry.conflict[class*="person-color-"] {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  border-left-color: var(--person-color, var(--accent));
  background: linear-gradient(90deg, color-mix(in srgb, var(--red) 12%, var(--surface)), color-mix(in srgb, var(--surface) 88%, var(--bg)));
}

.calendar-entry-time {
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.calendar-entry-main {
  min-width: 0;
}

.calendar-entry-actions {
  display: flex;
  gap: 6px;
}

.member-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.member-badge span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-badge .member-avatar,
.member-filter-chip .member-avatar,
.selected-filter-label .member-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.9rem;
}

.member-badge.color-blue,
.member-filter-chip .member-avatar.color-blue {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.member-badge.color-green {
  border-color: color-mix(in srgb, var(--green) 42%, var(--border));
}

.member-badge.color-yellow {
  border-color: color-mix(in srgb, var(--yellow) 42%, var(--border));
}

.member-badge.color-red {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
}

.member-badge.color-violet {
  border-color: color-mix(in srgb, #8b5cf6 42%, var(--border));
}

.member-badge[class*="color-"] {
  border-color: color-mix(in srgb, var(--person-color, var(--accent)) 44%, var(--border));
  background: var(--person-bg, color-mix(in srgb, var(--accent) 10%, var(--surface)));
}

.member-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-avatar.size-large {
  width: 58px;
  height: 58px;
  font-size: 1.55rem;
}

.member-avatar.color-blue {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.member-avatar.color-green {
  background: color-mix(in srgb, var(--green) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 38%, var(--border));
}

.member-avatar.color-yellow {
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--yellow) 38%, var(--border));
}

.member-avatar.color-red {
  background: color-mix(in srgb, var(--red) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
}

.member-avatar.color-violet {
  background: color-mix(in srgb, #8b5cf6 18%, var(--surface));
  border-color: color-mix(in srgb, #8b5cf6 36%, var(--border));
}

.member-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-card {
  display: grid;
  justify-items: start;
  gap: 9px;
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.member-card-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-card.color-blue,
.family-member-manage.color-blue {
  border-left: 5px solid #3b82f6;
}

.member-card.color-green,
.family-member-manage.color-green {
  border-left: 5px solid var(--green);
}

.member-card.color-yellow,
.family-member-manage.color-yellow {
  border-left: 5px solid var(--yellow);
}

.member-card.color-red,
.family-member-manage.color-red {
  border-left: 5px solid var(--red);
}

.member-card.color-violet,
.family-member-manage.color-violet {
  border-left: 5px solid #8b5cf6;
}

.member-card.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.member-card[class*="color-"],
.family-member-manage[class*="color-"] {
  background: linear-gradient(90deg, var(--person-bg, var(--surface)), var(--surface) 42%);
}

.member-card.active[class*="color-"] {
  border-color: var(--person-color, var(--accent));
  background: linear-gradient(90deg, color-mix(in srgb, var(--person-color, var(--accent)) 20%, var(--surface)), var(--surface) 48%);
}

.member-card-name {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.member-card-count {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.family-member-manage.inactive {
  opacity: 0.68;
}

.selected-member-events {
  margin-top: 4px;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  overflow: hidden;
}

.item-card.completed {
  opacity: 0.62;
}

.item-card.archived {
  opacity: 0.78;
}

.item-card.completed .item-title {
  text-decoration: line-through;
}

.item-leading {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.product-thumb {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-fallback-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.device-card,
.note-card {
  align-items: flex-start;
}

.note-card.pinned {
  border-color: color-mix(in srgb, var(--yellow) 32%, var(--border));
  background: color-mix(in srgb, var(--yellow) 7%, var(--surface));
}

.item-main {
  min-width: 0;
}

.item-title {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.item-meta,
.item-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.item-note {
  margin-top: 6px;
}

.note-content {
  white-space: pre-wrap;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.favorite-button {
  color: var(--muted);
}

.favorite-button.active {
  color: var(--yellow);
  border-color: color-mix(in srgb, var(--yellow) 45%, var(--border));
  background: color-mix(in srgb, var(--yellow) 12%, var(--surface));
}

.item-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.item-text-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.danger-text-button {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}

.check {
  width: 30px;
  height: 30px;
  accent-color: var(--accent);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.good {
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green);
}

.pill.warn {
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface));
  color: var(--yellow);
}

.pill.danger {
  background: color-mix(in srgb, var(--red) 16%, var(--surface));
  color: var(--red);
}

.counter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.counter-controls .secondary-button {
  flex: 1 1 100%;
  min-width: 0;
}

.counter-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.counter-step-button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.counter-value {
  min-width: 42px;
  text-align: center;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 12px;
  padding: 22px 18px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.empty-state p {
  margin: 0;
}

.empty-state.with-action {
  align-items: start;
}

.empty-state-action {
  width: fit-content;
  max-width: 100%;
}

.important-entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
}

.important-entry .summary-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 1.18rem;
}

.important-entry .item-title {
  margin-bottom: 3px;
  line-height: 1.25;
}

.important-entry .item-meta {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.important-entry + .important-entry {
  border-top: 1px solid var(--border);
}

.settings-block {
  padding: 16px;
}

.settings-section-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.settings-section-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-weight: 900;
  text-align: left;
}

.settings-section-button span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.settings-section-button.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

@media (min-width: 620px) {
  .settings-section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .settings-section-nav {
    grid-template-columns: 1fr;
  }
}

.settings-block + .settings-block {
  margin-top: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-label {
  font-weight: 800;
  min-width: 0;
}

.settings-value {
  color: var(--muted);
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-help {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.settings-intro {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal-soft) 70%, var(--surface)), var(--surface));
}

.customer-status-card {
  display: grid;
  gap: 10px;
}

.customer-status-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.customer-status-item.good {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.customer-status-item.warn,
.customer-status-item.progress {
  border-color: color-mix(in srgb, var(--yellow) 52%, var(--border));
  background: color-mix(in srgb, var(--yellow) 10%, var(--surface));
}

.customer-status-item.danger {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
}

.customer-status-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  font-size: 1.15rem;
}

.customer-status-item h3,
.customer-status-item p {
  margin: 0;
}

.customer-status-item h3 {
  font-size: 1rem;
}

.customer-status-item p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.customer-status-actions {
  margin-top: 12px;
}

.settings-disclosure {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.settings-disclosure summary {
  min-height: 48px;
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 850;
}

.settings-disclosure-content {
  padding: 0 14px 14px;
}

.settings-link-grid {
  display: grid;
  gap: 10px;
}

.settings-link-grid .secondary-button {
  width: 100%;
}

.permission-action-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--yellow) 50%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--yellow) 9%, var(--surface));
}

.permission-action-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.full-width-button {
  width: 100%;
}

.plan-grid {
  display: grid;
  gap: 12px;
}

.plan-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--accent) 4%), var(--surface));
  box-shadow: var(--shadow);
}

.plan-card.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--surface)), var(--surface));
}

.plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.plan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.pill.good {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

.plan-price {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 1.05rem;
}

.plan-feature-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.plan-feature-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.plan-feature-list li span:first-child {
  color: var(--accent);
  font-weight: 900;
}

.plan-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.plan-actions-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.premium-actions {
  margin-top: 12px;
}

.access-grant-status {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.access-grant-status p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.plan-note {
  margin-top: 12px;
}

.settings-actions {
  display: grid;
  gap: 10px;
}

.notification-form {
  display: grid;
  gap: 12px;
}

.notification-subsection {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.notification-subsection + .notification-subsection {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.notification-subsection h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-toggle-grid {
  display: grid;
  gap: 8px;
}

.compact-toggle {
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.compact-toggle:last-child {
  border-bottom: 0;
}

.cloud-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.cloud-form h3 {
  margin: 0;
  font-size: 0.98rem;
}

.cloud-form .button,
.cloud-form .secondary-button {
  width: 100%;
}

.household-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.household-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.household-card-main {
  min-width: 0;
}

.household-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.household-actions .item-text-button {
  width: 100%;
  min-width: 0;
  padding-right: 8px;
  padding-left: 8px;
}

.household-create-button {
  width: 100%;
}

.category-tabs {
  margin-bottom: 14px;
}

.category-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.category-manager-head > div {
  min-width: 0;
}

.category-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.category-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.category-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 8px;
}

.category-empty {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 15px;
  color: var(--muted);
  line-height: 1.45;
}

.category-actions-main {
  margin-top: 12px;
}

.category-actions-main > .button,
.category-actions-main > .secondary-button {
  width: 100%;
}

.backup-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
  background: rgba(10, 16, 27, 0.45);
}

.modal {
  width: min(100%, 680px);
  max-height: min(88vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
}

.form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.quick-hub {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.quick-hub-card,
.form-subsection {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.quick-hub-card h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.quick-hub-card .button {
  width: 100%;
}

.field {
  display: grid;
  gap: 7px;
}

.suggestion-field {
  position: relative;
  display: grid;
  gap: 8px;
}

.suggestion-popover {
  display: none;
}

.suggestion-popover:not(:empty) {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  box-shadow: var(--shadow);
}

.form-suggestion {
  display: grid;
  gap: 3px;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.form-suggestion span {
  min-width: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.form-suggestion small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.form-suggestion:active {
  border-color: var(--accent);
}

.field > span,
.toggle-field span,
.fieldset legend {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--muted);
}

.fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.member-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.member-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  font-weight: 800;
}

.member-checkbox.inactive {
  opacity: 0.62;
}

.member-checkbox input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  accent-color: var(--accent);
}

.field .member-checkbox input {
  width: 22px;
  min-height: 22px;
}

.member-checkbox span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  outline: 0;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 2px;
}

.toggle-field input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.content > .secondary-button,
.settings-block > .secondary-button,
.settings-block > .danger-button,
.settings-actions > .secondary-button {
  width: 100%;
}

.privacy-text {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 100vw;
  max-width: 100vw;
  min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 60px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.12;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
}

.nav-button .nav-icon {
  font-size: 1.18rem;
}

.nav-button span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}

.nav-button.active {
  background: var(--surface-soft);
  color: var(--accent);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 16px);
  left: 16px;
  z-index: 90;
  max-width: 560px;
  margin: 0 auto;
  padding: 13px 15px;
  border-radius: 16px;
  background: #172033;
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  text-align: center;
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.pwa-install-button {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 16px);
  z-index: 86;
  min-height: 46px;
  max-width: calc(100vw - 32px);
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 900;
  cursor: pointer;
}

.pwa-install-button[hidden] {
  display: none;
}

@media (min-width: 680px) {
  .toolbar.wrap {
    align-items: center;
    flex-direction: row;
  }

  .counter-controls .secondary-button {
    flex: 0 1 auto;
  }
}

@media (max-width: 430px) {
  .form-grid,
  .member-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .household-actions {
    grid-template-columns: 1fr;
  }

  .household-banner.has-switcher {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .household-dashboard-switcher {
    grid-column: 1 / -1;
  }

  .today-home-header,
  .today-progress-copy,
  .room-panel-header,
  .room-card {
    align-items: stretch;
    flex-direction: column;
  }

  .room-actions {
    justify-content: flex-start;
  }

  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .waste-overview,
  .waste-types-panel {
    padding: 14px;
  }

  .waste-type-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .waste-type-card .room-actions {
    grid-column: 2;
  }

  .category-manager-head,
  .category-card {
    grid-template-columns: 1fr;
  }

  .category-manager-head {
    display: grid;
  }

  .category-actions {
    grid-template-columns: 1fr;
  }

  .member-card-grid {
    grid-template-columns: 1fr;
  }

  .item-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .item-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .calendar-entry {
    grid-template-columns: minmax(58px, 74px) minmax(0, 1fr);
  }

  .calendar-entry-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .calendar-month-grid {
    gap: 4px;
    padding: 5px;
  }

  .calendar-month-day {
    min-height: 74px;
    padding: 5px 4px;
    border-radius: 10px;
  }

  .calendar-month-entry {
    font-size: 0.58rem;
  }

  .calendar-compact-day {
    min-height: 92px;
    padding: 3px;
  }

  .calendar-compact-day-number {
    font-size: 0.82rem;
  }

  .calendar-compact-week-number {
    font-size: 0.5rem;
  }

  .calendar-compact-count {
    min-width: 14px;
    height: 14px;
    font-size: 0.5rem;
  }

  .calendar-compact-event,
  .calendar-compact-more {
    padding: 1px 2px;
    font-size: 0.54rem;
  }

  .calendar-agenda-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    align-items: start;
  }

  .calendar-agenda-date,
  .calendar-agenda-time {
    font-size: 0.74rem;
  }

  .calendar-day-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .today-home-header .compact-button {
    flex: 1 1 auto;
    padding-right: 10px;
    padding-left: 10px;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .onboarding-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .onboarding-card {
    gap: 18px;
    padding: 20px 16px;
    border-radius: 22px;
  }

  .onboarding-icon {
    width: 104px;
    height: 104px;
    border-radius: 26px;
  }

  .onboarding-actions {
    gap: 8px;
  }

  .content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .top-bar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand-title.with-logo {
    gap: 10px;
  }

  .app-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .summary-card {
    min-height: 128px;
    padding: 13px;
  }

  .summary-grid .summary-card:first-child {
    min-height: 98px;
  }

  .summary-value {
    font-size: 1.05rem;
  }

  .summary-note,
  .summary-label {
    font-size: 0.82rem;
  }

  .calendar-day-card,
  .calendar-member-group {
    padding: 13px;
  }

  .calendar-entry {
    padding: 11px;
  }

  .calendar-month-toolbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 10px;
  }

  .calendar-month-title h2 {
    font-size: 1rem;
  }

  .calendar-month-title span {
    font-size: 0.74rem;
  }

  .calendar-month-weekdays,
  .calendar-month-grid {
    gap: 3px;
  }

  .calendar-month-day {
    min-height: 64px;
    padding: 4px 3px;
  }

  .calendar-month-day-number {
    font-size: 0.78rem;
  }

  .calendar-month-entry,
  .calendar-month-more {
    padding: 1px 3px;
    font-size: 0.54rem;
  }

  .calendar-compact-day {
    min-height: 82px;
    padding: 2px;
  }

  .calendar-compact-day-head {
    gap: 2px;
  }

  .calendar-compact-event-list {
    gap: 1px;
  }

  .calendar-compact-event,
  .calendar-compact-more {
    font-size: 0.5rem;
  }

  .more-card {
    grid-template-columns: 48px minmax(0, 1fr) 18px;
    min-height: 94px;
    padding: 14px;
  }

  .more-card .summary-value {
    font-size: 1.05rem;
    line-height: 1.18;
  }

  .more-card .summary-note {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .bottom-nav {
    gap: 2px;
    padding-right: 5px;
    padding-left: 5px;
  }
}

@media (min-width: 960px) and (pointer: fine) {
  body {
    background:
      radial-gradient(circle at top, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34rem),
      var(--bg);
  }

  .app-shell {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding-bottom: calc(var(--bottom-nav-height) + 34px);
  }

  .content {
    width: min(100%, 1040px);
    padding: 24px 28px 48px;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-grid .summary-card:first-child {
    grid-column: span 2;
  }

  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    right: auto;
    bottom: 14px;
    left: 50%;
    width: min(calc(100vw - 32px), 780px);
    max-width: 780px;
    min-height: 72px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transform: translateX(-50%);
  }

  .toast {
    bottom: 104px;
  }

  .pwa-install-button {
    right: calc((100vw - min(100vw, 1120px)) / 2 + 28px);
    bottom: 104px;
  }
}



.barcode-intro {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
}

.barcode-intro-actions {
  justify-content: flex-start;
}

.pantry-group {
  display: grid;
  gap: 10px;
}

.pantry-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.pantry-group-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.pantry-group-header span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.household-card.has-warning {
  border-color: color-mix(in srgb, var(--yellow) 40%, var(--border));
}

.household-overview {
  margin-top: 3px;
}

/* Redesign Phase 1/2: shared UI primitives and shopping experience. */
:root {
  --bg: #f6faf9;
  --surface: #ffffff;
  --surface-soft: #e8f5f2;
  --text: #0f2e35;
  --muted: #667780;
  --border: #dce7e5;
  --accent: #0f8f82;
  --accent-strong: #08756b;
  --teal-soft: #dff2ef;
  --blue: #287dd1;
  --coral: #f06455;
  --yellow: #e2a229;
  --shadow: 0 14px 34px rgba(15, 46, 53, 0.09);
  --shadow-soft: 0 8px 22px rgba(15, 46, 53, 0.07);
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  --accent: #41cbbb;
  --accent-strong: #79eadc;
  --teal-soft: #173e3c;
  --blue: #73b7ff;
  --coral: #ff8b7f;
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.app-panel {
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, var(--teal-soft));
  box-shadow: var(--shadow-soft);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-header h3,
.section-header p {
  margin: 0;
}

.section-header h3 {
  font-size: 1.02rem;
  color: var(--text);
}

.section-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.shopping-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal-soft) 74%, var(--surface)), var(--surface));
}

.shopping-hero h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.shopping-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shopping-tabs::-webkit-scrollbar {
  display: none;
}

.shopping-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.shopping-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
}

.shopping-summary-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
}

.shopping-summary-metric .summary-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.shopping-summary-metric strong {
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

.shopping-summary-metric span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.shopping-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-soft));
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.shopping-progress small {
  color: var(--muted);
}

.shopping-category-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.shopping-category-card {
  overflow: hidden;
}

.shopping-category-header {
  padding: 14px 16px;
  background: color-mix(in srgb, var(--teal-soft) 38%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
}

.shopping-item-list {
  display: grid;
}

.shopping-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
}

.shopping-item:last-child {
  border-bottom: 0;
}

.shopping-item.completed {
  opacity: 0.7;
}

.shopping-item.completed .item-title {
  text-decoration: line-through;
}

.shopping-item.archived {
  opacity: 0.78;
}

.shopping-item-leading {
  grid-template-columns: auto auto;
  align-items: center;
}

.shopping-item-actions {
  align-items: center;
}

.product-thumb {
  position: relative;
}

.product-thumb-button {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: zoom-in;
  box-shadow: var(--shadow-soft);
}

.product-thumb-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 46%, transparent);
  outline-offset: 3px;
}

.product-zoom-indicator {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.image-lightbox-backdrop {
  z-index: 90;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  background: rgba(8, 16, 20, 0.72);
}

.image-lightbox {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 680px);
  max-height: min(92vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.image-lightbox-actions {
  position: absolute;
  inset: 12px 12px auto 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.lightbox-control {
  pointer-events: auto;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(10px);
}

.image-lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  margin: 0;
}

.image-lightbox-figure img {
  width: 100%;
  height: 100%;
  max-height: calc(92vh - 150px);
  object-fit: contain;
  background: #111;
}

.image-lightbox-figure figcaption {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.image-lightbox-figure figcaption span {
  color: var(--muted);
}

.image-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 56px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 800;
}

.image-lightbox-footer .small-icon-button:disabled {
  opacity: 0.38;
}

@media (max-width: 520px) {
  .shopping-hero,
  .shopping-tools {
    grid-template-columns: 1fr;
  }

  .shopping-hero {
    display: grid;
  }

  .shopping-summary {
    grid-template-columns: 1fr;
  }

  .shopping-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .shopping-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .image-lightbox {
    border-radius: 18px;
  }
}

/* Redesign Phase 3: dashboard. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  background: linear-gradient(135deg, var(--teal-soft), var(--surface));
  overflow: hidden;
}

.home-hero-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1.12;
}

.home-hero-illustration {
  display: grid;
  place-items: center;
  width: 92px;
  min-height: 82px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 56%, transparent);
  font-size: 2.4rem;
}

.home-stat-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.home-stat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border-left: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.home-stat:first-child {
  border-left: 0;
}

.home-stat .summary-icon {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
}

.home-stat strong {
  font-size: 1.18rem;
  line-height: 1;
}

.home-stat span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.dashboard-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-module-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.dashboard-module-card header,
.dashboard-wide-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-module-card h3,
.dashboard-wide-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.dashboard-module-card p,
.dashboard-wide-head p {
  margin: 3px 0 0;
  color: var(--coral);
  font-weight: 800;
}

.dashboard-preview-list {
  display: grid;
  gap: 8px;
  min-height: 84px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-preview-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.dashboard-preview-list span {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.dashboard-preview-list small,
.dashboard-empty-line {
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-empty-line {
  min-height: 84px;
  margin: 0;
}

.dashboard-wide-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
}

.quick-action-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-bottom: 10px;
  padding: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.quick-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.quick-action-primary {
  justify-self: stretch;
  grid-template-columns: auto auto;
  justify-content: center;
  text-align: center;
}

.quick-action span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 900;
}

.quick-action strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  line-height: 1.2;
}

@media (max-width: 560px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-hero-illustration {
    width: 72px;
    min-height: 66px;
    font-size: 2rem;
  }

  .home-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stat {
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  }

  .dashboard-module-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-bar {
    grid-template-columns: 1fr;
  }
}

/* Redesign Phase 4/5: calendar and tasks. */
.calendar-command-bar,
.task-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
}

.calendar-command-bar h2,
.task-command-bar h2 {
  margin: 0;
  font-size: 1.26rem;
  line-height: 1.15;
}

.calendar-command-actions,
.calendar-view-switcher,
.task-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.calendar-command-actions::-webkit-scrollbar,
.calendar-view-switcher::-webkit-scrollbar,
.task-filter-row::-webkit-scrollbar {
  display: none;
}

.calendar-view {
  display: grid;
  gap: 12px;
}

.calendar-filter-panel,
.calendar-day-card,
.calendar-month-agenda {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.member-filter-chip {
  border-radius: 999px;
}

.calendar-month-toolbar,
.calendar-month-grid {
  box-shadow: var(--shadow-soft);
}

.calendar-entry {
  border-radius: 14px;
}

.task-section-list {
  display: grid;
  gap: 14px;
}

.task-group {
  overflow: hidden;
}

.task-group-header {
  padding: 14px 16px;
  background: color-mix(in srgb, var(--teal-soft) 38%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
}

.task-group-list {
  margin: 0;
}

.task-group-list .item-card {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
  border-radius: 0;
  box-shadow: none;
}

.task-group-list .item-card:last-child {
  border-bottom: 0;
}

.room-panel {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 520px) {
  .calendar-command-bar,
  .task-command-bar {
    display: grid;
  }

  .calendar-command-actions {
    justify-content: stretch;
  }

  .calendar-command-actions .button,
  .calendar-command-actions .secondary-button,
  .task-command-bar .button {
    width: 100%;
  }
}

/* Redesign Phase 6: more and organisation. */
.more-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  background: linear-gradient(135deg, var(--teal-soft), var(--surface));
}

.more-hero h2,
.more-hero p {
  margin: 0;
}

.more-hero h2 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.more-hero p {
  margin-top: 8px;
  color: var(--text);
  line-height: 1.4;
}

.more-hero > span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 56%, transparent);
  font-size: 2.2rem;
}

.more-section-list {
  display: grid;
  gap: 14px;
}

.more-section {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.more-section-header h3 span {
  margin-right: 4px;
}

.more-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.more-card-grid .more-card {
  min-height: 132px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 620px) {
  .more-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .more-card-grid {
    grid-template-columns: 1fr;
  }
}

/* High-Fidelity Visual Polish: softer premium mobile app finish. */
:root {
  --bg: #fbf8f1;
  --surface: #ffffff;
  --surface-soft: #eef7f3;
  --surface-warm: #fffaf2;
  --text: #0b3540;
  --muted: #687a7f;
  --border: #e7ece8;
  --accent: #0b8d82;
  --accent-strong: #075f59;
  --teal-soft: #e0f2ee;
  --green: #2f9b75;
  --blue: #2f7fbd;
  --coral: #f06050;
  --yellow: #e2a52d;
  --red: #d24a3c;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 46px rgba(17, 63, 68, 0.08);
  --shadow-soft: 0 10px 24px rgba(17, 63, 68, 0.065);
  --shadow-lift: 0 24px 60px rgba(17, 63, 68, 0.12);
  --bottom-nav-height: 76px;
}

:root[data-theme="dark"] {
  --bg: #0f1718;
  --surface: #172222;
  --surface-soft: #1d3130;
  --surface-warm: #2c2517;
  --text: #edf7f5;
  --muted: #a9bab8;
  --border: #29413f;
  --accent: #48d0c3;
  --accent-strong: #86eee4;
  --teal-soft: #163e3b;
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.26);
  --shadow-lift: 0 24px 60px rgba(0, 0, 0, 0.42);
}

body {
  background:
    radial-gradient(circle at 22% -10%, color-mix(in srgb, var(--teal-soft) 62%, transparent) 0 230px, transparent 236px),
    linear-gradient(180deg, #fffdf8 0, var(--bg) 420px, #f8fbf8 100%);
}

.app-shell {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 18px);
}

.top-bar {
  align-items: center;
  gap: 12px;
  padding: calc(20px + env(safe-area-inset-top)) 20px 12px;
  border-bottom: 0;
  background: color-mix(in srgb, #fffdf8 86%, transparent);
  box-shadow: none;
}

.brand-title {
  gap: 10px;
}

.app-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--teal-soft) 58%, var(--surface)));
}

.page-title {
  max-width: 100%;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 8vw, 2.55rem);
  line-height: 1.08;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.page-subtitle {
  margin-top: 4px;
  font-size: clamp(0.78rem, 2.7vw, 0.9rem);
  line-height: 1.28;
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.content {
  width: min(100%, 720px);
  padding: 14px 16px 22px;
}

.app-panel,
.card,
.summary-card,
.empty-state,
.settings-block {
  border-color: color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 98%, var(--teal-soft));
  box-shadow: var(--shadow-soft);
}

.button,
.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 0.92rem;
  font-weight: 760;
}

.button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 24%, transparent);
}

.button:active {
  transform: translateY(1px);
}

.secondary-button {
  background: color-mix(in srgb, var(--surface) 92%, var(--teal-soft));
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(17, 63, 68, 0.04);
}

.compact-button {
  min-height: 40px;
  padding-inline: 12px;
}

.icon-button,
.small-icon-button {
  border-color: color-mix(in srgb, var(--border) 76%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, var(--teal-soft));
  box-shadow: 0 12px 26px rgba(17, 63, 68, 0.065);
}

.icon-button {
  inline-size: 48px;
  block-size: 48px;
  padding: 0;
  border-radius: 999px;
}

.small-icon-button {
  inline-size: 42px;
  block-size: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 14px;
}

.summary-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
  font-size: 1.3rem;
}

.ui-icon {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.summary-icon .ui-icon,
.nav-icon .ui-icon,
.small-icon-button .ui-icon,
.icon-button .ui-icon {
  width: 58%;
  height: 58%;
}

.button .ui-icon,
.secondary-button .ui-icon,
.quick-action .ui-icon {
  width: 1.08em;
  height: 1.08em;
}

.section-title-icon {
  display: inline-grid;
  place-items: center;
  width: 1.12em;
  height: 1.12em;
  margin-right: 7px;
  color: var(--accent-strong);
  vertical-align: -0.15em;
}

.section-title-icon .ui-icon {
  width: 100%;
  height: 100%;
}

.eyebrow {
  margin-bottom: 7px;
  color: color-mix(in srgb, var(--accent-strong) 88%, var(--text));
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.section-header h3 {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.18;
  font-weight: 700;
}

.section-header p,
.item-meta,
.item-note,
.summary-note,
.dashboard-preview-list small,
.dashboard-empty-line {
  color: color-mix(in srgb, var(--muted) 92%, var(--text));
}

.segmented {
  gap: 4px;
  padding: 4px;
  border-color: color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
  box-shadow: inset 0 1px 1px rgba(17, 63, 68, 0.03);
}

.segment-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-weight: 850;
}

.segment-button.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--teal-soft) 72%, var(--surface)));
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(17, 63, 68, 0.08);
}

.search-field {
  min-height: 56px;
  padding-inline: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-soft);
}

.status-badge {
  background: color-mix(in srgb, var(--teal-soft) 80%, var(--surface));
}

.household-banner {
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 86%, var(--teal-soft));
  box-shadow: none;
}

.household-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 1rem;
}

.household-copy strong {
  font-size: 0.92rem;
}

.household-copy span {
  font-size: 0.74rem;
}

.home-hero,
.shopping-hero,
.calendar-command-bar,
.task-command-bar,
.more-hero {
  border: 0;
  box-shadow: var(--shadow);
}

.home-hero,
.more-hero {
  padding: 14px 16px 12px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal-soft) 88%, var(--surface)), color-mix(in srgb, var(--surface-warm) 62%, var(--surface)));
}

.home-hero-copy h2,
.more-hero h2 {
  max-width: 12em;
  font-family: var(--font-serif);
  font-size: clamp(1.14rem, 4.5vw, 1.38rem);
  font-weight: 700;
  letter-spacing: 0;
}

.home-hero-copy p:not(.eyebrow) {
  margin: 4px 0 0;
  max-width: 13em;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-size: 0.84rem;
  line-height: 1.35;
}

.home-hero-illustration,
.more-hero > span {
  width: 134px;
  min-height: 72px;
  overflow: visible;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.home-hero-illustration img,
.more-hero > span img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 72px;
  object-fit: contain;
  object-position: center;
}

.home-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  padding: 6px 0 0;
  border-top: 0;
}

.home-stat {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 48px;
  padding: 4px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 0;
  background: transparent;
}

.home-stat .summary-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.72);
}

.home-stat strong {
  font-family: var(--font-serif);
  color: var(--accent-strong);
  font-size: 1.08rem;
}

.home-stat span:last-child {
  font-size: 0.75rem;
  line-height: 1.15;
  overflow-wrap: normal;
}

.dashboard-module-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.dashboard-module-card,
.dashboard-wide-card,
.more-section {
  padding: 10px;
  border-radius: 18px;
}

.dashboard-module-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 164px;
}

.dashboard-module-card:nth-child(n + 3) {
  min-height: 132px;
}

.dashboard-module-card .summary-icon,
.dashboard-wide-head .summary-icon {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.dashboard-module-card h3,
.dashboard-wide-head h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-module-card .secondary-button,
.dashboard-wide-card .secondary-button {
  min-height: 34px;
  padding: 5px 7px;
  font-size: 0.75rem;
  line-height: 1.15;
}

.dashboard-module-card header,
.dashboard-wide-head {
  align-items: flex-start;
  gap: 8px;
}

.dashboard-module-card p,
.dashboard-wide-head p {
  color: color-mix(in srgb, var(--accent-strong) 78%, var(--muted));
  font-weight: 700;
  font-size: 0.76rem;
  line-height: 1.2;
}

.dashboard-preview-list {
  gap: 2px;
  min-height: 0;
}

.dashboard-preview-list li {
  padding-block: 0;
}

.dashboard-preview-list span {
  font-weight: 720;
  font-size: 0.84rem;
  line-height: 1.18;
}

.dashboard-preview-list small {
  font-size: 0.7rem;
  line-height: 1.15;
}

.dashboard-module-shopping .dashboard-preview-list small,
.dashboard-module-tasks .dashboard-preview-list small {
  display: none;
}

.dashboard-module-tasks .dashboard-preview-list li:nth-child(n + 4) {
  display: none;
}

.dashboard-empty-line {
  min-height: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard-wide-card {
  display: grid;
  grid-template-columns: minmax(92px, 0.45fr) minmax(0, 1fr);
  gap: 6px;
  padding: 8px 10px;
}

.dashboard-wide-card .dashboard-wide-head {
  grid-column: 1;
}

.dashboard-wide-card .dashboard-preview-list {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dashboard-wide-card .dashboard-preview-list li {
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--yellow) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-warm) 72%, var(--surface));
}

.dashboard-wide-card .dashboard-preview-list span {
  font-size: 0.76rem;
}

.dashboard-wide-card .dashboard-preview-list small {
  font-size: 0.66rem;
}

.dashboard-wide-card .dashboard-preview-list li:nth-child(n + 3) {
  display: none;
}

.dashboard-wide-card > .secondary-button {
  grid-column: 1 / -1;
}

.quick-action-bar {
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-strong) 86%, #0b4f56));
  box-shadow: var(--shadow);
}

.quick-action {
  min-height: 44px;
  padding: 4px 5px;
  border-radius: 14px;
}

.quick-action-primary {
  min-height: 52px;
}

.quick-action span {
  width: 30px;
  height: 30px;
}

.quick-action strong {
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.shopping-hero {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 6px 2px 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.task-command-bar .button,
.calendar-command-actions .button,
.calendar-command-actions .secondary-button {
  justify-self: start;
  width: auto;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 14px;
  font-size: 0.84rem;
}

.shopping-hero h2,
.calendar-command-bar h2,
.task-command-bar h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.34rem, 6vw, 1.78rem);
  font-weight: 700;
}

.task-command-bar .button,
.calendar-command-actions .button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.shopping-tabs {
  align-items: stretch;
  overflow-x: visible;
}

.shopping-tabs .segmented {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  overflow: visible;
}

.shopping-tabs .segment-button {
  min-width: 0;
  padding: 0 6px;
  font-size: clamp(0.72rem, 2.5vw, 0.84rem);
}

.shopping-tools {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.shopping-tools .search-field {
  min-height: 46px;
  padding-inline: 12px;
}

.shopping-tools .search-field input {
  font-size: 0.94rem;
}

.shopping-tools .secondary-button {
  min-height: 40px;
}

.shopping-tools {
  margin-bottom: 16px;
}

.shopping-add-button {
  min-height: 46px;
  padding-inline: 11px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.shopping-scan-button {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 32px;
  padding-inline: 9px;
  font-size: 0.75rem;
}

.shopping-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal-soft) 80%, var(--surface)), color-mix(in srgb, var(--surface) 88%, var(--teal-soft)));
}

.shopping-summary-metric strong {
  color: var(--accent-strong);
  font-size: 1.08rem;
}

.shopping-summary-metric .summary-icon {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.shopping-summary-metric span:last-child {
  font-size: 0.74rem;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.shopping-summary-progress {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.shopping-summary-progress strong {
  color: var(--accent-strong);
  font-size: 0.84rem;
  line-height: 1.15;
}

.shopping-summary-progress small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
}

.shopping-category-list {
  gap: 10px;
  margin-top: 10px;
}

.shopping-category-card,
.task-group {
  border-radius: 18px;
}

.shopping-category-header,
.task-group-header {
  padding: 9px 12px;
  background: color-mix(in srgb, var(--teal-soft) 52%, var(--surface));
}

.shopping-category-header h3,
.task-group-header h3 {
  display: flex;
  align-items: center;
  gap: 0;
}

.shopping-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  min-height: 90px;
  padding: 9px 10px;
}

.shopping-item .item-title,
.calendar-entry .item-title,
.task-group-list .item-title {
  font-weight: 760;
  line-height: 1.22;
}

.product-thumb-button {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--border) 74%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 84%, var(--surface));
}

.product-zoom-indicator {
  right: -6px;
  bottom: -6px;
  width: 24px;
  height: 24px;
}

.shopping-item-leading {
  gap: 7px;
}

.shopping-item .item-main {
  align-self: center;
}

.shopping-item .item-meta,
.shopping-item .item-note {
  font-size: 0.72rem;
  line-height: 1.2;
}

.shopping-item-quantity {
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 38px;
  color: var(--muted);
  font-size: 0.7rem;
}

.shopping-item-quantity strong {
  color: var(--text);
  font-size: 0.9rem;
}

.shopping-item-actions {
  display: grid;
  grid-column: auto;
  grid-row: auto;
  grid-template-columns: 1fr;
  gap: 4px;
}

.shopping-item-actions .small-icon-button {
  min-width: 30px;
  min-height: 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.shopping-item-actions .ui-icon {
  width: 15px;
  height: 15px;
}

.shopping-archive-button {
  width: 100%;
  margin-top: 10px;
}

.product-zoom-indicator .ui-icon {
  width: 58%;
  height: 58%;
}

.image-lightbox-backdrop {
  background: rgba(5, 24, 27, 0.78);
  backdrop-filter: blur(6px);
}

.image-lightbox {
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 98%, var(--teal-soft));
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.38);
}

.image-lightbox-figure img {
  background: #0c1415;
}

.image-lightbox-figure figcaption,
.image-lightbox-footer {
  background: color-mix(in srgb, var(--surface) 95%, var(--teal-soft));
}

.calendar-command-bar,
.task-command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 84%, var(--teal-soft)), var(--surface));
}

.calendar-command-bar {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 2px;
  background: transparent;
  box-shadow: none;
}

.calendar-command-bar > div:first-child {
  display: none;
}

.calendar-command-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

.calendar-view-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: visible;
}

.calendar-view-switcher .segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  overflow: visible;
}

.calendar-view-switcher .segment-button {
  min-width: 0;
  padding-inline: 4px;
  font-size: clamp(0.64rem, 2.2vw, 0.75rem);
}

.calendar-view-switcher > .secondary-button {
  justify-self: end;
  inline-size: auto;
  min-width: 36px;
  min-height: 34px;
  padding-inline: 8px;
  border-radius: 12px;
  font-size: 0.72rem;
}

.calendar-task-toggle .ui-icon {
  width: 15px;
  height: 15px;
}

.calendar-today-button {
  display: none;
}

.calendar-command-actions,
.calendar-view-switcher,
.task-filter-row {
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.calendar-view {
  gap: 7px;
}

.calendar-filter-panel,
.calendar-day-card,
.calendar-month-agenda {
  border-color: color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--teal-soft));
  box-shadow: var(--shadow-soft);
}

.calendar-filter-panel {
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calendar-filter-header {
  display: none;
}

.member-filter-list,
.category-filter-list,
.room-chip-list {
  margin-inline: -2px;
  padding: 0 2px 3px;
  scroll-padding-inline: 2px;
}

.calendar-filter-panel .member-filter-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.calendar-filter-panel .member-filter-list::-webkit-scrollbar {
  display: none;
}

.member-filter-chip,
.room-chip {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.calendar-filter-panel .member-filter-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  flex: 0 0 auto;
  min-width: 92px;
  max-width: 180px;
  align-items: center;
  justify-content: stretch;
  gap: 6px;
  width: auto;
}

.calendar-filter-panel .member-filter-chip .member-avatar {
  width: 23px;
  height: 23px;
}

.category-filter-chip {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.category-chip-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
}

.category-chip-icon .ui-icon {
  width: 60%;
  height: 60%;
}

.category-filter-chip.tone-blue .category-chip-icon {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, var(--surface));
}

.category-filter-chip.tone-green .category-chip-icon {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
}

.category-filter-chip.tone-coral .category-chip-icon {
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
}

.category-filter-chip.tone-violet .category-chip-icon {
  color: #8f5bd7;
  background: color-mix(in srgb, #8f5bd7 14%, var(--surface));
}

.category-filter-chip.tone-yellow .category-chip-icon {
  color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 16%, var(--surface));
}

.category-filter-chip.active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent-strong);
}

.calendar-month-toolbar {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 5px;
  min-height: 42px;
  padding: 3px 5px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calendar-month-toolbar .small-icon-button {
  min-width: 32px;
  min-height: 32px;
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.calendar-month-title h2 {
  color: var(--text);
  font-size: clamp(0.98rem, 4vw, 1.12rem);
  font-weight: 760;
}

.calendar-month-title span {
  display: none;
}

.calendar-month-weekdays {
  gap: 2px;
  padding-inline: 4px;
}

.calendar-month-weekdays span {
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}

.calendar-month-grid {
  gap: 2px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 16px;
  background: var(--surface);
}

.calendar-month-day {
  grid-template-rows: auto 1fr;
  aspect-ratio: 1.34 / 1;
  min-height: 0;
  padding: 4px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  border-radius: 9px;
  background: transparent;
}

.calendar-month-day.today .calendar-month-day-number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.calendar-month-day.selected {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
}

.calendar-month-day-count {
  min-width: 16px;
  height: 16px;
  margin-top: -16px;
  font-size: 0.6rem;
}

.calendar-month-day-count:empty,
.calendar-compact-count:empty {
  display: none;
}

.calendar-month-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-content: end;
  align-items: end;
  gap: 3px;
  min-height: 10px;
}

.calendar-month-entry,
.calendar-month-more {
  width: 5px;
  height: 5px;
  padding: 0;
  border-radius: 999px;
  border-left: 0;
  font-size: 0;
  line-height: 0;
}

.calendar-agenda-row,
.calendar-entry {
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.calendar-entry {
  padding: 9px;
}

.calendar-entry-time {
  color: var(--accent-strong);
  font-size: 0.78rem;
}

.calendar-selected-day {
  overflow: hidden;
  padding: 0;
}

.calendar-selected-day .calendar-day-header {
  align-items: center;
  flex-direction: row;
  margin-bottom: 0;
  padding: 9px 10px;
}

.calendar-selected-day .calendar-entry-list {
  gap: 0;
}

.calendar-selected-day .calendar-entry {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 60px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-left: 4px solid var(--member-color, var(--accent));
  border-radius: 0;
  box-shadow: none;
}

.calendar-selected-day .calendar-entry:last-child {
  border-bottom: 0;
}

.calendar-selected-day .calendar-entry .item-meta {
  margin-top: 2px;
  font-size: 0.7rem;
}

.calendar-selected-day .calendar-entry-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  column-gap: 4px;
}

.calendar-selected-day .calendar-entry-main > .item-title,
.calendar-selected-day .calendar-entry-main > .item-meta,
.calendar-selected-day .calendar-entry-main > .item-note {
  grid-column: 1 / -1;
}

.calendar-selected-day .calendar-entry-main > .member-badge-row {
  grid-column: 1;
}

.calendar-selected-day .calendar-entry-main > .pill-row {
  grid-column: 2;
}

.calendar-selected-day .member-badge-row,
.calendar-selected-day .pill-row {
  display: inline-flex;
  gap: 4px;
  margin-top: 3px;
}

.calendar-selected-day .member-badge,
.calendar-selected-day .pill {
  min-height: 21px;
  padding: 2px 6px;
  font-size: 0.62rem;
}

.calendar-selected-day .calendar-entry-actions {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  gap: 3px;
}

.calendar-selected-day .calendar-entry-actions .small-icon-button {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
}

.room-panel {
  gap: 9px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 18px;
}

.room-panel-header {
  gap: 8px;
}

.room-panel-header .item-title {
  margin-bottom: 2px;
  font-size: 0.96rem;
}

.room-panel-header .item-meta {
  font-size: 0.78rem;
}

.room-panel-header .item-text-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding-inline: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.task-section-list {
  gap: 10px;
}

.task-group-header {
  padding: 11px 12px;
}

.task-group-header h3 {
  font-size: 1rem;
}

.task-group-header p {
  font-size: 0.8rem;
}

.task-group-list .item-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}

.task-group-list .item-card .item-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.task-group-list .item-meta {
  font-size: 0.78rem;
  line-height: 1.3;
}

.task-group-list .pill {
  min-height: 28px;
  font-size: 0.72rem;
}

.calendar-entry-actions .small-icon-button {
  min-width: 38px;
  min-height: 38px;
}

.calendar-compact-day {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.calendar-compact-event,
.calendar-compact-more {
  height: 5px;
  padding: 0;
  border-left: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
}

.more-hero {
  margin-bottom: 10px;
}

.more-hero > div {
  min-width: 0;
  flex: 1 1 auto;
}

.more-hero > span {
  flex: 0 0 134px;
}

.more-hero p {
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted) 68%, var(--text));
  font-size: 0.82rem;
  line-height: 1.25;
}

.more-section-list {
  gap: 9px;
}

.more-section-header {
  align-items: flex-start;
}

.more-section-header h3 {
  font-size: 1rem;
}

.more-section-header p {
  margin-top: 2px;
  font-size: 0.76rem;
  line-height: 1.22;
}

.more-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.more-card-grid .more-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: start;
  min-height: 100px;
  padding: 9px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-soft) 42%, var(--surface)));
  box-shadow: 0 10px 24px rgba(17, 63, 68, 0.06);
  text-align: left;
}

.more-card-grid .more-card::after {
  content: none;
}

.more-card-grid .more-card .summary-icon {
  grid-column: auto;
  grid-row: auto;
  width: 29px;
  height: 29px;
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.more-card-grid .more-card .summary-value {
  grid-column: auto;
  grid-row: auto;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.14;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.more-card-grid .more-card .summary-note {
  grid-column: auto;
  grid-row: auto;
  font-size: 0.68rem;
  font-weight: 560;
  line-height: 1.24;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

@media (min-width: 390px) {
  .more-layout-modules .more-card:nth-child(4):last-child {
    grid-column: 1 / -1;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 54px;
    padding: 7px 9px;
  }

  .more-layout-modules .more-card:nth-child(4):last-child .summary-icon {
    grid-row: 1 / 3;
    margin: 0;
  }
}

.more-layout-list .more-card-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.more-layout-list .more-card-grid .more-card {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 50px;
  padding: 6px 9px;
}

.more-layout-list .more-card-grid .more-card .summary-icon {
  grid-row: 1 / 3;
  margin: 0;
}

.more-layout-list .more-card-grid .more-card .summary-value,
.more-layout-list .more-card-grid .more-card .summary-note {
  grid-column: 2;
}

.bottom-nav {
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  max-width: none;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  min-height: 0;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 0;
  background: var(--surface);
  backdrop-filter: none;
  box-shadow: 0 -10px 28px rgba(17, 63, 68, 0.08);
}

.nav-button {
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  color: color-mix(in srgb, var(--muted) 78%, var(--text));
  font-size: 0.67rem;
  font-weight: 680;
}

.nav-button .nav-icon {
  font-size: 1.16rem;
}

.nav-button.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
}

@media (max-width: 560px) {
  .home-hero,
  .more-hero {
    padding: 12px 14px 10px;
  }

  .home-stat-grid {
    gap: 8px;
    border-top: 0;
  }

  .home-stat {
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
    border-radius: 0;
    background: transparent;
  }

  .home-stat:first-child {
    border-left: 0;
  }

  .dashboard-module-card,
  .dashboard-wide-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .shopping-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shopping-progress {
    grid-column: 1 / -1;
  }

  .calendar-entry {
    grid-template-columns: minmax(48px, 62px) minmax(0, 1fr);
  }

  .calendar-selected-day .calendar-entry {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .calendar-entry-actions {
    grid-column: 2;
    justify-content: flex-end;
  }
}

@media (max-width: 389px) {
  .more-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .content {
    padding-inline: 14px;
  }

  .bottom-nav {
    right: 0;
    left: 0;
    border-radius: 0;
  }

  .page-title {
    font-size: clamp(1.28rem, 5.4vw, 1.48rem);
  }

  .top-bar {
    padding-inline: 14px;
  }

  .app-logo-mark {
    width: 40px;
    height: 40px;
  }

  .top-bar .icon-button {
    min-width: 40px;
    min-height: 40px;
    border-radius: 14px;
  }

  .shopping-tools {
    grid-template-columns: 1fr;
  }

  .shopping-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopping-summary-progress {
    grid-column: 1 / -1;
  }

  .shopping-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .shopping-item-quantity {
    grid-column: 2;
  }

  .shopping-item-actions {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .shopping-add-button {
    width: 100%;
  }

  .home-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stat:nth-child(3) {
    border-left: 0;
  }

  .home-hero-illustration,
  .more-hero > span {
    width: 116px;
    flex-basis: 116px;
  }

  .dashboard-wide-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-wide-card .dashboard-wide-head,
  .dashboard-wide-card .dashboard-preview-list {
    grid-column: 1;
  }

  .calendar-task-toggle span {
    display: none;
  }
}

/* Reference Pass 9: semantic module accents and category-first shopping. */
:root {
  --module-shopping: #0b8d82;
  --module-shopping-soft: #e1f3ef;
  --module-tasks: #3978bd;
  --module-tasks-soft: #e8f1fb;
  --module-calendar: #6158c7;
  --module-calendar-soft: #eeecfb;
  --module-birthdays: #d96858;
  --module-birthdays-soft: #fbece8;
  --module-pantry: #b9781c;
  --module-pantry-soft: #fbf0dc;
  --module-family: #7b58b7;
  --module-family-soft: #f0eafb;
  --module-reminders: #b87c13;
  --module-reminders-soft: #fbf0d8;
  --module-settings: #49666d;
  --module-settings-soft: #e9eff0;
}

:root[data-theme="dark"] {
  --module-shopping: #50d2c5;
  --module-shopping-soft: #173d3a;
  --module-tasks: #79ade7;
  --module-tasks-soft: #1b3047;
  --module-calendar: #aaa3f0;
  --module-calendar-soft: #2b2949;
  --module-birthdays: #f29382;
  --module-birthdays-soft: #472b28;
  --module-pantry: #e6ad55;
  --module-pantry-soft: #44331d;
  --module-family: #b89ae8;
  --module-family-soft: #35294a;
  --module-reminders: #e8b858;
  --module-reminders-soft: #45361c;
  --module-settings: #9ab4ba;
  --module-settings-soft: #263639;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --module-shopping: #50d2c5;
    --module-shopping-soft: #173d3a;
    --module-tasks: #79ade7;
    --module-tasks-soft: #1b3047;
    --module-calendar: #aaa3f0;
    --module-calendar-soft: #2b2949;
    --module-birthdays: #f29382;
    --module-birthdays-soft: #472b28;
    --module-pantry: #e6ad55;
    --module-pantry-soft: #44331d;
    --module-family: #b89ae8;
    --module-family-soft: #35294a;
    --module-reminders: #e8b858;
    --module-reminders-soft: #45361c;
    --module-settings: #9ab4ba;
    --module-settings-soft: #263639;
  }
}

.dashboard-module-card,
.dashboard-wide-card,
.more-card {
  --module-accent: var(--module-settings);
  --module-soft: var(--module-settings-soft);
}

.dashboard-module-shopping,
.more-module-shopping,
.page-shopping {
  --module-accent: var(--module-shopping);
  --module-soft: var(--module-shopping-soft);
}

.dashboard-module-tasks,
.more-module-tasks,
.page-tasks {
  --module-accent: var(--module-tasks);
  --module-soft: var(--module-tasks-soft);
}

.dashboard-module-calendar,
.more-module-calendar,
.page-calendar {
  --module-accent: var(--module-calendar);
  --module-soft: var(--module-calendar-soft);
}

.dashboard-module-birthdays,
.more-module-birthdays,
.page-birthdays {
  --module-accent: var(--module-birthdays);
  --module-soft: var(--module-birthdays-soft);
}

.dashboard-module-pantry,
.more-module-pantry,
.page-pantry {
  --module-accent: var(--module-pantry);
  --module-soft: var(--module-pantry-soft);
}

.more-module-family {
  --module-accent: var(--module-family);
  --module-soft: var(--module-family-soft);
}

.more-module-reminders {
  --module-accent: var(--module-reminders);
  --module-soft: var(--module-reminders-soft);
}

.more-module-settings,
.page-settings {
  --module-accent: var(--module-settings);
  --module-soft: var(--module-settings-soft);
}

.dashboard-module-card,
.dashboard-wide-card,
.more-card {
  border-color: color-mix(in srgb, var(--module-accent) 18%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--module-soft) 30%, var(--surface)), var(--surface) 72%);
}

.dashboard-module-card .summary-icon,
.dashboard-wide-card .summary-icon,
.more-card .summary-icon {
  color: var(--module-accent);
  background: color-mix(in srgb, var(--module-soft) 78%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-accent) 14%, transparent);
}

.dashboard-module-card p,
.dashboard-wide-card p {
  color: color-mix(in srgb, var(--module-accent) 76%, var(--text));
}

.dashboard-module-card .secondary-button,
.dashboard-wide-card .secondary-button,
.more-card {
  border-color: color-mix(in srgb, var(--module-accent) 22%, var(--border));
}

.dashboard-module-card .secondary-button,
.dashboard-wide-card .secondary-button {
  color: color-mix(in srgb, var(--module-accent) 78%, var(--text));
  background: color-mix(in srgb, var(--module-soft) 42%, var(--surface));
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.nav-icon .ui-icon {
  width: 22px;
  height: 22px;
}

.content.page-shopping .summary-icon,
.content.page-tasks .summary-icon,
.content.page-calendar .summary-icon,
.content.page-birthdays .summary-icon,
.content.page-pantry .summary-icon,
.content.page-settings .summary-icon,
.content.page-shopping .section-title-icon,
.content.page-tasks .section-title-icon,
.content.page-calendar .section-title-icon,
.content.page-birthdays .section-title-icon,
.content.page-pantry .section-title-icon,
.content.page-settings .section-title-icon {
  color: var(--module-accent);
  background: color-mix(in srgb, var(--module-soft) 76%, var(--surface));
}

.content.page-shopping .status-badge,
.content.page-tasks .status-badge,
.content.page-calendar .status-badge,
.content.page-birthdays .status-badge,
.content.page-pantry .status-badge,
.content.page-settings .status-badge {
  color: color-mix(in srgb, var(--module-accent) 84%, var(--text));
  border-color: color-mix(in srgb, var(--module-accent) 24%, var(--border));
  background: color-mix(in srgb, var(--module-soft) 78%, var(--surface));
}

.shopping-categories-overview,
.shopping-category-selection {
  display: grid;
  gap: 10px;
}

.shopping-categories-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--module-shopping) 22%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--module-shopping-soft) 58%, var(--surface)), var(--surface));
}

.shopping-categories-head h2,
.shopping-categories-head p {
  margin: 0;
}

.shopping-categories-head h2 {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.shopping-categories-head > div > p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.shopping-category-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 9px;
}

.shopping-category-overview-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 78px;
  padding: 10px;
  border-color: color-mix(in srgb, var(--module-shopping) 18%, var(--border));
  background: color-mix(in srgb, var(--module-shopping-soft) 24%, var(--surface));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.shopping-category-overview-card.has-items {
  border-color: color-mix(in srgb, var(--module-shopping) 30%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--module-shopping-soft) 54%, var(--surface)), var(--surface));
}

.shopping-category-overview-card.is-empty {
  box-shadow: none;
}

.shopping-category-overview-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--module-shopping);
  background: color-mix(in srgb, var(--module-shopping-soft) 82%, var(--surface));
}

.shopping-category-overview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shopping-category-overview-copy strong {
  font-size: 0.86rem;
  line-height: 1.15;
}

.shopping-category-overview-copy small {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.2;
}

.shopping-category-selection-head {
  display: grid;
  gap: 9px;
  padding: 10px;
  border-color: color-mix(in srgb, var(--module-shopping) 22%, var(--border));
}

.shopping-selected-category-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--module-shopping) 24%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--module-shopping-soft) 62%, var(--surface));
}

.shopping-selected-category-chip > span:first-child {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--module-shopping);
  background: color-mix(in srgb, var(--module-shopping-soft) 84%, var(--surface));
}

.shopping-selected-category-chip > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.shopping-selected-category-chip small {
  color: var(--muted);
  font-size: 0.68rem;
}

.shopping-selected-category-chip strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-manage-categories-button {
  justify-self: stretch;
}

@media (max-width: 520px) {
  .shopping-categories-head {
    align-items: stretch;
    flex-direction: column;
  }

  .shopping-categories-head .secondary-button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .shopping-tabs .segment-button {
    padding-inline: 2px;
    font-size: 0.68rem;
  }
}

@media (min-width: 680px) {
  .shopping-category-selection-head {
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
  }
}

/* This final desktop rule intentionally follows all global Reference Pass rules. */
@media (min-width: 960px) {
  .app-shell {
    width: min(100%, 1120px);
    margin-inline: auto;
    padding-bottom: 146px;
  }

  .content {
    width: min(100%, 1040px);
    max-width: 1040px;
    padding: 24px 28px 146px;
  }

  .bottom-nav {
    right: auto;
    bottom: 16px;
    left: 50%;
    width: min(calc(100vw - 48px), 1040px);
    max-width: 1040px;
    height: 72px;
    min-height: 72px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 18px 42px rgba(17, 63, 68, 0.18);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
  }

  .toast,
  .pwa-install-button {
    bottom: 104px;
  }

  .pwa-install-button {
    right: max(28px, calc((100vw - min(100vw, 1120px)) / 2 + 28px));
  }
}

/* Reference Pass 10: Einkaufsnavigation und Kalender */
.shopping-tabs .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shopping-category-filter-button,
.shopping-scan-button {
  min-width: 0;
  overflow: hidden;
}

.shopping-category-filter-button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.shopping-category-filter-button span,
.shopping-scan-button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-category-filter-button.active,
.shopping-category-overview-card.selected {
  border-color: color-mix(in srgb, var(--module-shopping) 52%, var(--border));
  background: color-mix(in srgb, var(--module-shopping-soft) 78%, var(--surface));
  color: color-mix(in srgb, var(--module-shopping) 84%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-shopping) 22%, transparent);
}

.shopping-active-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin: -6px 0 12px;
  padding: 6px 8px 6px 12px;
  border: 1px solid color-mix(in srgb, var(--module-shopping) 26%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--module-shopping-soft) 54%, var(--surface));
}

.shopping-active-category > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.shopping-active-category .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--module-shopping);
}

.shopping-active-category button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 84%, var(--module-shopping-soft));
  color: var(--text);
}

.shopping-categories-head > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.calendar-view-switcher {
  display: block;
}

.calendar-view-switcher .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-view-switcher .segment-button {
  min-height: 42px;
  padding-inline: 8px;
  font-size: 0.84rem;
}

.calendar-filter-control {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--module-calendar) 18%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--module-calendar-soft));
  box-shadow: var(--shadow-soft);
}

.calendar-filter-control.has-active-filters {
  border-color: color-mix(in srgb, var(--module-calendar) 42%, var(--border));
}

.calendar-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.calendar-filter-summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.calendar-filter-summary strong {
  overflow: visible;
  font-size: 0.78rem;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.calendar-filter-summary .ui-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--module-calendar);
}

.calendar-filter-options {
  display: grid;
  gap: 14px;
  padding: 4px 12px 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
}

.calendar-filter-group {
  min-width: 0;
  margin: 0;
  padding: 10px 0 0;
  border: 0;
}

.calendar-filter-group legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calendar-filter-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.calendar-filter-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.calendar-filter-choice > span:nth-last-child(2) {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-filter-choice > strong {
  color: var(--muted);
  font-size: 0.7rem;
}

.calendar-filter-choice .member-avatar {
  width: 26px;
  height: 26px;
}

.calendar-filter-choice.active {
  border-color: color-mix(in srgb, var(--module-calendar) 48%, var(--border));
  background: color-mix(in srgb, var(--module-calendar-soft) 76%, var(--surface));
  color: color-mix(in srgb, var(--module-calendar) 84%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-calendar) 18%, transparent);
}

.calendar-filter-task-row {
  padding-top: 2px;
}

.calendar-filter-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.calendar-filter-toggle > span {
  display: grid;
  gap: 2px;
}

.calendar-filter-toggle small {
  color: var(--muted);
  font-size: 0.7rem;
}

.calendar-filter-toggle.active {
  border-color: color-mix(in srgb, var(--module-tasks) 44%, var(--border));
  background: color-mix(in srgb, var(--module-tasks-soft) 72%, var(--surface));
}

.calendar-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.calendar-filter-actions > button {
  flex: 1 1 150px;
}

.calendar-people-manager {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--module-calendar) 26%, var(--border));
}

.calendar-people-manager .section-header {
  align-items: flex-start;
}

.calendar-people-manager .member-manage-list {
  margin-top: 0;
}

.calendar-month-card,
.calendar-week-card {
  overflow: hidden;
  padding: 0;
  border-color: color-mix(in srgb, var(--module-calendar) 20%, var(--border));
}

.calendar-period-toolbar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  padding: 7px 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--module-calendar-soft) 34%, var(--surface));
}

.calendar-period-title {
  min-width: 0;
  text-align: center;
}

.calendar-period-title p,
.calendar-period-title h2 {
  margin: 0;
}

.calendar-period-title h2 {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 4.5vw, 1.24rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-period-title .eyebrow {
  margin-bottom: 1px;
  font-size: 0.6rem;
}

.calendar-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 7px 5px 4px;
  background: var(--surface);
}

.calendar-month-weekdays span {
  font-size: 0.64rem;
  font-weight: 760;
  text-align: center;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 64px;
  gap: 1px;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--border) 52%, transparent);
}

.calendar-month-day {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  justify-items: stretch;
  overflow: hidden;
  aspect-ratio: auto;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.calendar-month-day.outside-month {
  color: color-mix(in srgb, var(--muted) 54%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.calendar-month-day.outside-month .calendar-month-preview-list {
  opacity: 0.58;
}

.calendar-month-day.selected {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--module-calendar-soft) 64%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--module-calendar) 64%, transparent);
}

.calendar-month-day-number {
  display: inline-grid;
  justify-self: center;
  place-items: center;
  width: 21px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 760;
}

.calendar-month-day.today .calendar-month-day-number {
  background: var(--accent);
  color: #fff;
}

.calendar-month-preview-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.calendar-month-preview-entry {
  --calendar-category: var(--module-calendar);
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  min-width: 0;
  height: 13px;
  padding: 0 2px 0 1px;
  overflow: hidden;
  border-inline-start: 2px solid var(--person-color, var(--module-calendar));
  border-radius: 3px;
  background: color-mix(in srgb, var(--calendar-category) 13%, var(--surface));
  color: var(--text);
  font-size: 0.5rem;
  font-weight: 720;
  line-height: 1;
}

.calendar-month-preview-entry.category-tone-blue { --calendar-category: var(--blue); }
.calendar-month-preview-entry.category-tone-green { --calendar-category: var(--green); }
.calendar-month-preview-entry.category-tone-coral { --calendar-category: var(--coral); }
.calendar-month-preview-entry.category-tone-violet { --calendar-category: #8f5bd7; }
.calendar-month-preview-entry.category-tone-yellow { --calendar-category: var(--yellow); }
.calendar-month-preview-entry.category-tone-teal { --calendar-category: var(--accent); }

.calendar-month-preview-marker {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--calendar-category);
}

.calendar-month-preview-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month-preview-more {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.48rem;
  font-weight: 780;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month-preview-more.narrow {
  display: none;
}

.calendar-entry-dots {
  display: flex;
  align-self: end;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 12px;
}

.calendar-entry-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--module-calendar);
}

.calendar-entry-dot.tone-blue { background: var(--blue); }
.calendar-entry-dot.tone-green { background: var(--green); }
.calendar-entry-dot.tone-coral { background: var(--coral); }
.calendar-entry-dot.tone-violet { background: #8f5bd7; }
.calendar-entry-dot.tone-yellow { background: var(--yellow); }
.calendar-entry-dot.tone-teal { background: var(--accent); }

.calendar-entry-more {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 760;
  line-height: 1;
}

.calendar-selected-day {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: color-mix(in srgb, var(--module-calendar) 18%, var(--border));
}

.calendar-selected-day .calendar-compact-entry-main strong,
.calendar-selected-day .calendar-compact-entry-main small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.calendar-selected-day-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 14px 12px 16px;
}

.calendar-selected-day-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.calendar-selected-day-header,
.calendar-agenda-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
  background: color-mix(in srgb, var(--module-calendar-soft) 30%, var(--surface));
}

.calendar-selected-day-header p,
.calendar-selected-day-header h3 {
  margin: 0;
}

.calendar-selected-day-header h3 {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1rem;
}

.calendar-selected-day-header > span,
.calendar-agenda-group-header > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.calendar-compact-entry-list {
  display: grid;
}

.calendar-compact-entry {
  --calendar-category: var(--module-calendar);
  display: grid;
  grid-template-columns: 60px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 8px 8px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 66%, transparent);
  border-left: 4px solid var(--calendar-category);
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
}

.calendar-compact-entry:last-child {
  border-bottom: 0;
}

.calendar-compact-entry.category-tone-blue { --calendar-category: var(--blue); }
.calendar-compact-entry.category-tone-green { --calendar-category: var(--green); }
.calendar-compact-entry.category-tone-coral { --calendar-category: var(--coral); }
.calendar-compact-entry.category-tone-violet { --calendar-category: #8f5bd7; }
.calendar-compact-entry.category-tone-yellow { --calendar-category: var(--yellow); }
.calendar-compact-entry.category-tone-teal { --calendar-category: var(--accent); }

.calendar-compact-entry.conflict {
  background: color-mix(in srgb, var(--danger-soft) 46%, var(--surface));
}

.calendar-compact-entry-time {
  align-self: start;
  padding-top: 2px;
  color: var(--calendar-category);
  font-size: 0.7rem;
  font-weight: 760;
  line-height: 1.25;
}

.calendar-compact-entry-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calendar-compact-entry-main strong,
.calendar-compact-entry-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-compact-entry-main strong {
  font-size: 0.84rem;
}

.calendar-compact-entry-main small {
  color: var(--muted);
  font-size: 0.66rem;
}

.calendar-conflict-label {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.6rem;
  font-weight: 760;
}

.calendar-compact-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 3px;
}

.calendar-compact-entry-actions .small-icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 9px;
}

.calendar-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  padding: 5px;
  background: color-mix(in srgb, var(--border) 50%, transparent);
}

.calendar-week-day {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 74px;
  padding: 7px 2px 5px;
  border: 0;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

.calendar-week-day.selected {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--module-calendar-soft) 68%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--module-calendar) 62%, transparent);
}

.calendar-week-day.today strong {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.calendar-week-weekday {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 760;
  text-transform: uppercase;
}

.calendar-week-day > strong {
  font-size: 0.86rem;
}

.calendar-agenda-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--module-calendar) 20%, var(--border));
}

.calendar-agenda-heading p,
.calendar-agenda-heading h2 {
  margin: 0;
}

.calendar-agenda-heading h2 {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1.08rem;
}

.calendar-agenda-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.calendar-agenda-groups {
  display: grid;
  gap: 9px;
}

.calendar-agenda-group {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--module-calendar) 16%, var(--border));
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calendar-agenda-group-header > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.calendar-agenda-group-header strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
}

.calendar-agenda-group-header span {
  color: var(--muted);
  font-size: 0.7rem;
}

.calendar-agenda-group-header.today strong {
  color: var(--module-calendar);
}

@media (max-width: 380px) {
  .shopping-tools {
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  }

  .shopping-category-filter-button,
  .shopping-scan-button {
    padding-inline: 8px;
    font-size: 0.7rem;
  }

  .calendar-command-actions .button,
  .calendar-command-actions .secondary-button {
    padding-inline: 9px;
  }

  .calendar-filter-choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-month-day {
    padding-inline: 1px;
  }

  .calendar-month-day-number {
    width: 21px;
    height: 20px;
    font-size: 0.68rem;
  }

  .calendar-month-day.today .calendar-month-day-number {
    width: 21px;
    height: 20px;
  }

  .calendar-entry-dot {
    width: 4px;
    height: 4px;
  }

  .calendar-week-day {
    min-height: 68px;
  }

  .calendar-compact-entry {
    grid-template-columns: 52px auto minmax(0, 1fr) auto;
  }

  .calendar-compact-entry-actions {
    grid-template-columns: 28px;
  }

  .calendar-compact-entry-actions .small-icon-button {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
  }
}

@media (max-width: 359px) {
  .calendar-month-grid {
    grid-auto-rows: 57px;
    padding-inline: 2px;
  }

  .calendar-month-preview-entry.secondary-preview,
  .calendar-month-preview-more.regular {
    display: none;
  }

  .calendar-month-preview-more.narrow {
    display: block;
  }
}

@media (min-width: 680px) {
  .shopping-category-filter-button,
  .shopping-scan-button {
    grid-column: auto;
  }

  .calendar-filter-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-month-grid {
    grid-auto-rows: 82px;
  }

  .calendar-month-day {
    aspect-ratio: auto;
    min-height: 0;
    padding: 5px 4px;
  }

  .calendar-month-preview-entry {
    height: 16px;
    font-size: 0.62rem;
  }

  .calendar-month-preview-more {
    font-size: 0.56rem;
  }

  .calendar-week-day {
    min-height: 88px;
  }

  .calendar-compact-entry {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    padding-inline: 14px;
  }
}

@media (min-width: 960px) {
  .content.page-calendar {
    max-width: 1040px;
  }

  .calendar-command-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .calendar-command-bar > div:first-child {
    display: block;
  }

  .calendar-command-actions {
    align-self: end;
  }

  .calendar-view-switcher .segment-button {
    min-height: 46px;
    font-size: 0.9rem;
  }

  .calendar-filter-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .calendar-filter-task-row,
  .calendar-filter-actions {
    grid-column: 1 / -1;
  }

  .calendar-month-day {
    aspect-ratio: auto;
    min-height: 0;
  }

  .calendar-month-grid {
    grid-auto-rows: 90px;
  }

  .calendar-month-day-number {
    width: 28px;
    height: 28px;
  }

  .calendar-week-day {
    min-height: 102px;
  }

  .calendar-selected-day,
  .calendar-agenda-groups {
    width: min(100%, 820px);
    margin-inline: auto;
  }
}
