:root {
  color-scheme: light;
  --bg: #e8edf5;
  --bg-soft: #edf2f9;
  --bg-deep: #dfe6f0;
  --text: #354255;
  --text-strong: #293444;
  --muted: #66748a;
  --muted-soft: #7d8a9d;
  --accent: #647d9f;
  --accent-strong: #4f688b;
  --accent-soft: #d9e3f1;
  --on-accent: #f8fbff;
  --danger: #a95258;
  --danger-soft: #f0dadd;
  --warning: #9b6c2f;
  --shadow-dark: rgba(163, 177, 198, 0.52);
  --shadow-light: rgba(255, 255, 255, 0.92);
  --shadow-raised: 12px 12px 26px var(--shadow-dark), -12px -12px 26px var(--shadow-light);
  --shadow-raised-sm: 7px 7px 16px var(--shadow-dark), -7px -7px 16px var(--shadow-light);
  --shadow-inset: inset 7px 7px 14px rgba(163, 177, 198, 0.48), inset -7px -7px 14px rgba(255, 255, 255, 0.9);
  --shadow-inset-sm: inset 4px 4px 9px rgba(163, 177, 198, 0.44), inset -4px -4px 9px rgba(255, 255, 255, 0.9);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-body: "Roboto", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Roboto", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[hidden] {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 255, 255, 0.82), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.55), transparent 26rem),
    linear-gradient(145deg, #edf2f9 0%, #e8edf5 48%, #dfe6f0 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

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

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid rgba(100, 125, 159, 0.7);
  outline-offset: 3px;
}

::selection {
  color: var(--text-strong);
  background: rgba(100, 125, 159, 0.22);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 40;
  margin: 14px 0 0;
  background: transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 74px;
  padding: 0 18px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  box-shadow: var(--shadow-raised);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border-radius: 18px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  transition: transform 180ms ease;
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

.brand-word strong {
  display: block;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-word small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 125, 159, 0.13);
}

.save-status.is-warning {
  color: var(--danger);
}

.save-status.is-warning .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(169, 82, 88, 0.12);
}

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.header-button:hover {
  transform: translateY(-1px);
  color: var(--accent-strong);
}

