:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #101a28;
  --panel-2: #172335;
  --text: #f7fbff;
  --muted: #b8c7dc;
  --line: #2c3d55;
  --accent: #f1cc4d;
  --accent-2: #ff7a5c;
  --teal-action: #6ee4dd;
  --teal-action-muted: #9fdedb;
  --button-ink: #050b12;
  --sticker-edge: #f7fbff;
  --button-neutral: #172335;
  --button-shadow: rgba(8, 127, 143, 0.34);
  --topbar-bg: #091527;
  --ok: #8ed67b;
  --bg-glow-1: rgba(25, 183, 173, 0.18);
  --bg-glow-2: rgba(241, 204, 77, 0.1);
  --shadow: 0 22px 62px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf6ef;
  --panel: #fffaf2;
  --panel-2: #f1e7d8;
  --text: #201914;
  --muted: #66584b;
  --line: #dacdbd;
  --accent: #c48a19;
  --accent-2: #ca4d35;
  --teal-action: #087f8f;
  --teal-action-muted: #064f5d;
  --button-ink: #201914;
  --sticker-edge: #fff7e8;
  --button-neutral: #fffaf2;
  --button-shadow: rgba(8, 127, 143, 0.22);
  --topbar-bg: #fffaf2;
  --ok: #3f7f42;
  --bg-glow-1: rgba(240, 207, 84, 0.12);
  --bg-glow-2: rgba(0, 0, 0, 0);
  --shadow: 0 18px 44px rgba(75, 53, 33, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 0 0, var(--bg-glow-1), transparent 27rem),
    radial-gradient(circle at 88% 10%, var(--bg-glow-2), transparent 24rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: var(--topbar-bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 62px;
  flex: 0 0 auto;
  border: 5px solid #191411;
  border-radius: 18px 14px 20px 15px / 15px 20px 13px 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.5) 0 14%, transparent 15%),
    linear-gradient(180deg, #6ee4dd 0%, #19b7ad 58%, #087f8f 100%);
  color: #191411;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-4.5deg) skewX(-1deg);
  outline: 3px solid #fff7e8;
  box-shadow: 6px 6px 0 #f5ad18, 0 0 0 1px rgba(25, 20, 17, 0.22), 0 7px 14px rgba(0, 0, 0, 0.2);
  isolation: isolate;
}

.brand-mark span {
  display: block;
  transform: rotate(2.5deg) skewX(1deg) translateY(-1px);
  font-family: "Arial Black", "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.01em;
  paint-order: stroke fill;
  -webkit-text-stroke: 0.4px #191411;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
  z-index: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  line-height: 1.15;
}

.brand small {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.22;
  margin-top: 2px;
  opacity: 0.9;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--teal-action) 8%, var(--button-neutral));
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
  overflow: hidden;
}

.theme-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  min-width: 64px;
  height: 74px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: #201914;
  overflow: visible;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.bulb-icon {
  width: 62px;
  height: 71px;
  display: block;
  filter: drop-shadow(0 4px 0 rgba(32, 25, 20, 0.15));
}

.bulb-glow {
  fill: #ffe9a8;
  stroke: #201914;
  stroke-width: 4;
  stroke-linejoin: round;
}

.bulb-neck-shape {
  fill: #f7d889;
  stroke: #201914;
  stroke-width: 4;
}

.bulb-base-shape {
  fill: #e6ded1;
  stroke: #201914;
  stroke-width: 4;
  stroke-linejoin: round;
}

.bulb-ridge {
  fill: none;
  stroke: #7c6f62;
  stroke-width: 3;
  stroke-linecap: round;
}

.theme-word {
  position: absolute;
  top: 30px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 14px;
  transform: translate(-50%, -50%);
  color: #201914;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hero {
  min-height: clamp(560px, 78vh, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 450px);
  align-items: start;
  gap: 32px;
  padding: 24px 0 20px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.7rem, 6.7vw, 6.2rem);
  line-height: 0.96;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.h1-intro {
  max-width: none;
}

