:root {
  --app-bg: #fff7ed;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #17212b;
  --muted: #697586;
  --line: #e5e7eb;
  --primary: #0f766e;
  --primary-soft: #ccfbf1;
  --accent: #f97316;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(15, 23, 42, .14);
  --header-h: 72px;
  --nav-h: 78px;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--app-bg);
  color: var(--ink);
  font-family: "Signika", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  overscroll-behavior-y: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.profile-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, .2), transparent 42%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, .18), transparent 36%),
    var(--app-bg);
}

.profile-panel {
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .78rem;
}

.profile-panel h1 {
  margin: 0 0 26px;
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 650;
}

.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 14px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, .14), rgba(15, 118, 110, .1)),
    var(--app-bg);
}

.auth-panel {
  width: min(100%, 440px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.auth-panel h1 {
  margin: 0 0 20px;
  font-size: 1.8rem;
  line-height: 1.05;
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-bottom: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  outline: 0;
}

.auth-form input:focus {
  border-color: rgba(15, 118, 110, .5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.auth-message {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: .9rem;
}

.auth-message.success {
  background: #dcfce7;
  color: #166534;
}

.auth-message.error {
  background: #fee2e2;
  color: #991b1b;
}

.demo-login {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px dashed rgba(15, 118, 110, .35);
  border-radius: 8px;
  background: #f0fdfa;
  color: #115e59;
  font-size: .88rem;
}

.landing-page {
  min-height: 100dvh;
  padding: 18px 14px 34px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, .12), rgba(15, 118, 110, .08)),
    var(--app-bg);
}

.landing-header,
.landing-hero,
.landing-module-section,
.landing-features {
  width: min(1080px, 100%);
  margin-inline: auto;
}

.landing-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.landing-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 5vw, 2.4rem);
  line-height: 1.05;
  font-weight: 650;
}

.landing-actions,
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-hero {
  min-height: calc(100dvh - 250px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  align-items: center;
  gap: 28px;
  padding: 34px 0;
}

.landing-copy h2 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: .98;
  font-weight: 650;
}

.landing-copy p {
  max-width: 650px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
  font-weight: 450;
}

.landing-preview {
  min-height: 360px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-top {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.preview-top span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  border: 2px solid rgba(255, 255, 255, .42);
}

.preview-top strong {
  font-size: 1.12rem;
}

.preview-module-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.preview-module-list article {
  min-height: 78px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #fff7ed 0%, #f8fafc 100%);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
}

.preview-module-list svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.preview-module-list strong,
.preview-module-list span {
  display: block;
}

.preview-module-list span {
  color: var(--muted);
  font-size: .9rem;
}

.landing-module-section {
  margin-top: 6px;
}

.landing-section-head {
  margin-bottom: 14px;
}

.landing-section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.05;
  font-weight: 650;
}

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

.landing-module-card {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

.landing-module-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ccfbf1;
  color: #0f766e;
}

.landing-module-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.landing-module-icon.violet {
  background: #ede9fe;
  color: #7c3aed;
}

.landing-module-icon.amber {
  background: #ffedd5;
  color: #ea580c;
}

.landing-module-card h3 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 650;
}

.landing-module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.landing-module-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-module-card li {
  position: relative;
  padding-left: 22px;
  color: #334155;
  line-height: 1.35;
}

.landing-module-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .58em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

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

.landing-features article {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .84);
}

.landing-features svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.landing-features strong {
  font-size: 1.02rem;
}

.landing-features span {
  color: var(--muted);
  line-height: 1.35;
}

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

.profile-card {
  border: 0;
  background: rgba(255, 255, 255, .78);
  border-radius: 8px;
  padding: 18px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--ink);
}

.avatar, .avatar-button {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  font-weight: 650;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--avatar-a), var(--avatar-b));
}

.avatar {
  width: 76px;
  height: 76px;
  font-size: 1.45rem;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: .72rem;
  border: 2px solid white;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .18);
}

.profile-card strong {
  display: block;
  font-size: 1.02rem;
}

.profile-card span {
  color: var(--muted);
  font-size: .85rem;
}

