:root {
  --forest-950: #102d26;
  --forest-900: #173f35;
  --forest-800: #245548;
  --forest-700: #356b59;
  --sage-300: #a8c0ad;
  --sage-200: #c9d8ca;
  --sage-100: #e5ece3;
  --cream-50: #fbf8ef;
  --cream-100: #f4eedf;
  --paper: #fffdf7;
  --terracotta-500: #b7654d;
  --terracotta-100: #f4ddd3;
  --gold-500: #b88a35;
  --gold-100: #f5e9c8;
  --ink: #21352e;
  --muted: #68786f;
  --line: #dfe5dc;
  --shadow-sm: 0 8px 24px rgba(23, 63, 53, 0.08);
  --shadow-md: 0 18px 50px rgba(23, 63, 53, 0.12);
  --radius-sm: 0.75rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--cream-50);
  color: var(--ink);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--forest-700);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--forest-950);
}

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

:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  display: none;
}

.app-frame {
  min-width: 0;
  min-height: 100vh;
}

.mobile-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  padding: max(0.65rem, env(safe-area-inset-top)) 1rem 0.65rem;
  border-bottom: 1px solid rgba(23, 63, 53, 0.09);
  background: rgba(251, 248, 239, 0.94);
  backdrop-filter: blur(16px);
}

.mobile-brand,
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--forest-950);
  font-weight: 800;
  gap: 0.65rem;
  text-decoration: none;
}

.brand__mark {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--forest-900);
  color: var(--cream-50);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.mobile-account,
.account-card__avatar {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--sage-200);
  border-radius: 50%;
  background: var(--terracotta-100);
  color: var(--terracotta-500);
  font-weight: 850;
  text-decoration: none;
}

.mobile-account-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.mobile-account-link:hover {
  color: var(--forest-900);
}

.app-main {
  width: 100%;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.5rem 1rem calc(6.5rem + env(safe-area-inset-bottom));
}

.app-footer {
  display: none;
}

.app-nav__link {
  color: var(--muted);
  text-decoration: none;
}

.mobile-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0.4rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(23, 63, 53, 0.13);
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 -12px 32px rgba(23, 63, 53, 0.08);
  backdrop-filter: blur(18px);
}

.mobile-nav .app-nav__link {
  display: flex;
  min-width: 0;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 0.75rem;
  flex-direction: column;
  font-size: 0.7rem;
  font-weight: 750;
  gap: 0.1rem;
}

.mobile-nav .app-nav__link.is-active {
  background: var(--sage-100);
  color: var(--forest-900);
}

.app-nav__icon {
  display: inline-grid;
  min-width: 1.5rem;
  min-height: 1.5rem;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.app-nav__icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  background: var(--forest-900);
  color: white;
  box-shadow: 0 8px 22px rgba(23, 63, 53, 0.2);
}

.button--primary:hover {
  background: var(--forest-800);
  color: white;
}

.button--secondary {
  border: 1px solid var(--sage-300);
  background: white;
  color: var(--forest-900);
}

.button--quiet {
  background: transparent;
  color: var(--forest-800);
}

.button--small {
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--terracotta-500);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-heading {
  display: flex;
  margin-bottom: 1.4rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 1rem;
}