.h1-roll {
  margin-top: 0.05em;
}

.hero-copy h1 .nowrap {
  display: inline;
  white-space: nowrap;
}

.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

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

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px 11px;
  border: 0;
  border-radius: 15px 18px 14px 17px;
  outline: 0;
  background: linear-gradient(180deg, #ffd960 0%, var(--accent) 78%);
  color: #251b13;
  box-shadow: none;
  font-family: "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.16rem, 4.9vw, 1.52rem);
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  transform: rotate(-1deg);
  align-self: center;
  cursor: default;
  pointer-events: none;
}

.hero-art {
  align-self: start;
  display: flex;
  align-items: start;
  justify-content: center;
}

.sam-art-wrap {
  position: relative;
  width: min(100%, 470px);
  max-height: 720px;
}

.hero-art img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.28));
}

.sam-bubble-copy {
  position: absolute;
  top: clamp(32px, 8.8%, 54px);
  left: 49%;
  width: min(60%, 270px);
  margin: 0;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #201914;
  box-shadow: none;
  box-sizing: border-box;
  font-size: clamp(1.12rem, 2.05vw, 1.42rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.sam-bubble-copy span {
  display: block;
  padding: 3px 8px;
  box-sizing: border-box;
}

.energy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.energy-card,
.recipe-card,
.week-slot,
.compact-item,
.check-item,
.decision-panel,
.section,
.dialog-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.energy-card {
  position: relative;
  min-height: 178px;
  padding: 20px 18px;
  border: 3px solid var(--button-ink);
  border-radius: 18px 15px 20px 16px / 16px 20px 15px 18px;
  outline: 0;
  box-shadow: 5px 5px 0 var(--button-shadow), var(--shadow);
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.energy-card::before,
.decision-actions .primary::before,
.decision-actions .secondary::before {
  content: "";
  position: absolute;
  inset: 5px 8px auto;
  height: 34%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.energy-label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  margin-bottom: 16px;
  font-size: clamp(1.34rem, 3.8vw, 1.58rem);
  font-weight: 900;
  line-height: 1.1;
  max-width: 100%;
}

.energy-label > span {
  display: block;
  min-width: 0;
}

.energy-label-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  overflow: visible;
  vertical-align: -0.2em;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.16));
}

.energy-label-icon-large {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  vertical-align: -0.42em;
}

.energy-raster-icon {
  object-fit: contain;
}

.energy-kicking-icon {
  width: 86px;
  height: 68px;
  flex-basis: 86px;
}

.energy-label-icon * {
  vector-effect: non-scaling-stroke;
}

.skull-bone {
  fill: none;
  stroke: #191411;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skull-bone {
  stroke: #fff7e8;
  filter: drop-shadow(0.8px 0.8px 0 #191411);
}

.skull-head {
  fill: #fff7e8;
  stroke: #191411;
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.skull-eye {
  fill: #191411;
}

.skull-nose {
  fill: #191411;
  stroke: #191411;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.energy-card small {
  display: block;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.energy-card.is-active {
  border-color: var(--button-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%),
    color-mix(in srgb, var(--teal-action) 34%, var(--panel));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--teal-action) 72%, transparent),
    6px 6px 0 color-mix(in srgb, var(--teal-action) 74%, var(--button-shadow)),
    var(--shadow);
}

.energy-card.is-active .energy-label::after {
  content: "✓";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 2px solid var(--button-ink);
  border-radius: 999px;
  background: var(--button-ink);
  color: var(--sticker-edge);
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.decision-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 8px;
}

.decision-mascot {
  flex: 0 0 auto;
  width: clamp(190px, 18vw, 220px);
  height: clamp(190px, 18vw, 220px);
  object-fit: contain;
  align-self: center;
  background: transparent;
}

.decision-panel h2,
.section h2 {
  margin: 0;
  letter-spacing: 0;
}

.decision-panel p:not(.eyebrow),
.muted,
.shopping-summary {
  color: var(--muted);
  line-height: 1.5;
}

.shopping-summary {
  margin: 0 0 10px;
  font-weight: 850;
}

.decision-actions,
.dialog-actions,
.plan-row,
.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary,
.secondary {
  position: relative;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: 0;
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: none;
  overflow: hidden;
}

.primary {
  background: var(--accent);
  color: #191411;
}

.secondary {
  background: color-mix(in srgb, var(--teal-action) 8%, var(--button-neutral));
  color: var(--text);
}

.decision-actions .primary,
.decision-actions .secondary {
  border: 3px solid var(--button-ink);
  border-radius: 16px 13px 17px 14px / 14px 17px 13px 16px;
  outline: 0;
  box-shadow: 4px 4px 0 var(--button-shadow);
}

.decision-actions .primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 44%),
    var(--accent);
  color: #191411;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent-2) 56%, var(--button-shadow));
}