.plus-avatar {
  background: var(--surface);
  color: var(--primary);
  border: 2px dashed rgba(15, 118, 110, .55);
}

.app-shell {
  height: 100dvh;
  overflow: hidden;
  background: var(--app-bg);
}

.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr 48px;
  align-items: center;
  gap: 12px;
  z-index: 20;
  background: linear-gradient(135deg, rgba(249, 115, 22, .96), rgba(251, 146, 60, .94) 48%, rgba(255, 237, 213, .96));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(194, 65, 12, .24);
  box-shadow: 0 10px 28px rgba(154, 52, 18, .18);
}

.header-profile-cluster {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar-button, .icon-button {
  width: 44px;
  height: 44px;
  border: 0;
}

.header-points-badge {
  min-height: 32px;
  max-width: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, .92);
  color: #7c2d12;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(124, 45, 18, .16);
}

.header-points-badge svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.header-points-badge span {
  font-size: 1.2rem;
}

.header-title-stack {
  min-width: 0;
  display: grid;
  justify-items: center;
}

.app-header h1,
.header-title-stack h1 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  text-shadow: 0 1px 8px rgba(124, 45, 18, .28);
}

.icon-button {
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #9a3412;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.app-content {
  height: 100dvh;
  overflow-y: auto;
  padding: calc(var(--header-h) + env(safe-area-inset-top) + 14px) 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px);
  -webkit-overflow-scrolling: touch;
}

.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  z-index: 20;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.nav-item svg { width: 21px; height: 21px; }
.nav-item span { font-size: .72rem; font-weight: 550; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }

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

.module-option {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: white;
  text-align: left;
}

.module-option > svg,
.module-option > i svg {
  width: 22px;
  height: 22px;
}

.module-option > svg {
  color: var(--primary);
}

.module-option strong,
.module-option small {
  display: block;
}

.module-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 550;
}

.module-option.active {
  border-color: rgba(15, 118, 110, .45);
  background: #f0fdfa;
}

.week-switcher, .toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.week-label {
  font-weight: 650;
  text-align: center;
  line-height: 1.15;
}

.planning-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 14px;
}

.planning-toolbar .primary-button {
  flex: 1 1 auto;
}

.planning-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.context-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 190px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px;
  box-shadow: var(--shadow);
}

.context-menu button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  font-weight: 600;
  text-align: left;
}

.context-menu button:hover {
  background: var(--surface-soft);
}

.pill-button, .primary-button, .ghost-button, .danger-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.pill-button { background: white; color: var(--ink); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.primary-button { background: var(--primary); color: white; }
.ghost-button { background: var(--surface-soft); color: var(--ink); }
.danger-button { background: #fee2e2; color: var(--danger); }

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

.day-card {
  background: var(--surface);
  border: 1px solid rgba(229, 231, 235, .88);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
  position: relative;
}

.day-card::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.day-card.today {
  border-color: rgba(15, 118, 110, .55);
  box-shadow: 0 14px 30px rgba(15, 118, 110, .16);
}

.day-card.today::before {
  height: 8px;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.day-card.locked {
  border-color: rgba(249, 115, 22, .45);
}

.day-card.locked::before {
  background: linear-gradient(90deg, #f97316, #facc15);
}

.module-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.module-intro h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 650;
}

.tasks-intro {
  border-top: 5px solid #2563eb;
}

.school-intro {
  border-top: 5px solid #7c3aed;
}

.finance-intro {
  border-top: 5px solid #059669;
}

.role-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: .78rem;
  font-weight: 700;
}

.tasks-list,
.reward-grid {
  display: grid;
  gap: 10px;
}

.task-card,
.school-card,
.reward-card {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.task-card {
  grid-template-columns: 38px 1fr auto;
}

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

.school-card.graded {
  background: #f8fafc;
}

.school-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.school-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ede9fe;
  color: #6d28d9;
}

.school-card strong,
.school-card small,
.school-study-line {
  display: block;
  min-width: 0;
}

.school-card small,
.school-study-line {
  margin-top: 3px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.25;
}

.school-study-line {
  color: #5b21b6;
  font-weight: 650;
}

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

.school-summary-card {
  border-top: 5px solid #7c3aed;
}

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

.finance-card,
.finance-detail-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.finance-card {
  cursor: pointer;
}

.finance-card-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.finance-card-head strong,
.finance-card-head small {
  display: block;
  min-width: 0;
}

.finance-card-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .84rem;
}

.finance-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #d1fae5;
  color: #047857;
}