.page-heading h1,
.feature-page h1 {
  max-width: 48rem;
  margin: 0;
  color: var(--forest-950);
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-heading__summary {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.page-heading__actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.page-heading__actions .button {
  flex: 1 1 auto;
}

.quick-add {
  position: relative;
  width: 100%;
}

.quick-add > summary {
  width: 100%;
  list-style: none;
}

.quick-add > summary::-webkit-details-marker {
  display: none;
}

.quick-add__menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.5rem);
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.quick-add__menu a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.quick-add__menu a:hover {
  background: var(--sage-100);
}

.summary-grid {
  display: grid;
  margin-bottom: 1rem;
  gap: 0.85rem;
}

.summary-card {
  position: relative;
  display: grid;
  min-height: 9.25rem;
  overflow: hidden;
  padding: 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink);
  grid-template-rows: auto 1fr auto;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.summary-card:hover {
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.summary-card--events {
  border-color: #cbdcd2;
  background: #e7f0e9;
}

.summary-card--notes {
  border-color: #ecd7a2;
  background: var(--gold-100);
}

.summary-card--dinner {
  border-color: #e5c5b8;
  background: var(--terracotta-100);
}

.summary-card--tasks {
  border-color: var(--border-strong, #c8d0cc);
  background: var(--primary-soft, #e5ece3);
}

.summary-card__label {
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  align-self: end;
  font-size: 2.45rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
}

.summary-card strong.summary-card__meal {
  max-width: 80%;
  font-size: 1.45rem;
  line-height: 1.15;
}

.summary-card > span:not(.summary-card__label, .summary-card__arrow) {
  color: rgba(33, 53, 46, 0.72);
  font-size: 0.9rem;
}

.summary-card__arrow {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.panel {
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel__header h2 {
  margin: 0;
  color: var(--forest-950);
  font-size: 1.25rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.panel__header > a {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 750;
}

.empty-state {
  display: grid;
  min-height: 15rem;
  padding: 1.6rem 1rem;
  place-items: center;
  border: 1px dashed var(--sage-300);
  border-radius: var(--radius-md);
  background: rgba(229, 236, 227, 0.42);
  text-align: center;
}

.empty-state__mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 1.1rem;
  background: var(--sage-100);
  color: var(--forest-700);
  font-size: 1.65rem;
}

.empty-state h3 {
  margin: 0.75rem 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.empty-state p {
  max-width: 28rem;
  margin: 0 0 1rem;
  color: var(--muted);
}

.empty-state--compact {
  min-height: 12rem;
}

.empty-state--inline {
  min-height: 6rem;
  padding: 1rem;
}

.empty-state--inline p {
  margin: 0;
}

.agenda-list,
.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-list > li {
  display: grid;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.9rem;
}

.agenda-list > li:last-child {
  border-bottom: 0;
}

.date-tile {
  display: grid;
  width: 3.25rem;
  height: 3.55rem;
  place-content: center;
  border-radius: 0.85rem;
  background: var(--sage-100);
  color: var(--forest-900);
  text-align: center;
  text-decoration: none;
}

.date-tile span {
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-tile strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.agenda-list__content {
  min-width: 0;
}

.agenda-list__content h3 {
  overflow: hidden;
  margin: 0.2rem 0;
  font-size: 1rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-list__content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.category-pill,
.note-card__pin {
  display: inline-flex;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-800);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-stack {
  display: grid;
  gap: 0.75rem;
}

.note-card {
  padding: 1rem;
  border: 1px solid #ecdfba;
  border-radius: 0.9rem;
  background: #fff8df;
}

.note-card:nth-child(even) {
  border-color: #d3e1d4;
  background: #eff5ed;
}

.note-card__pin {
  margin-bottom: 0.6rem;
  background: var(--gold-100);
  color: #725418;
}

.note-card__image {
  display: block;
  width: 100%;
  max-height: 12rem;
  margin-bottom: 0.6rem;
  border-radius: 0.6rem;
  object-fit: cover;
}

.note-card p {
  margin: 0;
  white-space: pre-line;
}

.note-card footer {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.activity-list > li {
  display: grid;
  padding: 0.8rem 0;
  grid-template-columns: 0.75rem minmax(0, 1fr);
  gap: 0.6rem;
}

.activity-list__dot {
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.4rem;
  border: 2px solid var(--sage-300);
  border-radius: 50%;
  background: var(--paper);
}

.activity-list p {
  margin: 0;
  font-size: 0.9rem;
}

.activity-list span {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-task-list > li {
  display: flex;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.dashboard-task-list > li:last-child {
  border-bottom: 0;
}

.dashboard-task-list h3 {
  margin: 0.3rem 0 0;
  color: var(--heading, var(--forest-950));
  font-size: 0.95rem;
  font-weight: 800;
}

.dashboard-task-list__due {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
}

.dashboard-task-list > li.is-overdue .dashboard-task-list__due {
  color: var(--danger, #a54437);
}

.shopping-list-grid {
  display: grid;
  gap: 0.85rem;
}

.shopping-list-card {
  overflow: hidden;
  border: 1px solid var(--border, var(--line));
  border-radius: 1rem;
  background: var(--surface-subtle, var(--cream-50));
}

.shopping-list-card__main {
  display: flex;
  padding: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
  gap: 1rem;
}

.shopping-list-card__main:hover {
  color: var(--ink);
}

.shopping-list-card h3 {
  margin: 0;
  color: var(--heading, var(--forest-950));
  font-size: 1.05rem;
  font-weight: 820;
}

.shopping-list-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.shopping-list-card__arrow {
  color: var(--primary, var(--forest-700));
  font-size: 1.25rem;
  font-weight: 850;
}

.shopping-list-card footer {
  display: flex;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border, var(--line));
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  gap: 1rem;
}

.shopping-heading .back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.shopping-quick-add {
  display: grid;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border, var(--line));
  border-radius: 1rem;
  align-items: end;
  background: var(--surface-subtle, var(--cream-50));
  gap: 0.7rem;
}

.shopping-quick-add .button {
  width: 100%;
}

.shopping-quick-add-editor {
  margin-bottom: 1rem;
}

.shopping-quick-add-editor > summary {
  list-style: none;
  cursor: pointer;
}

.shopping-quick-add-editor > summary::-webkit-details-marker {
  display: none;
}

.shopping-quick-add-editor > .shopping-quick-add {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.shopping-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping-item {
  display: grid;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border, var(--line));
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
}

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

.shopping-item__check {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 2px solid var(--border-strong, var(--sage-300));
  border-radius: 50%;
  background: var(--surface, var(--paper));
  color: var(--on-primary, white);
  font-size: 1.15rem;
  font-weight: 900;
}

.shopping-item.is-completed .shopping-item__check {
  border-color: var(--primary, var(--forest-700));
  background: var(--primary, var(--forest-700));
}

.shopping-item__line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.shopping-item__line strong {
  min-width: 0;
  color: var(--heading, var(--forest-950));
  overflow-wrap: anywhere;
}

.shopping-item__line > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.shopping-item.is-completed .shopping-item__line strong,
.shopping-item.is-completed .shopping-item__line > span {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-item__content small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.shopping-item__actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem;
}

.shopping-item-editor {
  position: relative;
}

.shopping-item-editor > summary {
  list-style: none;
  cursor: pointer;
}

.shopping-item-editor > summary::-webkit-details-marker {
  display: none;
}

.shopping-item-editor > form {
  display: grid;
  min-width: min(20rem, calc(100vw - 5rem));
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border, var(--line));
  border-radius: 0.85rem;
  background: var(--surface-elevated, var(--paper));
  box-shadow: var(--shadow-sm);
  gap: 0.65rem;
}

.shopping-list-footer {
  display: flex;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, var(--line));
  justify-content: flex-end;
}

.shopping-panel.is-shopping-mode .shopping-item {
  min-height: 4.5rem;
  padding: 1rem 0;
}

.shopping-panel.is-shopping-mode .shopping-item__check {
  width: 3rem;
  height: 3rem;
}

.shopping-panel.is-shopping-mode .shopping-item__line strong {
  font-size: 1.05rem;
}

.feature-page {
  max-width: 50rem;
  padding: 0.5rem 0;
}

.feature-page > p:not(.eyebrow) {
  max-width: 42rem;
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.feature-status {
  display: grid;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.9rem;
}

.feature-status > span {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--sage-100);
  color: var(--forest-800);
  font-size: 1.2rem;
}

.feature-status strong {
  color: var(--forest-900);
}

.feature-status p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 8rem);
  padding: 1rem 0;
  place-items: start center;
}

.auth-card {
  width: 100%;
  max-width: 30rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  margin: 0;
  color: var(--forest-950);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

.auth-card > p:not(.eyebrow, .auth-card__alternate) {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
}

.auth-card__submit {
  width: 100%;
}

.auth-card__alternate {
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-card .text-danger {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.auth-card div[role="alert"]:empty {
  display: none;
}

.account-card__profile {
  display: flex;
  min-width: 0;
  align-items: center;
  color: inherit;
  gap: 0.7rem;
  text-decoration: none;
}

.account-card__profile > span:last-child {
  display: grid;
  min-width: 0;
}

.account-card__profile strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card__profile small {
  color: var(--sage-300);
  font-size: 0.7rem;
}

.account-card__logout {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sage-300);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.signed-out-actions {
  display: grid;
  gap: 0.35rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 0.25rem rgba(53, 107, 89, 0.18);
}

@media (min-width: 40rem) {
  .app-main {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .page-heading {
    align-items: flex-end;
    flex-direction: row;
  }

  .page-heading__actions {
    width: auto;
  }

  .page-heading__actions .button {
    flex: 0 0 auto;
  }

  .quick-add {
    width: auto;
  }

  .quick-add > summary {
    width: auto;
  }

  .quick-add__menu {
    right: 0;
    left: auto;
    width: 14rem;
  }

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

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

  .shopping-quick-add {
    grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.35fr) auto;
  }

  .shopping-quick-add .button {
    width: auto;
  }

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

  .shopping-item__actions {
    grid-column: auto;
  }

  .summary-card {
    min-height: 10.25rem;
  }

  .panel {
    padding: 1.35rem;
  }

  .auth-page {
    padding-top: 3rem;
  }

  .auth-card {
    padding: 2rem;
  }
}

@media (min-width: 61.25rem) {
  .app-shell {
    display: grid;
    grid-template-columns: 16.5rem minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    min-height: 42rem;
    padding: 1.5rem 1.15rem;
    background: var(--forest-950);
    color: white;
    flex-direction: column;
  }

  .brand {
    padding: 0 0.5rem;
    color: white;
  }

  .brand:hover {
    color: white;
  }

  .brand__mark {
    background: var(--terracotta-500);
  }

  .brand > span:last-child {
    display: grid;
  }

  .brand strong {
    font-size: 0.96rem;
  }

  .brand small {
    color: var(--sage-300);
    font-size: 0.72rem;
    font-weight: 600;
  }

  .app-nav {
    display: grid;
    margin-top: 3rem;
    gap: 0.35rem;
  }

  .app-nav .app-nav__link {
    display: flex;
    min-height: 3rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 0.8rem;
    color: var(--sage-200);
    font-size: 0.88rem;
    font-weight: 700;
    gap: 0.7rem;
  }

  .app-nav .app-nav__link:hover,
  .app-nav .app-nav__link.is-active {
    background: rgba(229, 236, 227, 0.11);
    color: white;
  }

  .app-nav .app-nav__link.is-active {
    box-shadow: inset 3px 0 0 var(--terracotta-500);
  }

  .app-nav .app-nav__icon {
    font-size: 1.05rem;
  }

  .app-sidebar__account {
    margin-top: auto;
    padding: 1rem 0.5rem 0;
    border-top: 1px solid rgba(229, 236, 227, 0.13);
  }

  .mobile-header,
  .mobile-nav {
    display: none;
  }

  .app-main {
    padding: 2.75rem 2.25rem 3rem;
  }

  .app-footer {
    display: flex;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 2.25rem 1.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    gap: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.8fr);
  }

  .panel--agenda {
    grid-row: span 2;
  }

  .panel--activity {
    grid-column: 1 / -1;
  }

  .summary-card strong {
    font-size: 2.8rem;
  }
}

@media (min-width: 82rem) {
  .app-shell {
    grid-template-columns: 18rem minmax(0, 1fr);
  }

  .app-main {
    padding-right: 3.5rem;
    padding-left: 3.5rem;
  }

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

[hidden] {
  display: none !important;
}

.button--danger {
  border: 1px solid #d8a89a;
  background: #fff1ed;
  color: #8b3525;
}

.button--danger:hover {
  background: #f8ddd5;
  color: #6e271b;
}

.status-banner {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #b8d5bd;
  border-radius: var(--radius-sm);
  background: #e8f4e8;
  color: #255d37;
  font-weight: 700;
}

.feature-panel {
  min-height: 20rem;
}

.item-count {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-800);
  font-size: 0.8rem;
  font-weight: 800;
}

.panel__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.list-divider {
  display: flex;
  align-items: center;
  margin: 0.45rem 0 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  gap: 0.75rem;
}

.list-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
  flex: 1;
}

.record-list,
.board-list {
  display: grid;
  gap: 0.8rem;
}

.record-card {
  display: grid;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0.9rem;
}

.record-card.is-muted {
  opacity: 0.68;
}

.record-card__date {
  position: relative;
  display: grid;
  width: 3.4rem;
  min-height: 4.5rem;
  align-self: start;
  place-content: center;
  border-radius: 0.9rem;
  background: var(--sage-100);
  color: var(--forest-900);
  text-align: center;
}

.record-card__date-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--forest-700);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.record-card__date span,
.record-card__date small {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.record-card__date strong {
  font-size: 1.4rem;
  line-height: 1.05;
}

.record-card__body {
  min-width: 0;
}

.record-card__body h3 {
  margin: 0.35rem 0 0.15rem;
  color: var(--forest-950);
  font-size: 1.05rem;
  font-weight: 820;
}

.record-card__body > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.record-card__body .record-card__description {
  margin-top: 0.6rem;
  color: var(--ink);
  white-space: pre-line;
}

.record-card__meta {
  display: flex;
  align-items: center;
  color: var(--muted);
  flex-wrap: wrap;
  font-size: 0.72rem;
  gap: 0.4rem;
}

.recipe-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.recipe-card {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  color: inherit;
  flex-direction: column;
  text-decoration: none;
}

.recipe-card__image {
  width: 100%;
  height: 7rem;
  object-fit: cover;
}

.recipe-card__image--placeholder {
  display: grid;
  height: 7rem;
  background: var(--sage-100);
  color: var(--forest-700);
  font-size: 1.8rem;
  place-items: center;
}

.recipe-card__body {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
}

.recipe-card__body h3 {
  margin: 0;
  color: var(--forest-950);
  font-size: 0.95rem;
  font-weight: 800;
}

.recipe-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.protein-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.protein-filter .form-select {
  min-width: 9rem;
}

.recipe-import-panel {
  margin-bottom: 1.5rem;
}

.recipe-import-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.import-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.import-form input {
  flex: 1 1 16rem;
}

.recipe-details__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.recipe-details__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.recipe-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recipe-details__image {
  width: 100%;
  max-height: 20rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.recipe-details__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.recipe-details__grid h2 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.recipe-details__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
}

.record-card__actions {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  gap: 0.5rem;
}

.record-card__actions form,
.inline-actions form {
  margin: 0;
}

.editor-page {
  width: 100%;
  max-width: 58rem;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

.editor-page__heading {
  margin-bottom: 1.5rem;
}

.editor-page__heading h1 {
  margin: 0;
  color: var(--forest-950);
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

.editor-page__heading > p:last-child {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.editor-form,
.stack-form {
  display: grid;
  gap: 1rem;
}

.editor-form {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.form-field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.form-field > label,
.audience-fieldset > legend,
.settings-fieldset > legend {
  margin: 0;
  color: var(--forest-950);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-field .form-control,
.form-field .form-select,
.stack-form .form-control {
  min-height: 3rem;
  border-color: var(--line);
  border-radius: 0.75rem;
  background: var(--paper);
  color: var(--ink);
}

.form-field textarea.form-control,
.stack-form textarea.form-control {
  min-height: 7rem;
}

.form-control-color {
  width: 100%;
  max-width: 6rem;
  padding: 0.3rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.75rem;
}

.validation-summary {
  color: #9b3426;
  font-size: 0.86rem;
  grid-column: 1 / -1;
}

.validation-summary:empty,
.validation-summary ul:empty {
  display: none;
}

.text-danger {
  font-size: 0.78rem;
}

.choice-row,
.option-card {
  display: grid;
  min-height: 3.5rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--paper);
  cursor: pointer;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.7rem;
}

.choice-row input,
.option-card input,
.member-picker input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--forest-800);
}

.choice-row > span,
.option-card > span {
  display: grid;
}

.choice-row strong,
.option-card strong {
  font-size: 0.88rem;
}

.choice-row small,
.option-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.dish-fieldset {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0.5rem;
}

.dish-fieldset > legend {
  margin: 0 0 0.25rem;
  color: var(--forest-950);
  font-size: 0.82rem;
  font-weight: 800;
}

.dish-slot {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
  .dish-slot {
    grid-template-columns: 1fr;
  }
}

.audience-fieldset,
.settings-fieldset {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0.65rem;
}

.audience-fieldset > legend,
.settings-fieldset > legend {
  margin-bottom: 0.25rem;
}

.member-picker {
  display: grid;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--cream-50);
  gap: 0.35rem;
}

.member-picker > label {
  display: grid;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 0.65rem;
  cursor: pointer;
  grid-template-columns: 1.25rem 0.8rem minmax(0, 1fr);
  gap: 0.55rem;
}

.member-picker > label:hover {
  background: var(--sage-100);
}

.color-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--member-color, var(--forest-700));
}

.agenda-list__content .color-dot {
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 0.5rem;
  gap: 0.6rem;
}

.feature-grid,
.settings-grid {
  display: grid;
  align-items: start;
  gap: 1rem;
}

.account-layout {
  display: grid;
  align-items: start;
  gap: 1rem;
}

.account-nav {
  display: grid;
  padding: 0.55rem;
  gap: 0.25rem;
}

.account-nav__link {
  display: grid;
  padding: 0.75rem 0.8rem;
  border-radius: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.account-nav__link:hover,
.account-nav__link.is-active {
  background: var(--sage-100);
  color: var(--forest-900);
}

.account-nav__link.is-active {
  box-shadow: inset 3px 0 0 var(--forest-700);
}

.account-nav__link strong {
  font-size: 0.9rem;
}

.account-nav__link span {
  color: var(--muted);
  font-size: 0.72rem;
}

.account-content__header {
  margin-bottom: 1.25rem;
}

.account-content__header h2 {
  margin: 0;
  color: var(--forest-950);
  font-size: 1.4rem;
}

.account-form {
  max-width: 44rem;
}

.task-lists,
.task-list {
  display: grid;
  gap: 1rem;
}

.task-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.task-card.is-complete {
  opacity: 0.68;
}

.task-card.is-complete h3 {
  text-decoration: line-through;
}

.task-card.is-overdue {
  border-color: var(--danger, #a83e32);
  box-shadow: inset 3px 0 0 var(--danger, #a83e32);
}

.task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.task-card__header h3 {
  margin: 0.4rem 0 0;
  color: var(--forest-950);
  font-size: 1.05rem;
  font-weight: 820;
}

.task-card__assignee {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  background: var(--member-color, var(--sage-100));
  color: white;
}

.task-card__details {
  margin: 0.75rem 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  white-space: pre-line;
}

.task-tags {
  display: flex;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.task-tags span {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-800);
  font-size: 0.72rem;
  font-weight: 750;
}

.task-card__byline {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.task-card__actions,
.task-status-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-card__actions {
  margin-top: 0.85rem;
}

.task-card__actions > form:not(.task-status-form) {
  margin: 0;
}

.task-status-form {
  margin: 0 auto 0 0;
}

.task-status-form label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.task-status-form .form-select {
  width: auto;
  min-width: 8.5rem;
}

.task-due--overdue {
  color: var(--danger, #a83e32);
  font-weight: 800;
}

.task-status--blocked {
  background: var(--danger-soft, #f5dfdc);
  color: var(--danger, #8f3027);
}

.task-status--inprogress {
  background: var(--warning-soft, #f5e9c8);
  color: var(--warning, #765514);
}

.task-status--complete {
  background: var(--success-soft, #e8f4e8);
  color: var(--success, #255d37);
}

.empty-state--compact {
  min-height: 10rem;
}

.compose-panel {
  scroll-margin-top: 5rem;
}

.board-note {
  padding: 1rem;
  border: 1px solid #ead8a9;
  border-radius: var(--radius-md);
  background: #fff8df;
}

.board-note > header,
.board-note > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  flex-wrap: wrap;
  font-size: 0.75rem;
  gap: 0.5rem;
}

.board-note > header > a {
  font-weight: 750;
}

.board-note__body {
  margin: 1rem 0;
  color: var(--ink);
  font-size: 1rem;
  white-space: pre-line;
}

.board-note__image-link {
  display: block;
  width: 100%;
  overflow: hidden;
  margin-top: 0.85rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-100);
  cursor: zoom-in;
}

.board-note__image {
  display: block;
  width: 100%;
  max-height: 32rem;
  object-fit: contain;
}

.board-note__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.reaction-form {
  display: inline-flex;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line, #ead8a9);
  border-radius: 999px;
  background: var(--surface, #fff);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.reaction-button__count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.reaction-button.is-active {
  border-color: var(--accent, #b3872f);
  background: var(--gold-100, #fbf0d3);
}

.board-note__comments {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line, #ead8a9);
}

.board-note__comment {
  position: relative;
  padding: 0.5rem 1.75rem 0.5rem 0.6rem;
  border-radius: 0.6rem;
  background: var(--cream-100, rgba(0, 0, 0, 0.03));
}

.board-note__comment-meta {
  display: flex;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.board-note__comment-body {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  white-space: pre-line;
}

.board-note__comment-delete-form {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
}

.board-note__comment-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.board-note__comment-delete:hover {
  background: var(--danger-soft, #f6dede);
  color: var(--danger, #9c2f2f);
}

.board-note__comment-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.board-note__comment-form .form-control {
  flex: 1;
}

.image-lightbox {
  width: min(96vw, 90rem);
  height: min(92dvh, 70rem);
  max-width: none;
  max-height: none;
  padding: 3.5rem 1rem 1rem;
  border: 1px solid var(--border-strong, var(--line));
  border-radius: 1rem;
  background: #090d0b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}

.image-lightbox[open] {
  display: grid;
  place-items: center;
}

.image-lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-lightbox__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 1.65rem;
  line-height: 1;
}

.live-update-toast {
  position: fixed;
  z-index: 70;
  right: 1rem;
  bottom: calc(5rem + env(safe-area-inset-bottom));
  left: 1rem;
  display: flex;
  max-width: 28rem;
  margin-left: auto;
  padding: 0.8rem;
  border: 1px solid var(--border-strong, var(--line));
  border-radius: 1rem;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-elevated, var(--paper));
  box-shadow: var(--shadow-md);
  color: var(--ink);
  gap: 0.8rem;
}

.live-update-toast p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 750;
}

@media (min-width: 61.25rem) {
  .live-update-toast {
    right: 1.5rem;
    bottom: 1.5rem;
    left: auto;
  }
}

.status-pill {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-800);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inline-actions {
  display: flex;
  margin-top: 1rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.week-header {
  display: grid;
  margin-bottom: 1.2rem;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  text-align: center;
  gap: 0.35rem;
}

.week-header > a:first-child {
  justify-self: start;
}

.week-header > a:last-child {
  justify-self: end;
}

.week-header h2 {
  margin: 0;
  color: var(--forest-950);
  font-size: 1.25rem;
  font-weight: 820;
}

.dinner-week {
  display: grid;
  gap: 0.75rem;
}

.dinner-day {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.dinner-day.is-today {
  border-color: var(--terracotta-500);
  box-shadow: inset 3px 0 0 var(--terracotta-500);
}

.dinner-day > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dinner-day > header > div {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.dinner-day > header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dinner-day > header strong {
  color: var(--forest-950);
  font-size: 1.25rem;
}

.dinner-day__empty {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.dinner-day__meal {
  min-height: 5rem;
  padding: 0.8rem 0 0.4rem;
}

.dinner-day__meal h3 {
  margin: 0;
  color: var(--forest-950);
  font-size: 1rem;
  font-weight: 820;
}

.dinner-day__meal p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.dinner-day__meal a {
  font-size: 0.78rem;
  font-weight: 700;
}

.dinner-day__items {
  display: grid;
  margin: 0.4rem 0 0;
  padding: 0;
  gap: 0.25rem;
  list-style: none;
}

.dinner-day__items li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.dinner-day__item-course {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  min-width: 3rem;
}

.dinner-day__items a {
  font-weight: 700;
}

.centered-action {
  display: flex;
  justify-content: center;
  padding-top: 1.25rem;
}

.family-grid {
  display: grid;
  gap: 0.7rem;
}

.family-card {
  position: relative;
  display: grid;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0.8rem;
}

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

.audit-toolbar {
  align-items: end;
  gap: 1rem;
}

.audit-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.audit-search .form-control {
  min-width: min(22rem, 70vw);
}

.audit-trust-note {
  margin: 0;
  padding: 0 1.1rem 1rem;
}

.audit-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.audit-entry {
  border-bottom: 1px solid var(--border);
}

.audit-entry > summary {
  display: grid;
  align-items: center;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  grid-template-columns: minmax(9rem, 0.8fr) minmax(10rem, 1fr) minmax(8rem, 0.8fr) auto;
  gap: 0.8rem;
  list-style: none;
}

.audit-entry > summary::-webkit-details-marker {
  display: none;
}

.audit-entry > summary::before {
  content: "+";
  position: absolute;
  margin-left: -0.8rem;
  color: var(--text-subtle);
}

.audit-entry[open] > summary::before {
  content: "−";
}

.audit-entry__reason {
  color: var(--danger);
  font-weight: 800;
}

.audit-entry__identity {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.audit-entry__ip,
.audit-entry time {
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.audit-details {
  display: grid;
  margin: 0;
  padding: 0 1.1rem 1.1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.audit-details > div {
  min-width: 0;
  padding: 0.65rem;
  border-radius: 0.65rem;
  background: var(--surface-subtle);
}

.audit-details__wide {
  grid-column: 1 / -1;
}

.audit-details dt {
  color: var(--text-subtle);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-details dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.82rem;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  color: var(--text-subtle);
  font-size: 0.78rem;
  gap: 1rem;
}

.notification-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-subtle);
  gap: 1rem;
}

.notification-device-card h3,
.notification-device-card p {
  margin: 0;
}

.notification-device-card h3 {
  margin-bottom: 0.25rem;
  color: var(--heading);
  font-size: 1rem;
}

.notification-preferences {
  margin-top: 1.25rem;
}

.notification-preferences .choice-row span {
  display: grid;
  gap: 0.15rem;
}

.notification-preferences .choice-row small {
  color: var(--text-subtle);
  font-weight: 500;
}

@media (max-width: 760px) {
  .audit-entry > summary {
    grid-template-columns: 1fr auto;
  }

  .audit-entry__identity,
  .audit-entry__ip {
    grid-column: 1 / -1;
  }

  .audit-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-details__wide {
    grid-column: auto;
  }

  .audit-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-device-card {
    align-items: stretch;
    flex-direction: column;
  }
}

.family-card.is-current {
  border-color: var(--sage-300);
  background: rgba(229, 236, 227, 0.45);
}

.family-card__avatar {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 50%;
  background: var(--member-color, var(--forest-700));
  color: white;
  font-weight: 850;
}

.member-name-badge {
  padding: 0.18rem;
  overflow: hidden;
  font-size: 0.55rem;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-card h3 {
  margin: 0;
  color: var(--forest-950);
  font-size: 1rem;
  font-weight: 820;
}

.family-card p,
.family-card div > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.color-input-row {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  gap: 0.8rem;
}

.account-links {
  display: flex;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 0.84rem;
  font-weight: 700;
  gap: 1rem;
}

.settings-fieldset {
  gap: 0.5rem;
}

.option-card:has(input:checked) {
  border-color: var(--forest-700);
  background: var(--sage-100);
  box-shadow: inset 3px 0 0 var(--forest-700);
}

.settings-links {
  display: grid;
  gap: 0.6rem;
}

.settings-links a {
  display: grid;
  min-height: 4.5rem;
  align-content: center;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.settings-links a:hover {
  border-color: var(--sage-300);
  background: var(--sage-100);
}

.settings-links strong {
  color: var(--forest-900);
  font-size: 0.9rem;
}

.settings-links span {
  color: var(--muted);
  font-size: 0.75rem;
}

body[data-density="compact"] .panel,
body[data-density="compact"] .record-card,
body[data-density="compact"] .board-note {
  padding: 0.8rem;
}

body[data-density="compact"] .dashboard-grid,
body[data-density="compact"] .feature-grid,
body[data-density="compact"] .record-list,
body[data-density="compact"] .board-list {
  gap: 0.65rem;
}

body[data-theme="dark"] {
  --cream-50: #0f1d19;
  --cream-100: #152720;
  --paper: #182b25;
  --ink: #edf5ef;
  --muted: #aebfb6;
  --line: #365148;
  --forest-950: #f1f7f2;
  --forest-900: #d9eadc;
  --forest-800: #bcd6c2;
  --forest-700: #9fc4aa;
  --sage-100: #253d34;
  --sage-200: #456257;
  --sage-300: #718e82;
  --terracotta-100: #4c3028;
  --terracotta-500: #e19a82;
  --gold-100: #473b20;
  --gold-500: #dfbd70;
  color-scheme: dark;
}

body[data-theme="dark"] .mobile-header,
body[data-theme="dark"] .mobile-nav {
  background: rgba(15, 29, 25, 0.96);
}

body[data-theme="dark"] .summary-card > span:not(.summary-card__label, .summary-card__arrow) {
  color: rgba(237, 245, 239, 0.76);
}

body[data-theme="dark"] .board-note,
body[data-theme="dark"] .status-banner {
  border-color: var(--line);
  background: var(--cream-100);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    --cream-50: #0f1d19;
    --cream-100: #152720;
    --paper: #182b25;
    --ink: #edf5ef;
    --muted: #aebfb6;
    --line: #365148;
    --forest-950: #f1f7f2;
    --forest-900: #d9eadc;
    --forest-800: #bcd6c2;
    --forest-700: #9fc4aa;
    --sage-100: #253d34;
    --sage-200: #456257;
    --sage-300: #718e82;
    --terracotta-100: #4c3028;
    --terracotta-500: #e19a82;
    --gold-100: #473b20;
    --gold-500: #dfbd70;
    color-scheme: dark;
  }

  body[data-theme="system"] .mobile-header,
  body[data-theme="system"] .mobile-nav {
    background: rgba(15, 29, 25, 0.96);
  }
}

@media (min-width: 40rem) {
  .editor-form {
    padding: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-field--wide {
    grid-column: 1 / -1;
  }

  .record-card {
    align-items: center;
    grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  }

  .record-card__actions {
    justify-content: flex-end;
    grid-column: auto;
  }

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

@media (min-width: 61.25rem) {
  .feature-grid--board {
    grid-template-columns: minmax(18rem, 0.7fr) minmax(0, 1.3fr);
  }

  .feature-grid--tasks {
    grid-template-columns: minmax(18rem, 0.7fr) minmax(0, 1.3fr);
  }

  .feature-grid--family,
  .settings-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(20rem, 0.7fr);
  }

  .account-layout {
    grid-template-columns: minmax(14rem, 0.32fr) minmax(0, 1fr);
  }
}

@media (min-width: 72rem) {
  .dinner-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dinner-day {
    min-width: 0;
  }

  .dinner-day__empty {
    min-height: 8rem;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .dinner-day__meal {
    min-height: 8rem;
  }

  .dinner-day .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dinner-day .inline-actions .button,
  .dinner-day .inline-actions form {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Modern, high-contrast appearance system. Semantic tokens keep foregrounds,
   surfaces, and interactive colors independent in both color modes. */
:root,
body[data-theme="light"] {
  --app-bg: #f5f7f6;
  --surface: #ffffff;
  --surface-subtle: #eef3f0;
  --surface-elevated: #ffffff;
  --text: #17211c;
  --text-subtle: #596860;
  --heading: #0d1913;
  --border: #d9e2dd;
  --border-strong: #afc1b7;
  --primary: #176b43;
  --primary-hover: #105735;
  --on-primary: #ffffff;
  --primary-soft: #e3f3e9;
  --primary-soft-text: #145a39;
  --accent: #a74430;
  --accent-soft: #fbe9e4;
  --warning: #805600;
  --warning-soft: #fff3d5;
  --danger: #9e3329;
  --danger-soft: #fce9e7;
  --success: #176b43;
  --success-soft: #e5f5eb;
  --sidebar: #101c17;
  --sidebar-text: #f2f7f4;
  --sidebar-muted: #afc2b7;
  --glass: rgba(255, 255, 255, 0.92);
  --summary-events: #e8f4ed;
  --summary-events-border: #bed9c9;
  --summary-notes: #fff2d5;
  --summary-notes-border: #ead39e;
  --summary-dinner: #fbe9e4;
  --summary-dinner-border: #eac4b9;
  --shadow-sm: 0 1px 2px rgba(13, 25, 19, 0.04), 0 8px 24px rgba(13, 25, 19, 0.06);
  --shadow-md: 0 2px 6px rgba(13, 25, 19, 0.06), 0 20px 48px rgba(13, 25, 19, 0.1);

  /* Legacy aliases retained while the components migrate to semantic names. */
  --forest-950: var(--heading);
  --forest-900: var(--primary);
  --forest-800: var(--primary);
  --forest-700: var(--primary);
  --sage-300: var(--border-strong);
  --sage-200: var(--border);
  --sage-100: var(--primary-soft);
  --cream-50: var(--app-bg);
  --cream-100: var(--surface-subtle);
  --paper: var(--surface);
  --terracotta-500: var(--accent);
  --terracotta-100: var(--accent-soft);
  --gold-500: var(--warning);
  --gold-100: var(--warning-soft);
  --ink: var(--text);
  --muted: var(--text-subtle);
  --line: var(--border);
  color-scheme: light;
}

body[data-theme="dark"] {
  --app-bg: #0f1311;
  --surface: #181d1a;
  --surface-subtle: #202622;
  --surface-elevated: #1c221f;
  --text: #eef3f0;
  --text-subtle: #afb9b3;
  --heading: #fbfdfc;
  --border: #343e38;
  --border-strong: #536159;
  --primary: #70d99a;
  --primary-hover: #8ae5aa;
  --on-primary: #0a2416;
  --primary-soft: #20382a;
  --primary-soft-text: #a8ecc1;
  --accent: #ff9b80;
  --accent-soft: #3b2722;
  --warning: #f1c86f;
  --warning-soft: #342d1d;
  --danger: #ff9d92;
  --danger-soft: #3b2422;
  --success: #7bdda1;
  --success-soft: #20372a;
  --sidebar: #0a0e0c;
  --sidebar-text: #f2f7f4;
  --sidebar-muted: #a9b8b0;
  --glass: rgba(24, 29, 26, 0.94);
  --summary-events: #192b21;
  --summary-events-border: #31523f;
  --summary-notes: #2c271b;
  --summary-notes-border: #574a2b;
  --summary-dinner: #30221f;
  --summary-dinner-border: #5d3931;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 22px 52px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    --app-bg: #0f1311;
    --surface: #181d1a;
    --surface-subtle: #202622;
    --surface-elevated: #1c221f;
    --text: #eef3f0;
    --text-subtle: #afb9b3;
    --heading: #fbfdfc;
    --border: #343e38;
    --border-strong: #536159;
    --primary: #70d99a;
    --primary-hover: #8ae5aa;
    --on-primary: #0a2416;
    --primary-soft: #20382a;
    --primary-soft-text: #a8ecc1;
    --accent: #ff9b80;
    --accent-soft: #3b2722;
    --warning: #f1c86f;
    --warning-soft: #342d1d;
    --danger: #ff9d92;
    --danger-soft: #3b2422;
    --success: #7bdda1;
    --success-soft: #20372a;
    --sidebar: #0a0e0c;
    --sidebar-text: #f2f7f4;
    --sidebar-muted: #a9b8b0;
    --glass: rgba(24, 29, 26, 0.94);
    --summary-events: #192b21;
    --summary-events-border: #31523f;
    --summary-notes: #2c271b;
    --summary-notes-border: #574a2b;
    --summary-dinner: #30221f;
    --summary-dinner-border: #5d3931;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 22px 52px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
  }
}

body[data-theme="dark"],
body[data-theme="system"] {
  --forest-950: var(--heading);
  --forest-900: var(--primary);
  --forest-800: var(--primary);
  --forest-700: var(--primary);
  --sage-300: var(--border-strong);
  --sage-200: var(--border);
  --sage-100: var(--primary-soft);
  --cream-50: var(--app-bg);
  --cream-100: var(--surface-subtle);
  --paper: var(--surface);
  --terracotta-500: var(--accent);
  --terracotta-100: var(--accent-soft);
  --gold-500: var(--warning);
  --gold-100: var(--warning-soft);
  --ink: var(--text);
  --muted: var(--text-subtle);
  --line: var(--border);
}

/* User-selectable palette families. Mode and palette stay independent so every
   family can follow the device theme without losing its preferred colors. */
body[data-palette="sage"][data-theme="light"],
body[data-palette="sage"][data-theme="system"] {
  --app-bg: #f7f6f2;
  --surface: #ffffff;
  --surface-subtle: #edf0eb;
  --surface-elevated: #fffefa;
  --text: #24302a;
  --text-subtle: #657169;
  --heading: #18241f;
  --border: #d9ded7;
  --border-strong: #a8b5a4;
  --primary: #506b59;
  --primary-hover: #3e5747;
  --on-primary: #ffffff;
  --primary-soft: #e7ece5;
  --primary-soft-text: #344b3d;
  --accent: #b65f43;
  --accent-soft: #f6e5de;
  --warning: #7c5c17;
  --warning-soft: #f4ebd1;
  --success: #506b59;
  --success-soft: #e7efe9;
  --sidebar: #efeee8;
  --sidebar-text: #24302a;
  --sidebar-muted: #66736b;
  --sidebar-active: rgba(80, 107, 89, 0.12);
  --glass: rgba(247, 246, 242, 0.94);
  --summary-events: #e9efea;
  --summary-events-border: #c4d1c6;
  --summary-notes: #f4ebd8;
  --summary-notes-border: #dfcfaa;
  --summary-dinner: #f6e5de;
  --summary-dinner-border: #e4bcae;
  --shadow-sm: 0 1px 2px rgba(36, 48, 42, 0.04), 0 8px 24px rgba(36, 48, 42, 0.06);
  --shadow-md: 0 2px 6px rgba(36, 48, 42, 0.06), 0 20px 48px rgba(36, 48, 42, 0.1);
}

body[data-palette="indigo"][data-theme="light"],
body[data-palette="indigo"][data-theme="system"] {
  --app-bg: #f4f6fa;
  --surface: #ffffff;
  --surface-subtle: #eef1f7;
  --surface-elevated: #ffffff;
  --text: #1f2937;
  --text-subtle: #667085;
  --heading: #111827;
  --border: #dce1ea;
  --border-strong: #adb6c6;
  --primary: #4f46e5;
  --primary-hover: #4038c7;
  --on-primary: #ffffff;
  --primary-soft: #e8e7ff;
  --primary-soft-text: #3730a3;
  --accent: #168397;
  --accent-soft: #e0f3f5;
  --warning: #7a5a12;
  --warning-soft: #f8efd6;
  --success: #257357;
  --success-soft: #e2f1eb;
  --sidebar: #111827;
  --sidebar-text: #f7f8fc;
  --sidebar-muted: #b7bfd0;
  --sidebar-active: rgba(124, 131, 255, 0.24);
  --glass: rgba(244, 246, 250, 0.94);
  --summary-events: #e9edff;
  --summary-events-border: #c6cbf8;
  --summary-notes: #e3f2f5;
  --summary-notes-border: #b8dce2;
  --summary-dinner: #f3eaf8;
  --summary-dinner-border: #d9c5e6;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.07);
  --shadow-md: 0 2px 6px rgba(17, 24, 39, 0.07), 0 20px 48px rgba(17, 24, 39, 0.11);
}

body[data-palette="teal"][data-theme="light"],
body[data-palette="teal"][data-theme="system"] {
  --app-bg: #faf8f3;
  --surface: #fffdfc;
  --surface-subtle: #edf4f1;
  --surface-elevated: #ffffff;
  --text: #173b3f;
  --text-subtle: #5f7774;
  --heading: #0f3034;
  --border: #deddd4;
  --border-strong: #a9bdb8;
  --primary: #236d69;
  --primary-hover: #195a57;
  --on-primary: #ffffff;
  --primary-soft: #dceeeB;
  --primary-soft-text: #195a57;
  --accent: #bd6843;
  --accent-soft: #fae8dc;
  --warning: #7d5c22;
  --warning-soft: #f3ead8;
  --success: #236d69;
  --success-soft: #dff0eb;
  --sidebar: #f3f0e8;
  --sidebar-text: #173b3f;
  --sidebar-muted: #5f7774;
  --sidebar-active: rgba(35, 109, 105, 0.13);
  --glass: rgba(250, 248, 243, 0.94);
  --summary-events: #e0efec;
  --summary-events-border: #bad7d2;
  --summary-notes: #f3ead8;
  --summary-notes-border: #ddccaa;
  --summary-dinner: #fae8dc;
  --summary-dinner-border: #eac2aa;
  --shadow-sm: 0 1px 2px rgba(23, 59, 63, 0.04), 0 8px 24px rgba(23, 59, 63, 0.06);
  --shadow-md: 0 2px 6px rgba(23, 59, 63, 0.06), 0 20px 48px rgba(23, 59, 63, 0.1);
}

body[data-palette="sage"][data-theme="dark"] {
  --app-bg: #101713;
  --surface: #1b2720;
  --surface-subtle: #223128;
  --surface-elevated: #1e2c24;
  --text: #ecf2ed;
  --text-subtle: #a9b7ac;
  --heading: #f5f8f5;
  --border: #35473b;
  --border-strong: #596d5e;
  --primary: #9db8a3;
  --primary-hover: #b4c9b8;
  --on-primary: #132018;
  --primary-soft: #2a3b30;
  --primary-soft-text: #c3d6c6;
  --accent: #db8b6c;
  --accent-soft: #432d25;
  --warning: #d7bd7e;
  --warning-soft: #3b3321;
  --success: #9db8a3;
  --success-soft: #293b30;
  --sidebar: #17211b;
  --sidebar-text: #f1f5f2;
  --sidebar-muted: #a9b7ac;
  --sidebar-active: rgba(157, 184, 163, 0.18);
  --glass: rgba(16, 23, 19, 0.95);
  --summary-events: #24352a;
  --summary-events-border: #405745;
  --summary-notes: #383322;
  --summary-notes-border: #5b5130;
  --summary-dinner: #3d2b25;
  --summary-dinner-border: #624238;
}

body[data-palette="indigo"][data-theme="dark"] {
  --app-bg: #0f1420;
  --surface: #171e2c;
  --surface-subtle: #1d2636;
  --surface-elevated: #1a2332;
  --text: #f3f5fa;
  --text-subtle: #a8b0c2;
  --heading: #fafbff;
  --border: #303b4e;
  --border-strong: #4c5870;
  --primary: #9298ff;
  --primary-hover: #abb0ff;
  --on-primary: #11152b;
  --primary-soft: #292d57;
  --primary-soft-text: #c4c7ff;
  --accent: #63c3d0;
  --accent-soft: #203a42;
  --warning: #e4c276;
  --warning-soft: #3b3321;
  --success: #78caa8;
  --success-soft: #213a32;
  --sidebar: #111827;
  --sidebar-text: #f4f6fb;
  --sidebar-muted: #a8b0c2;
  --sidebar-active: rgba(124, 131, 255, 0.25);
  --glass: rgba(15, 20, 32, 0.95);
  --summary-events: #252b50;
  --summary-events-border: #434b7d;
  --summary-notes: #203640;
  --summary-notes-border: #365a68;
  --summary-dinner: #352a42;
  --summary-dinner-border: #584269;
}

body[data-palette="teal"][data-theme="dark"] {
  --app-bg: #0d1b1c;
  --surface: #16292a;
  --surface-subtle: #1b3131;
  --surface-elevated: #193031;
  --text: #f1f3ec;
  --text-subtle: #aebdb7;
  --heading: #fafbf5;
  --border: #344b49;
  --border-strong: #526c68;
  --primary: #71bdb6;
  --primary-hover: #8bcac4;
  --on-primary: #0d2625;
  --primary-soft: #244240;
  --primary-soft-text: #a7dad5;
  --accent: #f0a06b;
  --accent-soft: #443126;
  --warning: #c8b68e;
  --warning-soft: #3a3426;
  --success: #71bdb6;
  --success-soft: #24403d;
  --sidebar: #102324;
  --sidebar-text: #f2f4ed;
  --sidebar-muted: #aebdb7;
  --sidebar-active: rgba(113, 189, 182, 0.18);
  --glass: rgba(13, 27, 28, 0.95);
  --summary-events: #213d3b;
  --summary-events-border: #3b605c;
  --summary-notes: #393529;
  --summary-notes-border: #5d5540;
  --summary-dinner: #402f27;
  --summary-dinner-border: #67483a;
}

@media (prefers-color-scheme: dark) {
  body[data-palette="sage"][data-theme="system"] {
    --app-bg: #101713; --surface: #1b2720; --surface-subtle: #223128; --surface-elevated: #1e2c24;
    --text: #ecf2ed; --text-subtle: #a9b7ac; --heading: #f5f8f5; --border: #35473b; --border-strong: #596d5e;
    --primary: #9db8a3; --primary-hover: #b4c9b8; --on-primary: #132018; --primary-soft: #2a3b30; --primary-soft-text: #c3d6c6;
    --accent: #db8b6c; --accent-soft: #432d25; --warning: #d7bd7e; --warning-soft: #3b3321; --success: #9db8a3; --success-soft: #293b30;
    --sidebar: #17211b; --sidebar-text: #f1f5f2; --sidebar-muted: #a9b7ac; --sidebar-active: rgba(157, 184, 163, 0.18);
    --glass: rgba(16, 23, 19, 0.95); --summary-events: #24352a; --summary-events-border: #405745;
    --summary-notes: #383322; --summary-notes-border: #5b5130; --summary-dinner: #3d2b25; --summary-dinner-border: #624238;
  }

  body[data-palette="indigo"][data-theme="system"] {
    --app-bg: #0f1420; --surface: #171e2c; --surface-subtle: #1d2636; --surface-elevated: #1a2332;
    --text: #f3f5fa; --text-subtle: #a8b0c2; --heading: #fafbff; --border: #303b4e; --border-strong: #4c5870;
    --primary: #9298ff; --primary-hover: #abb0ff; --on-primary: #11152b; --primary-soft: #292d57; --primary-soft-text: #c4c7ff;
    --accent: #63c3d0; --accent-soft: #203a42; --warning: #e4c276; --warning-soft: #3b3321; --success: #78caa8; --success-soft: #213a32;
    --sidebar: #111827; --sidebar-text: #f4f6fb; --sidebar-muted: #a8b0c2; --sidebar-active: rgba(124, 131, 255, 0.25);
    --glass: rgba(15, 20, 32, 0.95); --summary-events: #252b50; --summary-events-border: #434b7d;
    --summary-notes: #203640; --summary-notes-border: #365a68; --summary-dinner: #352a42; --summary-dinner-border: #584269;
  }

  body[data-palette="teal"][data-theme="system"] {
    --app-bg: #0d1b1c; --surface: #16292a; --surface-subtle: #1b3131; --surface-elevated: #193031;
    --text: #f1f3ec; --text-subtle: #aebdb7; --heading: #fafbf5; --border: #344b49; --border-strong: #526c68;
    --primary: #71bdb6; --primary-hover: #8bcac4; --on-primary: #0d2625; --primary-soft: #244240; --primary-soft-text: #a7dad5;
    --accent: #f0a06b; --accent-soft: #443126; --warning: #c8b68e; --warning-soft: #3a3426; --success: #71bdb6; --success-soft: #24403d;
    --sidebar: #102324; --sidebar-text: #f2f4ed; --sidebar-muted: #aebdb7; --sidebar-active: rgba(113, 189, 182, 0.18);
    --glass: rgba(13, 27, 28, 0.95); --summary-events: #213d3b; --summary-events-border: #3b605c;
    --summary-notes: #393529; --summary-notes-border: #5d5540; --summary-dinner: #402f27; --summary-dinner-border: #67483a;
  }
}

body {
  background: var(--app-bg);
  color: var(--text);
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline-color: var(--primary);
}

.mobile-header {
  border-color: var(--border);
  background: var(--glass);
}

.mobile-brand,
.brand {
  color: var(--heading);
}

.brand__mark {
  border-radius: 0.75rem;
  background: var(--primary);
  color: var(--on-primary);
  letter-spacing: 0.04em;
}

.mobile-account,
.account-card__avatar {
  border-color: var(--border-strong);
  background: var(--primary-soft);
  color: var(--primary-soft-text);
}

.mobile-nav {
  border-color: var(--border);
  background: var(--glass);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.08);
}

.mobile-nav .app-nav__link.is-active {
  background: var(--primary-soft);
  color: var(--primary-soft-text);
}

.button {
  border-radius: 0.8rem;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

.button--primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

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

.button--secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-soft-text);
}

.button--quiet {
  color: var(--primary);
}

.button--quiet:hover {
  background: var(--primary-soft);
  color: var(--primary-soft-text);
}

.button--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.button--danger:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 82%, var(--danger));
  color: var(--danger);
}

.eyebrow {
  color: var(--accent);
}

.page-heading h1,
.feature-page h1,
.panel__header h2,
.auth-card h1,
.record-card__body h3,
.editor-page__heading h1,
.week-header h2,
.dinner-day > header strong,
.dinner-day__meal h3,
.family-card h3,
.form-field > label,
.audience-fieldset > legend,
.settings-fieldset > legend,
.dish-fieldset > legend {
  color: var(--heading);
}

.panel,
.auth-card,
.feature-status,
.editor-form,
.record-card,
.dinner-day,
.family-card,
.choice-row,
.option-card,
.settings-links a {
  border-color: var(--border);
  background: var(--surface);
}

.panel {
  border-radius: 1rem;
}

.summary-card--events {
  border-color: var(--summary-events-border);
  background: var(--summary-events);
}

.summary-card--notes {
  border-color: var(--summary-notes-border);
  background: var(--summary-notes);
}

.summary-card--dinner {
  border-color: var(--summary-dinner-border);
  background: var(--summary-dinner);
}

.summary-card > span:not(.summary-card__label, .summary-card__arrow) {
  color: var(--text-subtle);
}

.empty-state {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.note-card,
.board-note {
  border-color: var(--summary-notes-border);
  background: var(--summary-notes);
  color: var(--text);
}

.note-card:nth-child(even) {
  border-color: var(--summary-events-border);
  background: var(--summary-events);
}

.status-banner {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.member-picker {
  border-color: var(--border);
  background: var(--surface-subtle);
}

.family-card.is-current,
.option-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.form-field .form-control,
.form-field .form-select,
.stack-form .form-control,
.auth-card .form-control {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.auth-card .form-floating > label {
  color: var(--text-subtle);
}

.auth-card .form-control:focus {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--text);
}

.auth-card .form-check-input {
  border-color: var(--border-strong);
  background-color: var(--surface);
}

.auth-card .form-check-input:checked {
  border-color: var(--primary);
  background-color: var(--primary);
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--text-subtle);
  opacity: 0.8;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--primary) 24%, transparent);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--primary);
}

.option-card--theme {
  grid-template-columns: 1.25rem 3rem minmax(0, 1fr);
}

.settings-fieldset__hint {
  margin: -0.15rem 0 0.35rem;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.option-card--palette {
  grid-template-columns: 1.25rem 4.25rem minmax(0, 1fr);
}

.palette-swatch {
  display: grid;
  width: 4.25rem;
  height: 2.15rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  grid-template-columns: repeat(3, 1fr);
}

.palette-swatch i {
  display: block;
}

.palette-swatch--sage i:nth-child(1) { background: #f7f6f2; }
.palette-swatch--sage i:nth-child(2) { background: #718a78; }
.palette-swatch--sage i:nth-child(3) { background: #24302a; }
.palette-swatch--indigo i:nth-child(1) { background: #f4f6fa; }
.palette-swatch--indigo i:nth-child(2) { background: #4f46e5; }
.palette-swatch--indigo i:nth-child(3) { background: #111827; }
.palette-swatch--teal i:nth-child(1) { background: #faf8f3; }
.palette-swatch--teal i:nth-child(2) { background: #2f7c78; }
.palette-swatch--teal i:nth-child(3) { background: #d8c7a5; }

.theme-swatch {
  display: grid;
  width: 3rem;
  height: 2.15rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  background: #ffffff;
  grid-template-columns: 0.72rem 1fr;
}

.theme-swatch i:first-child {
  background: #173f2c;
}

.theme-swatch i:last-child {
  margin: 0.45rem 0.4rem;
  border-radius: 0.2rem;
  background: #e2e9e5;
}

.theme-swatch--dark {
  border-color: #4e5b54;
  background: #171c19;
}

.theme-swatch--dark i:first-child {
  background: #0a0e0c;
}

.theme-swatch--dark i:last-child {
  background: #35413a;
}

.theme-swatch--system {
  grid-template-columns: 1fr 1fr;
}

.theme-swatch--system i:first-child {
  background: linear-gradient(90deg, #173f2c 35%, #ffffff 35%);
}

.theme-swatch--system i:last-child {
  margin: 0;
  border-radius: 0;
  background: linear-gradient(90deg, #0a0e0c 35%, #202722 35%);
}

.settings-links a:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.settings-links strong {
  color: var(--heading);
}

@media (min-width: 61.25rem) {
  .app-sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
  }

  .brand,
  .brand:hover {
    color: var(--sidebar-text);
  }

  .brand small,
  .account-card__profile small,
  .account-card__logout {
    color: var(--sidebar-muted);
  }

  .brand__mark {
    background: var(--primary);
    color: var(--on-primary);
  }

  .app-nav .app-nav__link {
    color: var(--sidebar-muted);
  }

  .app-nav .app-nav__link:hover,
  .app-nav .app-nav__link.is-active {
    background: var(--sidebar-active, rgba(255, 255, 255, 0.09));
    color: var(--sidebar-text);
  }

  .app-nav .app-nav__link.is-active {
    box-shadow: inset 3px 0 0 var(--primary);
  }
}

@media print {
  .app-sidebar,
  .mobile-header,
  .mobile-nav,
  .app-footer,
  .no-print {
    display: none !important;
  }

  .app-frame,
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .recipe-details__grid {
    grid-template-columns: 1fr !important;
  }

  .panel {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .recipe-details__image {
    max-height: 14rem !important;
  }
}