.decision-actions .secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 44%),
    color-mix(in srgb, var(--teal-action) 8%, var(--button-neutral));
  color: var(--text);
}

.decision-actions .tertiary {
  border-color: var(--button-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 44%),
    color-mix(in srgb, var(--teal-action) 10%, var(--panel-2));
  color: var(--teal-action-muted);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--teal-action) 50%, var(--button-shadow));
}

.decision-actions .tertiary:hover,
.decision-actions .tertiary:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 44%),
    color-mix(in srgb, var(--teal-action) 16%, var(--panel-2));
  color: var(--text);
}

.tabs {
  position: sticky;
  top: 90px;
  z-index: 4;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0;
  background: var(--topbar-bg);
}

.tabs a {
  position: relative;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: 0;
  padding: 9px 15px;
  color: var(--text);
  text-decoration: none;
  background: color-mix(in srgb, var(--teal-action) 10%, var(--button-neutral));
  box-shadow: none;
  font-weight: 900;
  overflow: hidden;
}

.section {
  margin: 18px 0;
  padding: 22px;
  border-radius: 8px;
  scroll-margin-top: 158px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.count-pill {
  flex: 0 0 auto;
  color: #191411;
  background: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px) minmax(130px, 180px);
  gap: 12px;
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
}

select {
  border: 2px solid var(--line);
  outline: 0;
  background: color-mix(in srgb, var(--teal-action) 8%, var(--panel-2));
  box-shadow: none;
  font-weight: 850;
}

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

.recipe-card {
  min-height: 196px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 8px;
  padding: 16px;
}

.recipe-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

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

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.recipe-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card-actions button {
  flex: 1 1 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

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

.shopping-section {
  max-width: 920px;
}

.shopping-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 300px);
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
}

.section-mascot {
  display: block;
  width: 100%;
  max-width: 300px;
  justify-self: center;
  object-fit: contain;
  background: transparent;
}

.shopping-mascot {
  max-width: 310px;
  max-height: 250px;
}

.shopping-list {
  margin: 0 0 16px;
}

.shopping-section .add-row {
  margin: 14px 0 12px;
}

.shopping-section #clearCheckedButton {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

.compact-item,
.check-item {
  border-radius: 8px;
  padding: 12px;
}

.compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.week-slot {
  min-height: 148px;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.week-slot:hover,
.week-slot:focus-visible {
  border-color: var(--teal-action);
  background: color-mix(in srgb, var(--teal-action) 10%, var(--panel));
  outline: 0;
  transform: translateY(-1px);
}

.week-slot strong {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
}

.slot-recipe {
  color: var(--text);
  font-weight: 850;
  line-height: 1.35;
}

.slot-empty {
  color: var(--muted);
  line-height: 1.45;
}

.slot-hint {
  display: block;
  margin-top: 10px;
  color: var(--teal-action-muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.week-slot .secondary {
  margin-top: 10px;
  width: 100%;
}

.check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  box-shadow: none;
}

.check-item input {
  width: 22px;
  min-height: 22px;
}

.check-item span {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
}

.check-item.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.help {
  display: grid;
  grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.help img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: transparent;
}

dialog {
  width: min(680px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
}

.dialog-card {
  position: relative;
  border-radius: 8px;
  padding: 24px;
}

.dialog-card .close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.dialog-card h2 {
  max-width: calc(100% - 50px);
  margin: 0 0 12px;
}

.dialog-card h3 {
  margin: 20px 0 6px;
}

.week-dialog-card {
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
}

.week-search {
  display: block;
  margin: 14px 0;
}

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

.week-choice {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--teal-action) 7%, var(--button-neutral));
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.week-choice:hover,
.week-choice:focus-visible {
  border-color: var(--teal-action);
  outline: 0;
  background: color-mix(in srgb, var(--teal-action) 14%, var(--button-neutral));
}

.week-choice span {
  font-weight: 900;
  line-height: 1.25;
}

.week-choice small {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--ok);
  font-size: 0.98rem;
  font-weight: 850;
}

.feedback p {
  margin: 0 0 10px;
}

.feedback .secondary {
  color: var(--text);
}

.section:focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .hero,
  .split,
  .help {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(1.6rem, 8.9vw, 3.05rem);
    line-height: 1;
    text-align: center;
    order: 2;
  }

  .hero-copy .eyebrow {
    order: 1;
  }

  .hero-eyebrow {
    align-self: center;
  }

  .hero-text {
    order: 3;
  }

  .hero-art {
    order: 4;
  }

  .energy-grid {
    order: 5;
  }

  .hero-art {
    max-height: none;
    overflow: visible;
  }

  .sam-art-wrap,
  .hero-art img {
    max-height: 420px;
  }

  .sam-bubble-copy {
    top: 12px;
    left: 49%;
    width: min(220px, 59%);
    transform: translateX(-50%);
    padding: 0;
    font-size: 1.12rem;
    line-height: 1;
  }

  .energy-grid,
  .recipe-list,
  .filters,
  .week-grid,
  .shopping-layout {
    grid-template-columns: 1fr;
  }

  .decision-panel,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-mascot {
    width: min(100%, 190px);
    height: 190px;
    align-self: start;
  }

  .section-mascot {
    max-width: min(100%, 270px);
  }

  .shopping-mascot {
    max-height: 230px;
  }

  .help-mascot {
    max-height: 280px;
  }

  .decision-actions .primary,
  .decision-actions .secondary {
    flex: 1 1 160px;
  }

  .tabs {
    top: 88px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 72px;
    height: 58px;
  }

  .brand-mark span {
    font-size: 1.08rem;
  }

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

  .brand small {
    max-width: 190px;
    font-size: 1rem;
  }

  .theme-button {
    margin-right: 10px;
  }

  .hero-copy h1 {
    font-size: clamp(1.6rem, 8.9vw, 2.6rem);
    line-height: 1.04;
    text-align: center;
  }

  .section,
  .decision-panel {
    padding: 16px;
  }

  .compact-item,
  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .shopping-section #clearCheckedButton {
    width: 100%;
  }
}

/* ==================================================================
   Added 2026-08-03: home-screen install banner, backup, site footer
   ================================================================== */

.install-banner {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: start;
  gap: 14px;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

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

.install-sam {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
}

.install-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
}

.install-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.88rem;
}

.install-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-actions button { white-space: nowrap; }

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
}

.site-footer {
  margin: 34px 0 8px;
  padding: 26px 22px 18px;
  border-top: 2px solid var(--line);
}

.footer-main h2 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.2;
}

.footer-main .muted { margin: 0 0 18px; max-width: 62ch; }

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-fine {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-fine a { color: var(--text); }

@media (max-width: 760px) {
  .install-banner {
    grid-template-columns: 48px 1fr;
    gap: 12px;
    padding: 14px;
  }

  .install-sam { width: 44px; height: 44px; }

  .install-actions button { min-height: 42px; padding: 8px 12px; }

  .install-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .install-actions button { flex: 1 1 auto; }

  .backup-actions button,
  .footer-actions > * { flex: 1 1 100%; }
}