.finance-budget {
  display: grid;
  gap: 6px;
}

.finance-budget > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
}

.finance-budget-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.finance-budget-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #059669;
}

.finance-budget-track.over span {
  background: #dc2626;
}

.finance-budget small {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 550;
}

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

.finance-metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-soft);
}

.finance-metrics small,
.finance-metrics strong {
  display: block;
}

.finance-metrics small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-total,
.finance-income {
  color: #047857;
}

.finance-expense {
  color: #b91c1c;
}

.finance-transaction-row {
  align-items: flex-start;
}

.reward-card {
  grid-template-columns: 48px 1fr;
}

.task-check {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #2563eb;
}

.task-card.done {
  background: #f8fafc;
}

.task-card.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.task-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.task-action-row .primary-button,
.task-action-row .ghost-button {
  width: 100%;
}

.task-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-priority {
  border-radius: 999px;
  padding: 5px 8px;
  background: #e5e7eb;
  color: #374151;
  font-size: .72rem;
  font-weight: 800;
}

.task-priority.high {
  background: #fee2e2;
  color: #991b1b;
}

.task-priority.low {
  background: #dcfce7;
  color: #166534;
}

.task-template-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px;
}

.task-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-template-head strong,
.task-template-head small {
  display: block;
}

.task-template-head small {
  color: #475569;
  font-size: .8rem;
  font-weight: 650;
}

.task-template-list {
  display: grid;
  gap: 8px;
}

.drawer-action-row {
  margin-bottom: 12px;
}

.task-template-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.task-template-button {
  min-height: 54px;
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.task-template-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.task-template-button span,
.task-template-button small {
  display: block;
}

.task-template-button span {
  font-weight: 750;
}

.task-template-button small {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 550;
}

.task-card strong,
.task-card small,
.reward-card strong,
.reward-card small {
  display: block;
}

.task-card small,
.reward-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 550;
}

.dish-photo {
  min-height: 178px;
  background-color: #e2e8f0;
  background-size: cover;
  background-position: center;
  position: relative;
}

.dish-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, .58));
}

.dish-preview-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  background: white;
}

.dish-preview-grid::after {
  display: none;
}

.dish-preview-tile {
  min-width: 0;
  background-color: #e2e8f0;
  background-size: cover;
  background-position: center;
  position: relative;
}

.dish-preview-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 36%, rgba(15, 23, 42, .64));
}

.dish-preview-tile span {
  position: absolute;
  inset: auto 9px 10px;
  z-index: 1;
  color: white;
  font-size: .78rem;
  line-height: 1.05;
  font-weight: 650;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.fallback-title {
  position: absolute;
  inset: auto 14px 12px;
  z-index: 1;
  color: white;
  font-weight: 650;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.dish-meta-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100% - 20px);
}

.dish-meta-overlay span {
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(15, 23, 42, .7);
  color: white;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
  padding: 5px 8px;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.day-body {
  padding: 13px;
}

.planned-dish-list {
  display: grid;
  gap: 9px;
}

.planned-dish-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffae5;
  padding: 10px;
  border-left: 8px solid #f2ddb7;
  box-shadow: 0px 0px 3px #cfcfcf;
}

.planned-dish-main {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.planned-dish-main strong,
.meal-slot-label {
  display: block;
}

.meal-slot-label {
  color: var(--primary);
  font-size: .74rem;
  font-weight: 650;
  text-transform: uppercase;
}

.planned-dish-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.small-icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

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

.slot-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 650;
}

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

.segmented-row,
.assistant-check-grid {
  display: grid;
  gap: 8px;
}

.segmented-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.segmented-row label,
.assistant-check-grid label {
  cursor: pointer;
}

.segmented-row input,
.assistant-check-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-row span,
.assistant-check-grid span {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 9px 10px;
  font-weight: 650;
  text-align: center;
}