.header-button:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.header-button svg {
  width: 16px;
  height: 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 42px;
  align-items: center;
  min-height: 350px;
  padding: 52px 4px 40px;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.hero h1 {
  margin: 16px 0 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(54px, 7vw, 88px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-lead {
  max-width: 540px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 700px;
  margin-top: 30px;
}

.hero-stat {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
}

.hero-stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero-stat strong.stat-money {
  color: var(--accent-strong);
  font-size: 24px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: 300px;
  place-items: center;
}

.week-preview {
  margin: 0 0 28px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  background: var(--bg);
  box-shadow: var(--shadow-raised);
}

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

.week-preview h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.week-preview-meta {
  display: grid;
  gap: 4px;
  text-align: right;
}

.week-preview-meta strong {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
}

.week-preview-meta span {
  color: var(--muted);
  font-size: 10px;
}

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

.preview-day {
  display: flex;
  min-width: 0;
  min-height: 122px;
  flex-direction: column;
  gap: 10px;
  padding: 13px 12px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  animation: rise 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.preview-day.is-today {
  background: linear-gradient(145deg, #eef4fc, #dfe7f2);
  box-shadow: inset 0 0 0 1px rgba(100, 125, 159, 0.2), var(--shadow-inset-sm);
}

.preview-day.is-past {
  opacity: 0.68;
}

.preview-day-head {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.preview-weekday {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
}

.preview-date {
  color: var(--muted);
  font-size: 10px;
}

.preview-today {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 2px 2px 5px rgba(120, 138, 160, 0.32), -2px -2px 5px rgba(255, 255, 255, 0.5);
  color: var(--on-accent);
  font-size: 8px;
  font-weight: 700;
}

.preview-meals {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.preview-meal {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-more,
.preview-empty {
  color: var(--muted-soft);
  font-size: 10px;
  line-height: 1.35;
}

.preview-cost {
  align-self: flex-start;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-note,
.art-stamp {
  display: none;
}

.plate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-raised);
  color: var(--accent-strong);
}

.plate::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: var(--shadow-inset-sm);
}

.plate::after {
  position: absolute;
  inset: 40px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 62%);
}

.plate-week,
.plate-big,
.plate-sub {
  position: relative;
  z-index: 1;
}

.plate-week {
  position: absolute;
  top: 34px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.plate-big {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
}

.plate-sub {
  position: absolute;
  bottom: 52px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.plate-sprig {
  position: absolute;
  top: 22px;
  right: 16px;
  width: 82px;
  height: 82px;
  opacity: 0.75;
  color: var(--accent);
}

.plate-sprig path {
  fill: var(--accent-soft) !important;
  stroke: var(--accent) !important;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.planner {
  min-width: 0;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--bg);
  box-shadow: var(--shadow-raised);
}

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

.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-kicker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 125, 159, 0.13);
}

.planner h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.week-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.week-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.week-arrow:hover {
  transform: translateY(-1px);
}

.week-arrow:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.week-arrow svg {
  width: 17px;
  height: 17px;
}

.week-range {
  min-width: 154px;
  padding: 7px 14px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  text-align: center;
}

.week-range strong {
  display: block;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
}

.week-range span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.today-button {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
}

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

.scroll-hint {
  display: none;
}

.planner-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
}

.day-card {
  min-width: 0;
  padding: 14px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  animation: rise 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.day-card.is-today {
  background: linear-gradient(145deg, #eef4fc, #dfe7f2);
  box-shadow: inset 0 0 0 1px rgba(100, 125, 159, 0.18), var(--shadow-raised-sm);
}

.day-card.is-past {
  opacity: 0.72;
}

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

.weekday {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.day-date {
  color: var(--muted);
  font-size: 12px;
}

.today-pill {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 3px 3px 7px rgba(120, 138, 160, 0.35), -3px -3px 7px rgba(255, 255, 255, 0.5);
}

.day-meals {
  display: grid;
  gap: 8px;
}

.meal-entry {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 12px 13px;
  border-radius: 15px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--text);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.meal-entry:hover {
  transform: translateY(-1px);
  color: var(--text-strong);
}

.meal-entry:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.meal-entry-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.meal-entry-note {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meal-entry-cost {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meal-entry.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  box-shadow: var(--shadow-inset);
  color: var(--muted);
  text-align: center;
}

.meal-entry.is-empty::before {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent);
  content: "+";
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
}

.meal-entry.is-empty:hover {
  color: var(--accent-strong);
}

.meal-entry-empty {
  font-size: 11px;
  font-weight: 600;
}

.add-meal-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
  transition: box-shadow 180ms ease, color 180ms ease;
}

.add-meal-entry:hover {
  color: var(--accent);
}

.add-meal-entry:active {
  box-shadow: var(--shadow-inset);
}

.add-meal-entry svg {
  width: 14px;
  height: 14px;
}

.side-rail {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: var(--shadow-raised);
}

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

.panel-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.count-badge {
  display: inline-grid;
  min-width: 25px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.round-add {
  display: grid;
  flex: none;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.round-add:hover {
  transform: translateY(-1px);
}

.round-add:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.round-add svg {
  width: 18px;
  height: 18px;
}

.panel-desc {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.wishlist,
.pantry-list {
  display: grid;
  gap: 10px;
}

.wish-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.wish-item:hover {
  transform: translateY(-1px);
}

.wish-item.is-scheduled {
  box-shadow: var(--shadow-inset-sm);
}

.wish-top {
  margin-bottom: 6px;
}

.planned-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 700;
}

.wish-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wish-title-row h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-pill {
  display: inline-block;
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wish-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.wish-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mini-button:hover {
  transform: translateY(-1px);
}

.mini-button:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.mini-button svg {
  width: 13px;
  height: 13px;
}

.row-action {
  display: grid;
  flex: none;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--muted);
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.row-action:hover {
  transform: translateY(-1px);
  color: var(--accent-strong);
}

.row-action:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.row-action svg {
  width: 15px;
  height: 15px;
}

.row-action.is-done {
  color: var(--accent-strong);
}

.pantry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  transition: transform 180ms ease;
}

.pantry-item:hover {
  transform: translateY(-1px);
}

.pantry-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(100, 125, 159, 0.13);
}

.pantry-copy {
  flex: 1;
  min-width: 0;
}

.pantry-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pantry-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-inset-sm);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.pantry-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.pantry-meta.is-soon {
  color: var(--warning);
}

.pantry-meta.is-expired {
  color: var(--danger);
}

.pantry-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.pantry-actions .row-action {
  width: 31px;
  height: 31px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 20px 14px;
  border-radius: 18px;
  box-shadow: var(--shadow-inset);
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}

.empty-state p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}

.empty-state button {
  margin-top: 2px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.empty-state button:hover {
  transform: translateY(-1px);
}

.empty-state button:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 28px 4px 38px;
  color: var(--muted);
  font-size: 11px;
}

.modal {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(53, 66, 85, 0.28);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: 18px 18px 42px rgba(118, 134, 155, 0.42), -12px -12px 30px rgba(255, 255, 255, 0.82);
}

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

.modal-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.modal-close {
  display: grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--muted);
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.modal-close:hover {
  transform: translateY(-1px);
  color: var(--accent-strong);
}

.modal-close:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.field {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field small {
  color: var(--muted-soft);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-radius: 15px;
  outline: 0;
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  color: var(--text);
  font-size: 14px;
  transition: box-shadow 180ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #97a3b5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: var(--shadow-inset), 0 0 0 2px rgba(100, 125, 159, 0.22);
}

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

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

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 14px;
}

.suggestion-label {
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.suggestion-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
}

.suggestion-chip:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  box-shadow: var(--shadow-inset-sm);
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.spacer {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-raised-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: none;
  box-shadow: var(--shadow-inset-sm);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: linear-gradient(145deg, #7087a7, #5c7393);
  box-shadow: 6px 6px 15px rgba(120, 138, 160, 0.5), -6px -6px 15px rgba(255, 255, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: var(--on-accent);
  text-shadow: 0 1px 0 rgba(44, 58, 76, 0.15);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-primary:active {
  box-shadow: inset 4px 4px 9px rgba(60, 76, 96, 0.35), inset -3px -3px 8px rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  color: var(--muted);
}

.btn-danger {
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(430px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  background: #3b475a;
  box-shadow: 10px 10px 26px rgba(53, 66, 85, 0.35), -6px -6px 18px rgba(255, 255, 255, 0.35);
  color: #f8fbff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.toast-message {
  font-size: 12px;
  line-height: 1.5;
}

.toast-action {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 44px;
  }

  .hero-art {
    display: none;
  }

  .hero h1 {
    font-size: clamp(52px, 9vw, 76px);
  }
}

@media (max-width: 900px) {
  .week-preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .week-grid {
    display: flex;
    gap: 12px;
    margin: 0 -2px;
    padding: 8px 2px 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .week-grid::-webkit-scrollbar {
    display: none;
  }

  .day-card {
    flex: 0 0 250px;
    scroll-snap-align: start;
  }

  .scroll-hint {
    display: block;
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 14px;
  }

  .site-header {
    top: 8px;
    margin-top: 10px;
  }

  .header-inner {
    height: 64px;
    padding: 0 12px;
    border-radius: 22px;
  }

  .save-status {
    display: none;
  }

  .header-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .header-button span {
    display: none;
  }

  .hero {
    padding: 36px 0 30px;
  }

  .hero h1 {
    font-size: clamp(48px, 13vw, 64px);
  }

  .hero-lead {
    font-size: 13.5px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 24px;
  }

  .hero-stat {
    padding: 13px 12px;
    border-radius: 16px;
  }

  .hero-stat strong {
    font-size: 26px;
  }

  .hero-stat strong.stat-money {
    font-size: 21px;
  }

  .hero-stat span {
    font-size: 9px;
  }

  .week-preview {
    margin-bottom: 18px;
    padding: 18px 14px 16px;
    border-radius: 24px;
  }

  .week-preview-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .week-preview h2 {
    font-size: 26px;
  }

  .week-preview-meta {
    text-align: left;
  }

  .planner {
    padding: 18px 14px 16px;
    border-radius: 24px;
  }

  .planner-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .planner h2 {
    font-size: 28px;
  }

  .week-controls {
    justify-content: space-between;
  }

  .week-range {
    flex: 1;
    min-width: 0;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .panel h2 {
    font-size: 22px;
  }

  .side-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 24px 2px 30px;
  }
}

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

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-word strong {
    font-size: 18px;
  }

  .brand-word small {
    font-size: 7px;
  }

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

  .preview-day {
    min-height: 106px;
    padding: 11px 10px;
  }

  .day-card {
    flex-basis: min(78vw, 260px);
    padding: 13px 11px;
  }

  .meal-entry.is-empty {
    min-height: 138px;
  }

  .modal {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 20px 16px;
    border-radius: 24px;
  }

  .modal h2 {
    font-size: 23px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .modal-actions .btn-danger {
    width: 100%;
    justify-content: flex-start;
  }

  .spacer {
    display: none;
  }

  .modal-actions .btn:not(.btn-danger) {
    flex: 1;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
