:root {
  --bg: #0b1420;
  --panel: #18283d;
  --panel-2: #243854;
  --line: #3f5e83;
  --text: #edf4ff;
  --muted: #b8c9e4;
  --accent-a: #6fa3ff;
  --accent-b: #ff7ea8;
  --accent-c: #3dd8f5;
  --accent-d: #ffc96a;
  --ok: #34d399;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 163, 255, 0.2), transparent 36%),
    radial-gradient(circle at 88% 4%, rgba(255, 126, 168, 0.16), transparent 34%),
    linear-gradient(180deg, #0f1a2a 0%, #0b1420 100%);
}

.app {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.shell-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  align-items: stretch;
}

.shell-layout.collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 8px;
  background: #111c2d;
  box-shadow: none;
  transition: width 0.18s ease, padding 0.18s ease;
}

.sidebar.collapsed {
  width: 68px;
  overflow: hidden;
  padding: 10px 6px;
}

.sidebar.collapsed .brand p,
.sidebar.collapsed .tiny-label,
.sidebar.collapsed .view-switch {
  display: none;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .brand h1 {
  font-size: 16px;
  text-align: center;
}

.sidebar.collapsed .sidebar-head {
  justify-content: center;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.sidebar-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}

.sidebar-toggle-nav {
  border: 1px dashed var(--line) !important;
  opacity: 0.95;
}

.sidebar-logout-btn {
  border-color: #a84a4a !important;
  background: rgba(168, 74, 74, 0.2) !important;
  color: #ffe9e9 !important;
}

.sidebar-logout-btn:hover {
  background: rgba(168, 74, 74, 0.3) !important;
}

.side-nav button.active {
  border-color: rgba(111, 163, 255, 0.32);
  background: rgba(111, 163, 255, 0.16);
  box-shadow: none;
}

.nav-ico {
  width: 16px;
  display: inline-flex;
  justify-content: center;
  flex: 0 0 16px;
}

.nav-label {
  white-space: nowrap;
}

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

.side-action {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.sidebar.collapsed .side-nav button,
.sidebar.collapsed .side-action {
  justify-content: center;
  padding: 8px 6px;
}

.content-area {
  min-width: 0;
  padding: 12px 16px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(63, 94, 131, 0.45);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell-scope {
  margin-bottom: 0;
}

.shell-utility {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  min-width: 38px;
  padding: 8px 10px;
}

.brand h1 { margin: 0; font-size: 26px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

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

.nav-main-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-view-switch {
  margin-bottom: 0;
}

.focus-nav-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.focus-date-chip {
  white-space: nowrap;
  min-width: 76px;
  text-align: center;
}

.nav button {
  border: 1px solid var(--line);
  background: #15243a;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.nav button.active {
  border-color: var(--accent-c);
  box-shadow: inset 0 0 0 1px rgba(31, 192, 222, 0.35);
}

.panel {
  background: linear-gradient(165deg, #1a2b42, #1a2940);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(8, 16, 28, 0.28);
  color: var(--text);
}

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

.panel h2 { margin: 0; font-size: 18px; }

.tiny { color: var(--muted); font-size: 12px; }
.tiny-label {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.focus-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(155deg, #223651, #1b2c45);
  padding: 10px;
  color: var(--text);
}

.focus-card h3 { margin: 0 0 6px; font-size: 14px; }

.btn {
  border: 1px solid var(--line);
  background: #233a59;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(160deg, #3d67a7, #31598f);
  border-color: #5f8ed0;
}

.btn.danger {
  background: #6d2b2b;
  border-color: #a84a4a;
  color: #ffe9e9;
}

.ghost {
  border: 1px solid #5a84b5;
  background: #2a4466;
  color: var(--text);
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
}

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border: 1px solid #47608d;
  background: #17233a;
  color: var(--text);
}

.pill.p1 { border-color: #5b8def; }
.pill.p2 { border-color: #ef6f9c; }
.pill.a { border-color: #1fc0de; }

.planner-wrap { overflow-x: auto; }

.week-grid {
  min-width: 1190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(168px, 1fr));
  gap: 8px;
}

.week-grid.single-day {
  min-width: 380px;
  grid-template-columns: 1fr;
}

.day {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #1d314b, #17293f);
  border-radius: 10px;
  padding: 8px;
}

.day > b { display: block; margin-bottom: 8px; }

.meal-matrix {
  min-width: 1250px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 25, 40, 0.16);
}

.meal-matrix.single-day {
  min-width: 520px;
}

.meal-matrix-row {
  display: grid;
  grid-template-columns: 90px repeat(7, minmax(160px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.meal-matrix.single-day .meal-matrix-row {
  grid-template-columns: 90px 1fr;
}

.meal-matrix-row:first-child {
  border-top: 0;
}

.meal-matrix-head {
  background: rgba(15, 25, 40, 0.24);
}

.meal-slot-label {
  padding: 8px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}

.meal-day-header {
  padding: 8px;
  border-right: 1px solid var(--line);
}

.meal-day-header:last-child {
  border-right: 0;
}

.meal-day-header.is-today {
  background: rgba(111, 163, 255, 0.14);
  box-shadow: inset 0 -2px 0 rgba(111, 163, 255, 0.55);
}

.meal-matrix-cell {
  border-right: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  min-height: 130px;
  background: transparent;
}

.meal-matrix-cell:last-child {
  border-right: 0;
}

.meal-matrix-cell.is-today {
  background: rgba(111, 163, 255, 0.06);
}

.meal-sections {
  display: grid;
  gap: 8px;
}

.meal-band {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(15, 25, 40, 0.18);
}

.meal-band-head {
  margin-bottom: 6px;
}

.meal-band-head h4 {
  margin: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
}

.meal-band-grid {
  min-width: 1190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(168px, 1fr));
  gap: 8px;
}

.meal-band-grid.single-day {
  min-width: 380px;
  grid-template-columns: 1fr;
}

.meal-day-cell {
  margin: 0;
}

.meal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slot {
  border: 1px solid #45658f;
  border-radius: 8px;
  background: #233651;
  padding: 7px;
  margin-bottom: 7px;
  color: var(--text);
}

.slot-empty {
  border-style: dashed;
  cursor: pointer;
}

.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slot h4 {
  margin: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
}

.meal {
  width: 100%;
  border: 1px solid #5a84b5;
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 6px;
  background: linear-gradient(160deg, #1f3550, #1a2d45);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.meal[draggable="true"] {
  cursor: grab;
}

.meal[draggable="true"] * {
  cursor: grab;
}

.meal[draggable="true"]:active,
.meal[draggable="true"]:active * {
  cursor: grabbing;
}

.meal-editable {
  box-shadow: inset 0 0 0 1px rgba(91, 141, 239, 0.3);
}

.meal:last-child { margin-bottom: 0; }
.meal .top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.meal .name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.meal .meta { color: var(--muted); font-size: 10px; margin-top: 3px; }

.day-focus-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.focus-chip {
  border: 1px solid var(--line);
  background: #20344e;
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.focus-chip.active {
  border-color: var(--accent-c);
  box-shadow: inset 0 0 0 1px rgba(31, 192, 222, 0.4);
}

.editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 20, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.editor-sheet {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(170deg, #1f3350, #1a2d47);
  border: 1px solid #5a7db4;
  border-radius: 12px;
  padding: 12px;
}

.ingredients-rows {
  display: grid;
  gap: 6px;
  margin: 6px 0;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6px;
}

.notice {
  border: 1px solid #42658c;
  background: #15253a;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.notice.ok {
  border-color: #2f8d71;
  color: #b8f3e2;
  background: #163329;
}

.list { margin: 0; padding-left: 18px; }
.list li { margin: 6px 0; }

.check-text {
  transition: opacity .15s ease;
}

.is-done .check-text {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  opacity: 0.82;
}

.is-done .grocery-inline {
  opacity: 0.6;
}

.done-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #2f8d71;
  background: #244234;
  color: #baf4e5;
}

.recipe-list li {
  margin: 8px 0;
  list-style: none;
}

.recipe-row { margin-left: -18px; }

.recipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.db-card {
  border: 1px solid #5a84b5;
  border-radius: 8px;
  padding: 8px;
  background: linear-gradient(160deg, #1f3550, #1a2d45);
  cursor: pointer;
}

.db-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.db-check-head {
  cursor: pointer;
}

.db-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.db-pills {
  margin: 4px 0 6px;
}

.db-meta {
  margin-top: 3px;
}

.db-inline-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.warn-pill {
  border-color: #f4b656;
  background: rgba(244, 182, 86, 0.18);
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a2f4a;
  color: var(--text);
  padding: 8px;
}

.field::placeholder {
  color: var(--muted);
  opacity: 0.95;
}

.mini-form {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr auto;
  gap: 8px;
  margin: 8px 0;
}

.tiny-select {
  width: 78px;
  display: inline-block;
  margin-left: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

.inline-adder {
  margin: 4px 0 6px;
}

.inline-adder > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.day-quick-add {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
}

.planner-cook-switch-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.planner-mode-switch-row {
  display: flex;
  justify-content: flex-start;
  margin: 6px 0 10px;
}

.planner-bulk-actions {
  margin: 0 0 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 4px 8px;
  background: rgba(15, 25, 40, 0.14);
}

.planner-bulk-actions-compact {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  border-style: solid;
  padding: 4px;
  margin-bottom: 10px;
}

.planner-bulk-actions > summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}

.planner-bulk-actions > summary::-webkit-details-marker {
  display: none;
}

.planner-bulk-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.inline-adder.compact {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(15, 25, 40, 0.2);
}

.inline-adder.compact > summary {
  margin-bottom: 0;
}

.compact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 6px;
}

.is-hidden {
  display: none !important;
}

.grocery-inline {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 6px;
  margin-top: 6px;
}

.grocery-owner {
  min-width: 104px;
}

.todo-list {
  margin: 0;
  padding: 0;
}

.todo-list > li {
  list-style: none;
}

.todo-item-card {
  border: 1px solid #5a84b5;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 6px 0;
  background: linear-gradient(160deg, #1f3550, #1a2d45);
}

.todo-item-card[draggable="true"],
.todo-item-card[draggable="true"] * {
  cursor: grab;
}

.todo-item-card[draggable="true"]:active,
.todo-item-card[draggable="true"]:active * {
  cursor: grabbing;
}

.todo-item-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.todo-editable {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.todo-editable[draggable="true"] {
  cursor: grab;
}

.drop-hover {
  box-shadow: inset 0 0 0 2px rgba(111, 163, 255, 0.6);
}

.planner-context-menu {
  position: fixed;
  z-index: 220;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(165deg, #1a2b42, #1a2940);
  box-shadow: 0 10px 24px rgba(8, 16, 28, 0.35);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.planner-context-menu button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 12px;
}

.planner-context-menu button:hover {
  background: rgba(111, 163, 255, 0.16);
  border-color: rgba(111, 163, 255, 0.3);
}

.planner-context-menu button.danger {
  color: #ffcaca;
}

.planner-context-menu button.danger:hover {
  background: rgba(168, 74, 74, 0.28);
  border-color: rgba(168, 74, 74, 0.52);
}

.todo-item-left {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.todo-item-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.todo-item-meta {
  margin-top: 4px;
}

.todo-item-owner {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 4px;
}

.recur-suggestions {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 6px;
}

.recur-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recur-chip {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cook-compact {
  display: grid;
  gap: 6px;
}

.cook-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(111, 163, 255, 0.08);
}

.cook-row-user {
  grid-template-columns: 1fr;
  gap: 4px;
}

.cook-row-user .cook-key {
  font-weight: 700;
}

.cook-row-user .cook-val {
  padding-left: 0;
}

.cook-key {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cook-val {
  font-size: 12px;
  line-height: 1.35;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  padding: 2px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 25, 40, 0.35);
}

.view-chip {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.add-kind-switch {
  margin-bottom: 4px;
}

.add-plus {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.add-plus > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--text);
  background: rgba(15, 25, 40, 0.35);
}

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

.add-plus[open] > summary {
  background: rgba(111, 163, 255, 0.22);
}

.add-plus > div {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(15, 25, 40, 0.2);
}

.view-chip.active {
  background: rgba(111, 163, 255, 0.22);
  color: var(--text);
}

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

.home-quick-grid-single {
  grid-template-columns: 1fr;
}

.home-grocery-cta-wrap {
  display: flex;
  justify-content: center;
}

.home-grocery-cta {
  max-width: 360px;
  min-height: 86px;
}

.planner-grocery-btn {
  background: linear-gradient(160deg, #00c2ff, #0f8cff);
  border-color: #6ee7ff;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 162, 255, 0.32);
}

.home-grocery-top-btn {
  white-space: nowrap;
}

.home-shop-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 25, 40, 0.18);
}

.home-shop-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-shop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grocery-item-card {
  margin-left: -18px;
}

.grocery-item-head {
  margin-bottom: 8px;
}

.grocery-item-title {
  font-size: 15px;
  line-height: 1.35;
}

.grocery-owner-pill {
  padding: 0;
  border: 0;
  background: transparent;
}

.grocery-owner-pill .pill {
  cursor: pointer;
}

.grocery-note-toggle {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(15, 25, 40, 0.14);
}

.grocery-note-toggle > summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.grocery-note-toggle > summary::-webkit-details-marker {
  display: none;
}

.grocery-status-row {
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(15, 25, 40, 0.14);
}

.daily-focus-grid {
  align-items: start;
}

.daily-day-card {
  border: 1px solid #5a84b5;
  background: linear-gradient(160deg, #1f3550, #1a2d45);
}

.daily-meta-row {
  margin-bottom: 6px;
}

.daily-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.daily-plain-list {
  margin-top: 4px;
}

.home-quick-grid .entry {
  min-height: 96px;
}

.entry.link-card {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.entry.link-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.entry.link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.entry.link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(8, 16, 28, 0.28);
}

.entry.a {
  background: linear-gradient(155deg, rgba(111, 163, 255, 0.28), rgba(79, 122, 194, 0.22));
  border-color: #5b8def;
}

.entry.b {
  background: linear-gradient(155deg, rgba(255, 126, 168, 0.24), rgba(111, 163, 255, 0.2));
  border-color: #ef6f9c;
}

.entry.c {
  background: linear-gradient(155deg, rgba(61, 216, 245, 0.24), rgba(111, 163, 255, 0.16));
  border-color: #3dd8f5;
}

body[data-theme="light"] {
  --line: #dbe6f5;
  --text: #1d2a3d;
  --muted: #5a6c88;
  background:
    radial-gradient(circle at 10% 0%, rgba(111, 163, 255, 0.18), transparent 35%),
    radial-gradient(circle at 86% 2%, rgba(255, 126, 168, 0.16), transparent 33%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
}

body[data-theme="light"] .nav button {
  background: #ffffff;
  color: #284063;
}

body[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #dbe6f5;
  box-shadow: none;
}

body[data-theme="light"] .side-nav button {
  background: transparent;
  color: #284063;
}

body[data-theme="light"] .side-nav button.active {
  background: #eaf2ff;
  border-color: #bcd2f2;
}

body[data-theme="light"] .sidebar-toggle-nav {
  border-color: #bcd2f2 !important;
}

body[data-theme="light"] .panel {
  background: #ffffff;
  border-color: #dbe6f5;
  box-shadow: 0 8px 18px rgba(38, 76, 130, 0.08);
}

body[data-theme="light"] .focus-card {
  background: #f8fbff;
  border-color: #d9e7fb;
}

body[data-theme="light"] .btn {
  background: #f0f6ff;
  color: #254267;
  border-color: #c9dbf7;
}

body[data-theme="light"] .btn.primary {
  background: linear-gradient(160deg, #5f95f2, #3f7fe0);
  border-color: #6ea2f7;
  color: #ffffff;
}

body[data-theme="light"] .ghost {
  background: #ffffff;
  color: #36557f;
  border-color: #bcd2f2;
}

body[data-theme="light"] .day {
  background: #f7faff;
  border-color: #d6e4f8;
}

body[data-theme="light"] .meal-matrix {
  background: #f9fbff;
  border-color: #d6e4f8;
}

body[data-theme="light"] .meal-matrix-head {
  background: #f2f7ff;
}

body[data-theme="light"] .meal-day-header.is-today {
  background: #eaf2ff;
  box-shadow: inset 0 -2px 0 #6ea2f7;
}

body[data-theme="light"] .meal-matrix-cell.is-today {
  background: #f6faff;
}

body[data-theme="light"] .meal-band {
  background: #f8fbff;
  border-color: #d6e4f8;
}

body[data-theme="light"] .slot {
  background: #ffffff;
  border-color: #d3e2f7;
}

body[data-theme="light"] .meal {
  background: #f3f9ff;
  border-color: #bbd6f5;
  color: #1d2f48;
}

body[data-theme="light"] .db-card {
  background: #f3f9ff;
  border-color: #bbd6f5;
  color: #1d2f48;
}

body[data-theme="light"] .focus-chip {
  background: #ffffff;
  color: #335275;
  border-color: #c5daf8;
}

body[data-theme="light"] .editor-sheet {
  background: #ffffff;
  border-color: #b6cef0;
}

body[data-theme="light"] .field {
  background: #ffffff;
  color: #213451;
  border-color: #c9daf2;
}

body[data-theme="light"] .notice {
  background: #f7fbff;
  border-color: #c7ddf8;
  color: #4b6489;
}

body[data-theme="light"] .cook-row {
  background: #f4f8ff;
  border-color: #d3e2f7;
}

body[data-theme="light"] .view-switch {
  background: #f8fbff;
  border-color: #d3e2f7;
}

body[data-theme="light"] .add-plus > summary {
  background: #f8fbff;
  border-color: #d3e2f7;
  color: #1f3550;
}

body[data-theme="light"] .add-plus[open] > summary {
  background: #dbeaff;
}

body[data-theme="light"] .add-plus > div {
  background: #f8fbff;
  border-color: #d3e2f7;
}

body[data-theme="light"] .inline-adder.compact {
  background: #f8fbff;
  border-color: #d3e2f7;
}

body[data-theme="light"] .todo-item-card {
  background: #f3f9ff;
  border-color: #bbd6f5;
}

body[data-theme="light"] .planner-context-menu {
  background: #ffffff;
  border-color: #d3e2f7;
  box-shadow: 0 10px 20px rgba(38, 76, 130, 0.14);
}

body[data-theme="light"] .planner-context-menu button {
  color: #1f3550;
}

body[data-theme="light"] .planner-context-menu button:hover {
  background: #edf4ff;
  border-color: #c8daf5;
}

body[data-theme="light"] .planner-context-menu button.danger {
  color: #9f2f2f;
}

body[data-theme="light"] .sidebar-logout-btn {
  border-color: #d98989 !important;
  background: #ffe9e9 !important;
  color: #9f2f2f !important;
}

body[data-theme="light"] .view-chip.active {
  background: #dbeaff;
  color: #1f3550;
}

body[data-theme="light"] .entry.a,
body[data-theme="light"] .focus-chip.active {
  box-shadow: inset 0 0 0 1px rgba(95, 149, 242, 0.45);
}

body[data-theme="light"] .entry.link-card {
  color: #1d2a3d;
}

body[data-theme="light"] .entry.link-card p {
  color: #4c6386;
}

body[data-theme="light"] .entry.a {
  background: linear-gradient(155deg, #e9f2ff, #e1edff);
  border-color: #9fc0f3;
}

body[data-theme="light"] .planner-grocery-btn {
  background: linear-gradient(160deg, #00b7ff, #0c7be8);
  border-color: #7fdfff;
  color: #fff;
  box-shadow: 0 8px 16px rgba(13, 130, 229, 0.22);
}

body[data-theme="light"] .home-shop-strip {
  background: rgba(255, 255, 255, 0.72);
  border-color: #c9d9ec;
}

body[data-theme="light"] .daily-day-card {
  background: #f3f9ff;
  border-color: #bbd6f5;
}

body[data-theme="light"] .entry.b {
  background: linear-gradient(155deg, #ffeaf2, #e9f4ff);
  border-color: #f4b7cb;
}

body[data-theme="light"] .entry.c {
  background: linear-gradient(155deg, #e9fbff, #e9f2ff);
  border-color: #9eddec;
}

body[data-theme="light"] .pill {
  background: #eef5ff;
  color: #1f3550;
  border-color: #bcd2f2;
}

body[data-theme="light"] .pill.p1 {
  background: #e8f1ff;
  border-color: #9fc0f3;
}

body[data-theme="light"] .pill.p2 {
  background: #ffeaf2;
  border-color: #f4b7cb;
}

body[data-theme="light"] .pill.a {
  background: #e9fbff;
  border-color: #9eddec;
}

body[data-theme="light"] .entry.b { box-shadow: inset 0 0 0 1px rgba(255, 126, 168, 0.28); }
body[data-theme="light"] .entry.c { box-shadow: inset 0 0 0 1px rgba(61, 216, 245, 0.28); }

@media (max-width: 860px) {
  .shell-layout {
    grid-template-columns: 1fr;
  }

  .shell-layout.collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar.collapsed {
    width: 100%;
    overflow: visible;
  }

  .sidebar.collapsed .brand p,
  .sidebar.collapsed .tiny-label,
  .sidebar.collapsed .view-switch,
  .sidebar.collapsed .nav-label {
    display: initial;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .mini-form {
    grid-template-columns: 1fr;
  }

  .grocery-inline {
    grid-template-columns: 1fr;
  }

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

  .home-grocery-cta {
    max-width: 100%;
    width: 100%;
  }

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

  .nav-view-switch {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .nav-view-switch .view-chip {
    min-width: 72px;
    text-align: center;
  }

  .shell-tools {
    justify-content: flex-start;
  }

  .shell-utility {
    flex-wrap: wrap;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav-view-switch {
    width: 100%;
  }

  .home-shop-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .home-shop-actions {
    width: 100%;
  }
}