.segmented-row input:checked + span,
.assistant-check-grid input:checked + span {
  color: #115e59;
  border-color: rgba(15, 118, 110, .38);
  background: var(--primary-soft);
}

.assistant-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.assistant-label input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  outline: 0;
}

.day-card .day-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 13px;
  background: linear-gradient(135deg, #ffedd5 0%, #eef2f7 100%);
  border-bottom: 1px solid rgba(148, 163, 184, .28);
}

.day-card .day-head strong {
  display: block;
  color: var(--primary);
  font-size: 1.14rem;
  line-height: 1.05;
}

.day-card .day-head span {
  color: var(--muted);
  font-weight: 600;
  font-size: .82rem;
}

.status-badge, .tag-chip {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .73rem;
  font-weight: 600;
}

.status-badge.locked { background: #ffedd5; color: #9a3412; }
.status-badge.open { background: var(--primary-soft); color: #115e59; }

.section-title {
  font-size: .9rem;
  font-weight: 650;
  margin: 18px 0 9px;
}

.section-title.compact-title {
  margin: 10px 0 6px;
}

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

.mini-dish {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  position: relative;
}

.mini-dish .dish-photo { min-height: 122px; }
.mini-dish .fallback-title { font-size: .86rem; inset: auto 10px 10px; }
.mini-dish .dish-meta-overlay { display: none; }
.mini-dish .dish-meta-overlay span { padding: 4px 7px; font-size: .68rem; }
.mini-dish-body { padding: 10px; }
.mini-dish strong { display: block; font-size: .9rem; line-height: 1.18; }
.mini-dish small { color: var(--muted); font-weight: 500; }

.mini-dish-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.offer-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(249, 115, 22, .34);
  border-radius: 8px;
  background: #ffedd5;
  color: #9a3412;
  display: inline-grid;
  grid-template-columns: 1fr;
  place-items: center;
  position: relative;
}

.offer-icon-button svg {
  width: 18px;
  height: 18px;
}

.offer-icon-button span {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: .68rem;
  font-weight: 650;
}

.avatar-stack {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
}

.avatar-stack .avatar { margin-right: -8px; }

.search-box {
  position: sticky;
  top: -14px;
  background: var(--app-bg);
  padding: 0 0 10px;
  z-index: 3;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  outline: 0;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.ingredient-filter-row {
  padding-bottom: 14px;
}

.chip-row::-webkit-scrollbar { display: none; }

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 8px 11px;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 600;
}

.filter-chip.active {
  color: #115e59;
  border-color: rgba(15, 118, 110, .38);
  background: var(--primary-soft);
}

.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.rating-pill {
  color: var(--primary);
  font-weight: 650;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--primary-soft);
  border: 1px solid rgba(15, 118, 110, .24);
}

.red-flag {
  color: var(--danger);
  font-weight: 650;
  font-size: .82rem;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fee2e2;
  border: 1px solid rgba(220, 38, 38, .18);
}

.family-rating-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.family-rating-line svg {
  width: 14px;
  height: 14px;
}

.family-rating-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.family-rating-head,
.family-rating-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.family-rating-head strong {
  color: var(--ink);
}

.family-rating-head span {
  color: var(--primary);
  font-weight: 760;
}

.family-rating-list {
  display: grid;
  gap: 8px;
}

.family-rating-item {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.family-rating-item > div {
  flex: 1 1 auto;
  min-width: 0;
}

.family-rating-item strong,
.family-rating-item small {
  display: block;
}

.family-rating-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}

.family-rating-item > span {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 760;
  font-size: .82rem;
}

.more-list, .shopping-list {
  display: grid;
  gap: 10px;
}

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

.tab-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
}

.tab-button.active {
  color: #115e59;
  border-color: rgba(15, 118, 110, .38);
  background: var(--primary-soft);
}

.list-action {
  min-height: 58px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
  border-radius: 8px;
  padding: 13px;
  border: 1px solid var(--line);
}

.shopping-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.shopping-item.muted {
  opacity: .56;
  background: var(--surface-soft);
}

.shopping-item.has-offer {
  border-color: rgba(249, 115, 22, .42);
  background: #fff7ed;
}

.shopping-item.must-go-shopping {
  border-color: rgba(124, 58, 237, .34);
  background: #faf5ff;
}

.shopping-item.muted strong {
  text-decoration: line-through;
}

.shopping-item.must-go-shopping strong {
  text-decoration: none;
}

.shopping-item strong,
.shopping-item small {
  display: block;
}

.shopping-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 550;
}

.shopping-day-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.shopping-day-row::-webkit-scrollbar {
  display: none;
}

.day-toggle {
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  justify-items: center;
  font-weight: 650;
}

.day-toggle span {
  text-transform: uppercase;
}

.day-toggle small {
  font-size: .7rem;
  font-weight: 600;
}

.day-toggle.active {
  color: #115e59;
  border-color: rgba(15, 118, 110, .38);
  background: var(--primary-soft);
}

.day-toggle.done {
  color: #64748b;
  background: #f1f5f9;
  border-style: dashed;
}

.shopping-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  margin: 0 0 10px;
}

.offer-summary {
  margin-top: 2px;
}

.offer-filter-row {
  margin-bottom: 12px;
}

.offer-list-item {
  align-items: flex-start;
}

.offer-list-item > div {
  min-width: 0;
}

.offer-list-item .offer-inline {
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: 2px;
}

.offer-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.offer-badge,
.offer-inline,
.must-go-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid rgba(249, 115, 22, .28);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
}

.offer-badge {
  padding: 6px 8px;
}

.offer-inline {
  margin-left: 5px;
  padding: 5px 7px;
  vertical-align: middle;
}

.must-go-inline {
  margin-left: 5px;
  padding: 5px 7px;
  vertical-align: middle;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid rgba(124, 58, 237, .26);
}

.dish-must-go {
  width: fit-content;
  margin: 6px 0 0;
}

.offer-badge svg,
.offer-inline svg,
.must-go-inline svg {
  width: 14px;
  height: 14px;
}

.health-badge,
.season-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 720;
  line-height: 1;
}

.health-badge svg,
.season-badge svg {
  width: 13px;
  height: 13px;
}

.health-badge.good {
  background: #dcfce7;
  color: #166534;
}

.health-badge.ok {
  background: #ecfeff;
  color: #155e75;
}

.health-badge.watch {
  background: #fff7ed;
  color: #9a3412;
}

.season-badge.good {
  background: #dcfce7;
  color: #166534;
}

.season-badge.ok {
  background: #fef9c3;
  color: #854d0e;
}

.dish-nutrition {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.dish-nutrition-head strong {
  color: var(--ink);
}

.dish-nutrition-head small {
  color: var(--muted);
  text-align: right;
}

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

.nutrition-metrics span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: .78rem;
}

.nutrition-metrics strong {
  color: var(--ink);
  font-size: .98rem;
}

.nutrition-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nutrition-highlights span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #115e59;
  font-size: .74rem;
  font-weight: 700;
}

.week-analysis-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.analysis-day-card,
.week-analysis-total {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.week-analysis-total {
  margin-top: 14px;
  background: #f8fafc;
  border-color: rgba(15, 118, 110, .22);
}

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

.analysis-card-head strong,
.analysis-card-head small {
  display: block;
}

.analysis-card-head strong {
  color: var(--ink);
}

.analysis-card-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}

.analysis-score {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: .73rem;
  font-weight: 760;
  line-height: 1;
}

.analysis-score.good {
  background: #dcfce7;
  color: #166534;
}

.analysis-score.ok {
  background: #ecfeff;
  color: #155e75;
}

.analysis-score.watch,
.analysis-score.empty {
  background: #fff7ed;
  color: #9a3412;
}

.analysis-bars {
  display: grid;
  gap: 9px;
}

.analysis-bar-row {
  display: grid;
  gap: 5px;
}

.analysis-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: .82rem;
}

.analysis-bar-label span {
  font-weight: 700;
}

.analysis-bar-label strong {
  font-size: .82rem;
}

.analysis-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.analysis-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f766e;
}

.analysis-bar-row.low .analysis-track span {
  background: #f97316;
}

.analysis-bar-row.watch .analysis-track span {
  background: #f59e0b;
}

.analysis-bar-row.over .analysis-track span {
  background: #dc2626;
}

.analysis-bar-row small {
  color: var(--muted);
  font-size: .72rem;
}

.analysis-hints {
  display: grid;
  gap: 6px;
}

.analysis-hints span {
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.3;
}

.compact-empty {
  margin: 0;
  padding: 10px;
}

.manual-entry {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.manual-entry input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  outline: 0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 550;
}

.compact {
  min-height: 38px;
  padding: 8px 10px;
}

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

.leftover-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.leftover-form input,
.leftover-form select,
.leftover-form textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  outline: 0;
}

.leftover-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 35;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: var(--accent);
  color: white;
  padding: 12px 8px;
  font-size: .78rem;
  font-weight: 650;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

.leftover-tab-alert {
  background: #dc2626;
  animation: leftover-tab-alert .72s ease-in-out infinite;
}

@keyframes leftover-tab-alert {
  0%, 100% {
    background: #dc2626;
    filter: brightness(1);
    box-shadow: 0 10px 26px rgba(220, 38, 38, .28);
  }
  50% {
    background: #f97316;
    filter: brightness(1.18);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .28), 0 12px 34px rgba(220, 38, 38, .62);
  }
}

@media (prefers-reduced-motion: reduce) {
  .leftover-tab-alert,
  .must-go-tab-alert {
    animation: none;
  }
}

.must-go-tab {
  position: fixed;
  right: 0;
  top: 64%;
  z-index: 35;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: #7c3aed;
  color: white;
  padding: 12px 8px;
  font-size: .78rem;
  font-weight: 650;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

.must-go-tab-alert {
  background: #7c3aed;
  animation: must-go-tab-alert 1.25s ease-in-out infinite;
}

@keyframes must-go-tab-alert {
  0%, 100% {
    background: #7c3aed;
    box-shadow: 0 10px 26px rgba(124, 58, 237, .24);
  }
  50% {
    background: #a855f7;
    box-shadow: 0 10px 30px rgba(124, 58, 237, .48);
  }
}

.task-quick-tab,
.task-template-tab {
  position: fixed;
  right: 0;
  z-index: 35;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  border: 0;
  border-radius: 8px 0 0 8px;
  color: white;
  padding: 12px 8px;
  font-size: .78rem;
  font-weight: 650;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

.task-quick-tab {
  top: 44%;
  background: #2563eb;
}

.task-template-tab {
  top: 62%;
  background: #0f766e;
}

.leftover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, .36);
}

.leftover-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  width: min(380px, 88vw);
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  background: var(--app-bg);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .18s ease;
  overflow-y: auto;
}

.leftover-drawer.open {
  transform: translateX(0);
}

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

.leftover-item {
  display: grid;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.leftover-meta-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.leftover-age-badge {
  display: inline-block;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1;
}

.leftover-age-badge.fresh {
  background: #dcfce7;
  color: #166534;
}

.leftover-age-badge.warning {
  background: #ffedd5;
  color: #9a3412;
}

.leftover-age-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.must-go-item {
  border-color: rgba(124, 58, 237, .28);
  background: #faf5ff;
}

.must-go-ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
}

.must-go-add-button {
  border-radius: 8px;
  background: #ede9fe;
  color: #5b21b6;
}

.leftover-item strong,
.leftover-item span {
  display: block;
}

.leftover-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 550;
}

.leftover-item .leftover-meta-row {
  display: inline-flex;
}

.leftover-item .leftover-age-badge {
  display: inline-block;
  margin-top: 0;
}

.quick-action-list,
.quick-entry-list {
  display: grid;
  gap: 10px;
}

.quick-action-button {
  min-height: 58px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.quick-action-button strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 6px 10px;
}

.quick-entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.quick-entry-item strong,
.quick-entry-item small {
  display: block;
}

.quick-entry-item small {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 550;
}

.quick-entry-item span {
  color: #1d4ed8;
  font-weight: 800;
}

.profile-popover {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top) - 8px);
  left: 12px;
  width: min(280px, calc(100vw - 24px));
  z-index: 40;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
}

.profile-popover button,
.profile-popover a {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-weight: 550;
}

.profile-popover-group {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.profile-popover a:hover,
.profile-popover button:hover {
  background: var(--surface-soft);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, .36);
}

.bottom-sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  max-height: min(86dvh, 760px);
  overflow-y: auto;
  background: var(--app-bg);
  border-radius: 18px 18px 0 0;
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 2px auto 12px;
}

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

.header-actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 650;
}

.app-toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 80;
  background: #17212b;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 550;
  text-align: center;
  box-shadow: var(--shadow);
}

@media (max-width: 719px) {
  .landing-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-actions,
  .landing-cta {
    width: 100%;
  }

  .landing-actions a,
  .landing-cta a {
    flex: 1 1 150px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 0 18px;
  }

  .landing-preview {
    min-height: 260px;
  }

  .landing-features {
    grid-template-columns: 1fr;
  }

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

  .ingredient-editor-head,
  .ingredient-edit-row {
    grid-template-columns: 1fr;
  }

  .ingredient-editor-head {
    display: grid;
    align-items: stretch;
  }

  .ingredient-remove-button {
    width: 100%;
  }

  .task-action-row {
    grid-template-columns: 1fr;
  }

  .school-card,
  .school-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .app-shell {
    max-width: 860px;
    margin: 0 auto;
  }

  .app-header, .bottom-nav {
    left: 0;
    transform: none;
    max-width: none;
  }

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

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

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

@media (min-width: 720px) and (orientation: portrait) {
  .day-list:not(.planning) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) and (orientation: landscape) {
  .app-shell {
    max-width: 1120px;
  }

  .day-list:not(.planning) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recipe-text {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  line-height: 1.5;
}

.admin-shell {
  min-height: 100dvh;
  padding: 24px;
  background: var(--app-bg);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto 24px;
  max-width: 1120px;
}

.admin-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 650;
}

.admin-head {
  max-width: 1120px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 650;
}

.admin-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.admin-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.admin-card-media {
  min-height: 150px;
  background: #e2e8f0 center / cover no-repeat;
}

.admin-card-body {
  padding: 14px;
}

.admin-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 650;
}

.admin-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 500;
}

.admin-section {
  max-width: 1120px;
  margin: 0 auto 24px;
}

.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 650;
}

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

.admin-feedback-card {
  overflow: visible;
}

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

.admin-feedback-head strong,
.admin-feedback-head small {
  display: block;
}

.admin-feedback-head small {
  color: var(--muted);
  font-size: .86rem;
}

.feedback-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.feedback-context div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-soft);
}

.feedback-context dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.feedback-context dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: .84rem;
}

.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-actions form {
  margin: 0;
}

.admin-form,
.nutrition-table {
  max-width: 1120px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.nutrition-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-soft);
  outline: 0;
}

.admin-form .wide,
.form-actions {
  grid-column: 1 / -1;
}

.admin-checks {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--surface-soft);
}

.admin-checks legend {
  float: none;
  width: auto;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
}

.admin-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.admin-checks input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.ingredient-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.ingredient-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ingredient-editor-head strong,
.ingredient-editor-head span {
  display: block;
}

.ingredient-editor-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.ingredient-editor-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .82rem;
}

.ingredient-row-list {
  display: grid;
  gap: 10px;
}

.ingredient-edit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(90px, .55fr) minmax(90px, .55fr) minmax(150px, 1fr) 44px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ingredient-remove-button {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

.ingredient-remove-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.nutrition-table {
  display: grid;
  gap: 0;
  overflow-x: auto;
}

.nutrition-row {
  min-width: 760px;
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ingredient-row {
  min-width: 1180px;
  grid-template-columns: 1.35fr repeat(7, .5fr) .8fr 2.2fr 44px;
}

.nutrition-note {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.offer-row {
  grid-template-columns: 1.4fr 1fr 1.4fr .7fr 1.4fr 76px;
}

.compact-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.nutrition-head {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
  text-transform: uppercase;
}
