/* =========================================================
   凑狗厨房 · 一周食谱
   Warm editorial meal planner
   ========================================================= */

:root {
  --paper: #f4eee2;
  --paper-deep: #ebe2d2;
  --card: #fffcf6;
  --card-warm: #fbf6ec;
  --ink: #292a22;
  --ink-soft: #505146;
  --muted: #6f695e;
  --faint: #746e63;
  --line: #e2dacb;
  --line-strong: #d2c7b5;
  --tomato: #d86446;
  --tomato-deep: #b64b31;
  --tomato-soft: #f5dfd6;
  --sage: #77866a;
  --sage-deep: #52624b;
  --sage-soft: #e7ecdf;
  --gold: #c89738;
  --plum: #8c7185;
  --dark: #282b23;
  --dark-2: #303329;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Avenir", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max: 1500px;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 18px 36px -34px rgba(54, 44, 28, 0.42);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse at 8% -6%, rgba(216, 100, 70, 0.13), transparent 38%),
    radial-gradient(ellipse at 96% 2%, rgba(119, 134, 106, 0.15), transparent 34%),
    linear-gradient(180deg, #f6f0e4 0%, #f2ebdd 54%, #f6f0e5 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(216, 100, 70, 0.24);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.shell {
  width: min(calc(100% - 64px), var(--max));
  margin-inline: auto;
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 240, 230, 0.82);
  border-bottom: 1px solid rgba(210, 199, 181, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}

.header-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  border-radius: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 13.5px;
  box-shadow: 0 8px 18px -10px rgba(159, 68, 45, 0.62);
  transition: transform 240ms var(--ease-out);
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.035);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.065em;
}

.brand-en {
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: 0.235em;
}

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

.pill-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.62);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms var(--ease-out);
}

.pill-button:hover {
  border-color: #bfb29d;
  background: var(--card);
  color: var(--ink);
  transform: translateY(-1px);
}

.pill-button .icon {
  width: 15px;
  height: 15px;
  color: var(--sage-deep);
}

.pill-button strong {
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.pill-unit {
  margin-left: -2px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(370px, 0.78fr);
  align-items: end;
  gap: clamp(36px, 5vw, 76px);
  padding: 54px 0 46px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding-bottom: 5px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.eyebrow-dash {
  width: 34px;
  height: 1px;
  background: var(--tomato);
}

.hero h1 {
  max-width: 740px;
  margin: 18px 0 21px;
  font-family: var(--serif);
  font-size: clamp(46px, 4.7vw, 69px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-accent {
  position: relative;
  display: inline-block;
  color: var(--tomato);
}

.hero-accent::after {
  content: "";
  position: absolute;
  left: 1%;
  right: -1%;
  bottom: -10px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M4 9C62 3 118 3 170 7c40 3 78 3 126-1' fill='none' stroke='%23d86446' stroke-width='3.2' stroke-linecap='round' opacity='.44'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.hero-lede {
  max-width: 475px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.week-chip {
  padding: 5px 9px;
  border: 1px solid rgba(119, 134, 106, 0.2);
  border-radius: 6px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.meta-divider {
  width: 1px;
  height: 11px;
  background: var(--line-strong);
}

.hero-watermark {
  position: absolute;
  right: 15%;
  bottom: -62px;
  z-index: -1;
  color: rgba(60, 55, 40, 0.035);
  font-family: var(--serif);
  font-size: 178px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* =========================================================
   Weekly summary
   ========================================================= */

.summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 338px;
  overflow: hidden;
  padding: 23px 23px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 27px;
  background:
    radial-gradient(circle at 100% 0%, rgba(137, 153, 118, 0.18), transparent 45%),
    linear-gradient(148deg, #30342a 0%, #262a21 58%, #2b3025 100%);
  box-shadow:
    0 30px 55px -34px rgba(32, 34, 24, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f4eedf;
}

.summary-deco {
  position: absolute;
  top: -116px;
  right: -95px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(244, 238, 223, 0.085);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(244, 238, 223, 0.022),
    0 0 0 58px rgba(244, 238, 223, 0.014);
  pointer-events: none;
}

.summary-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-kicker {
  color: rgba(244, 238, 223, 0.58);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
}

.summary-head h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.summary-target {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(244, 238, 223, 0.18);
  border-radius: 999px;
  background: rgba(244, 238, 223, 0.055);
  color: rgba(244, 238, 223, 0.7);
  font-size: 8.5px;
  line-height: 1.35;
  white-space: nowrap;
}

.summary-target strong {
  color: #f7f1e4;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-target span {
  opacity: 0.62;
}

.summary-label {
  margin-top: 21px;
  color: rgba(244, 238, 223, 0.65);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.summary-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 1px;
}

.summary-total strong {
  color: #fff9eb;
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.summary-total span {
  color: rgba(244, 238, 223, 0.46);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.summary-compare {
  min-height: 15px;
  margin-top: 7px;
  color: rgba(244, 238, 223, 0.72);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.week-chart {
  margin-top: 8px;
}

.chart-grid {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 67px;
}

.chart-target-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  border-top: 1px dashed rgba(244, 238, 223, 0.21);
  pointer-events: none;
}

.chart-target-line::after {
  content: "目标";
  position: absolute;
  top: -12px;
  right: 0;
  color: rgba(244, 238, 223, 0.3);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.chart-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 50px;
}

.chart-bar {
  width: min(16px, 72%);
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: rgba(201, 213, 185, 0.22);
  transition:
    height 420ms var(--ease-out),
    background 200ms ease;
}

.chart-bar.has-data {
  background: #c7d2b7;
}

.chart-bar.is-over {
  background: #dd8769;
}

.chart-col.is-today .chart-bar {
  box-shadow: 0 0 0 1px rgba(255, 249, 235, 0.28);
}

.chart-day {
  color: rgba(244, 238, 223, 0.58);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.chart-col.is-today .chart-day {
  color: #f8f1e1;
  font-weight: 600;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: auto -23px 0;
  padding: 13px 23px 15px;
  border-top: 1px solid rgba(244, 238, 223, 0.105);
}

.summary-stat + .summary-stat {
  padding-left: 18px;
  border-left: 1px solid rgba(244, 238, 223, 0.105);
}

.summary-stat span {
  display: block;
  margin-bottom: 2px;
  color: rgba(244, 238, 223, 0.62);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.summary-stat strong {
  color: #f6f0e2;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.summary-stat strong span {
  display: inline;
  margin-left: 2px;
  color: rgba(244, 238, 223, 0.62);
  font-size: 8px;
  font-weight: 400;
}

/* =========================================================
   Planner heading
   ========================================================= */

.planner {
  padding-bottom: 24px;
}

.planner-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.25em;
}

.section-kicker span {
  width: 16px;
  height: 1px;
  background: var(--tomato);
}

.planner-heading h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.025em;
}

.planner-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.planner-sub span {
  color: var(--tomato);
  font-weight: 700;
}

.print-meta {
  display: none;
}

.week-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.icon-button:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.icon-button .icon {
  width: 15px;
  height: 15px;
}

.week-range-wrap {
  min-width: 174px;
  padding: 0 12px;
  text-align: center;
}

.week-range {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.week-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

.today-button {
  margin-left: 3px;
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 999px 999px 0;
  background: transparent;
  color: var(--tomato);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms ease;
}

.today-button:hover {
  background: var(--tomato-soft);
}

/* =========================================================
   Demo banner
   ========================================================= */

.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
  padding: 9px 11px 9px 13px;
  border: 1px solid #e3d4b8;
  border-radius: 12px;
  background: rgba(249, 240, 220, 0.72);
  color: #71603f;
  font-size: 10px;
}

.demo-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(200, 151, 56, 0.13);
  color: #a2762a;
}

.demo-icon .icon {
  width: 14px;
  height: 14px;
}

.demo-banner p {
  flex: 1;
  line-height: 1.55;
}

.demo-action {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(140, 92, 52, 0.35);
  background: transparent;
  color: #8c5c34;
  font-size: 9.5px;
  white-space: nowrap;
  cursor: pointer;
}

.demo-action:hover {
  color: var(--tomato-deep);
  border-bottom-color: var(--tomato-deep);
}

.demo-dismiss {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9a8b6d;
  cursor: pointer;
}

.demo-dismiss:hover {
  background: rgba(129, 109, 76, 0.1);
  color: #6c5b3c;
}

.demo-dismiss .icon {
  width: 12px;
  height: 12px;
}

.mobile-hint {
  display: none;
}

/* =========================================================
   Week board
   ========================================================= */

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-top: 17px;
}

.day-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.99) 0%, rgba(252, 247, 237, 0.98) 100%);
  box-shadow: var(--shadow-card);
  transition:
    border-color 200ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--ease-out);
}

.day-card:hover {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 38px -34px rgba(54, 44, 28, 0.45);
  transform: translateY(-1px);
}

.day-card.is-today {
  border-color: #d9947f;
  box-shadow:
    0 0 0 1px rgba(216, 100, 70, 0.14),
    0 22px 40px -34px rgba(128, 66, 43, 0.4);
}

.day-card.is-today::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--tomato), #e3a05f);
}

.day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px;
}

.day-weekday {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.025em;
}

.day-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
  letter-spacing: 0.075em;
  font-variant-numeric: tabular-nums;
}

.today-pill {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 99px;
  background: var(--tomato);
  color: #fff8ed;
  font-size: 7.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.06em;
}

.day-index {
  padding-top: 2px;
  color: var(--faint);
  font-size: 7.5px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.day-meals {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0 9px 4px;
}

.meal {
  min-height: 76px;
  padding: 9px 3px;
  border-top: 1px dashed #e9e1d4;
}

.meal:first-child {
  padding-top: 2px;
  border-top: 0;
}

.meal-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.meal-badge {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
}

.meal[data-meal="breakfast"] .meal-badge {
  background: #f6ead1;
  color: #9b6c23;
}

.meal[data-meal="lunch"] .meal-badge {
  background: #e8eedf;
  color: #5d7254;
}

.meal[data-meal="dinner"] .meal-badge {
  background: #f6e1d9;
  color: #b4563d;
}

.meal[data-meal="snack"] .meal-badge {
  background: #ede5ed;
  color: #81657c;
}

.meal-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.meal-total {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.meal-add {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 1px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.meal-add:hover {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--tomato);
}

.meal-add .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.food-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.food-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 4px 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.food-item:hover {
  background: #f3ecdf;
  color: var(--ink);
}

.food-dot {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c7bdaa;
  transition: background 150ms ease;
}

.food-item:hover .food-dot {
  background: var(--tomato);
}

.food-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-kcal {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.food-item:hover .food-kcal {
  color: var(--ink-soft);
}

.empty-meal {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 5px 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  font-family: inherit;
  font-size: 8.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.empty-meal:hover {
  background: #f3ecdf;
  color: var(--tomato);
}

.empty-meal .icon {
  width: 9px;
  height: 9px;
}

.day-foot {
  margin-top: auto;
  padding: 10px 12px 11px;
  border-top: 1px solid #e9e1d3;
  background: rgba(246, 239, 226, 0.54);
}

.day-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.day-total-label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.day-total {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.day-total span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.day-card.is-over .day-total {
  color: var(--tomato-deep);
}

.progress-track {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7dece;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
  transition:
    width 400ms var(--ease-out),
    background 200ms ease;
}

.day-card.is-over .progress-fill {
  background: var(--tomato);
}

.day-status {
  min-height: 12px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.day-card.is-over .day-status {
  color: #b45d44;
}

/* =========================================================
   Planner footer & site footer
   ========================================================= */

.planner-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.planner-foot p {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9px;
}

.planner-foot .icon {
  width: 13px;
  height: 13px;
}

.text-button {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: rgba(129, 125, 113, 0.45);
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.text-button:hover {
  color: var(--tomato);
  text-decoration-color: var(--tomato);
}

.site-footer {
  margin-top: 12px;
  border-top: 1px solid rgba(210, 199, 181, 0.62);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 0 29px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.045em;
}

.footer-inner p:last-child {
  letter-spacing: 0.14em;
}

/* =========================================================
   Modals
   ========================================================= */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(35, 32, 25, 0.48);
  opacity: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 220ms ease;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 32px 90px -24px rgba(42, 34, 22, 0.58);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition:
    opacity 220ms ease,
    transform 280ms var(--ease-out);
}

.modal::-webkit-scrollbar {
  width: 7px;
}

.modal::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line-strong);
}

.modal-layer.is-open .modal-scrim {
  opacity: 1;
}

.modal-layer.is-open .modal {
  opacity: 1;
  transform: none;
}

.modal-small {
  width: min(100%, 424px);
}

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

.modal-kicker {
  color: var(--tomato);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.modal-head h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.015em;
}

.modal-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.modal-close:hover {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.modal-close .icon {
  width: 14px;
  height: 14px;
}

.modal-copy {
  margin: -3px 0 20px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.form-group {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.form-group > label,
.meal-fieldset legend,
.field-label-row label {
  display: block;
  margin-bottom: 7px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.015em;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row span {
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 400;
}

.text-input,
.number-wrap {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffdf8;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.text-input {
  padding: 0 13px;
  color: var(--ink);
  font-size: 13px;
}

.text-input::placeholder {
  color: #b7afa1;
}

.text-input:hover,
.number-wrap:hover {
  border-color: #bfb29d;
}

.text-input:focus,
.number-wrap:focus-within {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 3px rgba(216, 100, 70, 0.12);
}

.number-wrap {
  display: flex;
  align-items: center;
  padding-right: 13px;
}

.number-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.number-wrap input:focus {
  outline: none;
}

.number-wrap > span {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.meal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #f4ede1;
}

.meal-tab {
  position: relative;
  cursor: pointer;
}

.meal-tab input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.meal-tab span {
  display: block;
  padding: 9px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.meal-tab input:checked + span {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 2px 7px rgba(68, 54, 34, 0.08);
  color: var(--ink);
  font-weight: 600;
}

.meal-tab input:focus-visible + span {
  outline: 2px solid var(--tomato);
  outline-offset: 1px;
}

.target-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

.target-presets button {
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbf6ec;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.target-presets button:hover {
  border-color: #c9a98e;
  background: #f7ecdd;
}

.target-presets button.is-active {
  border-color: var(--tomato);
  background: var(--tomato-soft);
  color: var(--tomato-deep);
  font-weight: 600;
}

.form-error {
  margin: -2px 0 14px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f9e5de;
  color: #a3422c;
  font-size: 9.5px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.actions-spacer {
  flex: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--ink);
  color: #fbf5e8;
}

.button-primary:hover {
  background: #3a3b30;
}

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.button-quiet:hover {
  background: #f4ede1;
}

.button-danger {
  background: var(--tomato);
  color: #fff8ed;
}

.button-danger:hover {
  background: var(--tomato-deep);
}

.delete-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #a85239;
  font-size: 9.5px;
  cursor: pointer;
}

.delete-button:hover {
  color: var(--tomato-deep);
}

.delete-button .icon {
  width: 12px;
  height: 12px;
}

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 18px 36px -14px rgba(32, 28, 20, 0.5);
  color: #fbf4e6;
  font-size: 10.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 220ms ease,
    transform 260ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tomato);
}

/* =========================================================
   Motion
   ========================================================= */

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.hero-copy {
  animation: reveal-up 700ms var(--ease-out) both;
}

.summary-card {
  animation: reveal-up 760ms 80ms var(--ease-out) both;
}

.week-board.animate-in .day-card {
  animation: card-in 440ms var(--ease-out) both;
  animation-delay: calc(var(--index, 0) * 42ms + 100ms);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1220px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 38px;
  }

  .hero h1 {
    font-size: clamp(44px, 4.5vw, 60px);
  }

  .week-board {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-padding-inline: 1px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #d2c6b3 transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .week-board::-webkit-scrollbar {
    height: 6px;
  }

  .week-board::-webkit-scrollbar-track {
    background: transparent;
  }

  .week-board::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #d2c6b3;
  }

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

  .mobile-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    color: var(--faint);
    font-size: 8.5px;
  }

  .mobile-hint .icon {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 27px;
    padding: 43px 0 36px;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .hero h1 {
    font-size: clamp(46px, 6.7vw, 66px);
  }

  .hero-lede {
    max-width: 550px;
  }

  .summary-card {
    min-height: 0;
    padding: 22px 24px 0;
  }

  .summary-label {
    margin-top: 17px;
  }

  .summary-total strong {
    font-size: 50px;
  }

  .summary-stats {
    margin-inline: -24px;
    padding-inline: 24px;
  }

  .planner-head {
    align-items: center;
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 28px);
  }

  .header-inner {
    height: 66px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-en {
    font-size: 6.5px;
  }

  .header-actions {
    gap: 5px;
  }

  .pill-button {
    height: 35px;
    padding: 0 10px;
    font-size: 10px;
  }

  .pill-button .pill-label,
  .pill-unit {
    display: none;
  }

  .pill-button strong {
    font-size: 11.5px;
  }

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

  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  .hero h1 {
    margin: 15px 0 18px;
    font-size: clamp(41px, 12vw, 56px);
    letter-spacing: -0.04em;
  }

  .hero-accent::after {
    bottom: -7px;
    height: 9px;
  }

  .hero-lede {
    font-size: 12px;
    line-height: 1.8;
  }

  .hero-meta {
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 19px;
    font-size: 9.5px;
  }

  .hero-watermark {
    right: 3%;
    bottom: -34px;
    font-size: 120px;
  }

  .summary-card {
    padding: 20px 20px 0;
    border-radius: 22px;
  }

  .summary-total strong {
    font-size: 45px;
  }

  .summary-stats {
    margin-inline: -20px;
    padding: 12px 20px 14px;
  }

  .summary-stat + .summary-stat {
    padding-left: 15px;
  }

  .planner-head {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding-top: 21px;
  }

  .planner-heading h2 {
    font-size: 27px;
  }

  .planner-sub {
    display: none;
  }

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

  .week-range-wrap {
    flex: 1;
    min-width: 0;
    padding: 0 3px;
  }

  .week-range {
    font-size: 10.5px;
  }

  .today-button {
    padding-inline: 9px;
    font-size: 9px;
  }

  .demo-banner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 9px 9px 11px;
    font-size: 9.5px;
  }

  .demo-banner p {
    flex-basis: calc(100% - 35px);
  }

  .demo-action {
    margin-left: 30px;
    font-size: 9px;
  }

  .demo-dismiss {
    margin-left: auto;
  }

  .week-board {
    gap: 9px;
    margin-top: 14px;
  }

  .day-card {
    flex-basis: min(78vw, 275px);
    border-radius: 15px;
  }

  .day-head {
    padding: 13px 13px 9px;
  }

  .day-weekday {
    font-size: 19px;
  }

  .day-date {
    font-size: 9.5px;
  }

  .day-meals {
    padding-inline: 10px;
  }

  .meal {
    min-height: 78px;
  }

  .food-item {
    padding-block: 5px;
    font-size: 11px;
  }

  .food-kcal {
    font-size: 9px;
  }

  .meal-name {
    font-size: 10.5px;
  }

  .meal-add {
    width: 22px;
    height: 22px;
  }

  .day-foot {
    padding: 11px 13px 12px;
  }

  .planner-foot {
    align-items: flex-start;
    gap: 12px;
  }

  .planner-foot p {
    line-height: 1.55;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 0 25px;
    font-size: 7.5px;
  }

  .modal-layer {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 91vh;
    padding: 22px 18px max(20px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    transform: translateY(38px);
  }

  .modal-small {
    width: 100%;
  }

  .modal-head h2 {
    font-size: 25px;
  }

  .text-input,
  .number-wrap {
    height: 48px;
  }

  .button {
    height: 43px;
  }

  .target-presets {
    gap: 5px;
  }

  .target-presets button {
    height: 41px;
  }

  .toast {
    bottom: 18px;
    width: max-content;
  }
}

@media (max-width: 430px) {
  .brand-en {
    display: none;
  }

  .pill-button {
    gap: 5px;
    padding: 0 9px;
  }

  .header-actions .pill-button:last-child span {
    display: none;
  }

  .header-actions .pill-button:last-child {
    width: 35px;
    justify-content: center;
    padding: 0;
  }

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

  .summary-head {
    gap: 8px;
  }

  .summary-target {
    padding-inline: 7px;
    font-size: 8px;
  }

  .chart-grid {
    gap: 4px;
  }

  .week-controls {
    border-radius: 14px;
  }

  .today-button {
    border-radius: 0 10px 10px 0;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .delete-button {
    margin-right: auto;
  }

  .button {
    padding-inline: 14px;
  }
}

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

/* =========================================================
   Print
   ========================================================= */

@media print {
  @page {
    size: A4 landscape;
    margin: 9mm;
  }

  body {
    background: #fff;
    color: #222;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page-grain,
  .site-header,
  .hero,
  .demo-banner,
  .mobile-hint,
  .planner-sub,
  .week-controls,
  .planner-foot,
  .site-footer,
  .meal-add,
  .modal-layer,
  .toast {
    display: none !important;
  }

  .shell {
    width: 100%;
    max-width: none;
  }

  .planner {
    padding: 0;
  }

  .planner-head {
    display: block;
    padding: 0 0 8px;
    border: 0;
  }

  .planner-heading h2 {
    font-size: 21px;
  }

  .print-meta {
    display: block;
    margin-top: 3px;
    color: #666;
    font-size: 9px;
    line-height: 1.5;
  }

  .week-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-top: 8px;
    overflow: visible;
  }

  .day-card {
    break-inside: avoid;
    border-color: #cfcfcf;
    border-radius: 5px;
    box-shadow: none;
  }

  .day-head {
    padding: 7px;
  }

  .day-weekday {
    font-size: 14px;
  }

  .day-date {
    font-size: 7.5px;
  }

  .today-pill {
    display: none;
  }

  .day-meals {
    padding: 0 5px;
  }

  .meal {
    min-height: 0;
    padding: 5px 2px;
  }

  .meal-name {
    font-size: 8.5px;
  }

  .meal-total {
    display: none;
  }

  .meal-badge {
    width: 14px;
    height: 14px;
    font-size: 7px;
  }

  .food-item {
    padding: 2px 1px;
    font-size: 9px;
  }

  .food-kcal {
    font-size: 8px;
  }

  .day-foot {
    padding: 6px 7px;
  }

  .day-total {
    font-size: 13px;
  }

  .day-status {
    font-size: 7.5px;
  }

  .progress-track {
    margin-top: 3px;
  }

  .planner-foot {
    display: none;
  }
}

/* =========================================================
   Cougou Kitchen v2 · Auth, shared kitchens, pantry
   ========================================================= */

:root {
  --forest: #2d3328;
  --forest-2: #22271e;
  --cream: #f8f1e2;
  --cat-staple: #c8963a;
  --cat-staple-bg: #f6ecd5;
  --cat-protein: #c06448;
  --cat-protein-bg: #f7e3da;
  --cat-vegetable: #718b62;
  --cat-vegetable-bg: #e8efdf;
  --cat-fruit: #b77a3d;
  --cat-fruit-bg: #f7e9d8;
  --cat-drink: #69838c;
  --cat-drink-bg: #e5eef0;
  --cat-other: #8a7185;
  --cat-other-bg: #eee5ec;
}

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

/* ---------- Boot ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(216, 100, 70, 0.1), transparent 26rem),
    var(--paper);
  transition:
    opacity 320ms ease,
    visibility 320ms ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.boot-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  box-shadow: 0 16px 28px -16px rgba(160, 68, 44, 0.55);
}

.boot-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.boot-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.boot-line {
  position: relative;
  width: 104px;
  height: 2px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.boot-line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 48%;
  border-radius: inherit;
  background: var(--tomato);
  animation: boot-slide 1.25s ease-in-out infinite;
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(90%); }
  100% { transform: translateX(220%); }
}

/* ---------- Auth ---------- */

.auth-view {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
}

.auth-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 12% 2%, rgba(216, 100, 70, 0.15), transparent 34%),
    radial-gradient(ellipse at 94% 100%, rgba(113, 139, 98, 0.2), transparent 34%),
    var(--paper);
}

.auth-shell {
  width: min(1200px, 100%);
  min-height: min(780px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 32px;
  background: var(--card);
  box-shadow:
    0 45px 100px -45px rgba(50, 42, 30, 0.48),
    0 2px 0 rgba(255, 255, 255, 0.55) inset;
}

.auth-story {
  position: relative;
  overflow: hidden;
  padding: 42px 46px 34px;
  background:
    radial-gradient(circle at 92% 4%, rgba(134, 155, 113, 0.28), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(216, 100, 70, 0.13), transparent 34%),
    linear-gradient(148deg, #343b2d 0%, #293025 51%, #24291f 100%);
  color: var(--cream);
}

.auth-story::before {
  content: "";
  position: absolute;
  top: 22%;
  right: -130px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(248, 241, 226, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 40px rgba(248, 241, 226, 0.018),
    0 0 0 90px rgba(248, 241, 226, 0.012);
  pointer-events: none;
}

.auth-story::after {
  content: "食";
  position: absolute;
  right: 8%;
  bottom: 18%;
  color: rgba(248, 241, 226, 0.035);
  font-family: var(--serif);
  font-size: 190px;
  line-height: 1;
  pointer-events: none;
}

.auth-story-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.auth-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-inverse .brand-name {
  color: var(--cream);
}

.brand-inverse .brand-en {
  color: rgba(248, 241, 226, 0.5);
}

.auth-story-badge {
  padding: 6px 9px;
  border: 1px solid rgba(248, 241, 226, 0.16);
  border-radius: 999px;
  color: rgba(248, 241, 226, 0.55);
  font-size: 7.5px;
  letter-spacing: 0.2em;
}

.auth-story-copy {
  margin-top: clamp(42px, 7vh, 76px);
}

.eyebrow-light {
  color: rgba(248, 241, 226, 0.48);
}

.auth-story h1 {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-size: clamp(48px, 4.8vw, 67px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.auth-accent {
  color: #e58f70;
}

.auth-lede {
  max-width: 430px;
  color: rgba(248, 241, 226, 0.62);
  font-size: 12.5px;
  line-height: 1.85;
}

.auth-story-foot {
  margin-top: auto;
  padding-top: 30px;
}

.auth-points {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(248, 241, 226, 0.11);
}

.auth-points li {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(248, 241, 226, 0.09);
}

.auth-points li > span {
  padding-top: 2px;
  color: rgba(248, 241, 226, 0.36);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.auth-points strong {
  display: block;
  color: rgba(248, 241, 226, 0.92);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.auth-points p {
  margin-top: 2px;
  color: rgba(248, 241, 226, 0.44);
  font-size: 9px;
  line-height: 1.55;
}

.auth-mini-preview {
  width: min(100%, 405px);
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(248, 241, 226, 0.12);
  border-radius: 12px;
  background: rgba(248, 241, 226, 0.045);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.mini-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(248, 241, 226, 0.12);
  color: rgba(248, 241, 226, 0.54);
  font-size: 8px;
}

.mini-preview-head strong {
  color: rgba(248, 241, 226, 0.9);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.mini-preview-head small {
  color: rgba(248, 241, 226, 0.4);
  font-family: var(--sans);
  font-size: 7px;
}

.mini-preview-row {
  display: grid;
  grid-template-columns: 17px 1fr auto;
  align-items: center;
  gap: 7px;
  padding-top: 6px;
  color: rgba(248, 241, 226, 0.6);
  font-size: 8px;
}

.mini-preview-row > span:last-child {
  color: rgba(248, 241, 226, 0.38);
  font-variant-numeric: tabular-nums;
}

.mini-preview-meal {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: rgba(248, 241, 226, 0.1);
  color: rgba(248, 241, 226, 0.8);
  font-size: 6.5px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: 31px 42px 25px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(231, 236, 223, 0.55), transparent 38%),
    var(--card);
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.auth-secure {
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.04em;
}

.auth-secure .icon {
  width: 11px;
  height: 11px;
  color: var(--sage);
}

.auth-panel-inner {
  width: min(100%, 382px);
  margin: auto;
  padding: 34px 0;
}

.auth-invite-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid #e2d2b6;
  border-radius: 12px;
  background: #f8eedb;
}

.auth-invite-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(200, 151, 56, 0.15);
  color: #9c7129;
}

.auth-invite-icon .icon {
  width: 14px;
  height: 14px;
}

.auth-invite-banner strong {
  display: block;
  color: #665231;
  font-size: 10px;
  line-height: 1.5;
}

.auth-invite-banner p {
  margin-top: 2px;
  color: #8d7958;
  font-size: 9px;
  line-height: 1.55;
}

.auth-kicker {
  color: var(--tomato);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.23em;
}

.auth-panel h2 {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 27px;
  padding: 4px;
  border-radius: 11px;
  background: #f2ebde;
}

.auth-tab {
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  transition:
    background 170ms ease,
    border-color 170ms ease,
    color 170ms ease,
    box-shadow 170ms ease;
}

.auth-tab.is-active {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 2px 7px rgba(68, 54, 34, 0.07);
  color: var(--ink);
  font-weight: 600;
}

.auth-form {
  margin-top: 19px;
}

.auth-field {
  display: block;
  margin-bottom: 15px;
}

.auth-field > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12.5px;
  transition:
    border-color 170ms ease,
    box-shadow 170ms ease;
}

.auth-field input:hover {
  border-color: #bfb29d;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 3px rgba(216, 100, 70, 0.11);
}

.auth-field input::placeholder {
  color: #a49d90;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--paper);
  color: var(--ink-soft);
}

.password-toggle .icon {
  width: 15px;
  height: 15px;
}

.auth-error {
  margin: -2px 0 13px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f9e5de;
  color: #a3422c;
  font-size: 9.5px;
  line-height: 1.55;
}

.auth-submit {
  width: 100%;
  height: 47px;
  margin-top: 3px;
  justify-content: space-between;
  padding-inline: 17px;
  font-size: 11.5px;
}

.auth-submit .icon {
  width: 15px;
  height: 15px;
}

.auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.65;
}

.auth-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.auth-copyright {
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ---------- Header, nav, popovers ---------- */

.site-header {
  z-index: 80;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
}

.main-nav {
  display: flex;
  justify-self: center;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(210, 199, 181, 0.65);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.54);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 170ms ease,
    border-color 170ms ease,
    color 170ms ease,
    box-shadow 170ms ease;
}

.nav-item .icon {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(244, 238, 226, 0.72);
}

.nav-item.is-active {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 2px 7px rgba(68, 54, 34, 0.06);
  color: var(--ink);
  font-weight: 600;
}

.nav-item.is-active .icon {
  color: var(--tomato);
  opacity: 1;
}

.header-actions {
  gap: 7px;
}

.kitchen-switch-wrap,
.user-wrap {
  position: relative;
}

.kitchen-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 205px;
  height: 44px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.68);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition:
    background 170ms ease,
    border-color 170ms ease,
    transform 170ms var(--ease-out);
}

.kitchen-switch:hover,
.kitchen-switch[aria-expanded="true"] {
  border-color: #bfb29d;
  background: var(--card);
}

.kitchen-switch-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.kitchen-switch-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.kitchen-switch-text strong {
  overflow: hidden;
  max-width: 112px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kitchen-switch-text small {
  overflow: hidden;
  max-width: 112px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kitchen-switch-chevron {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: var(--faint);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 8px 16px -10px rgba(159, 68, 45, 0.6);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms var(--ease-out);
}

.user-avatar:hover {
  transform: translateY(-1px) scale(1.02);
}

.popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 90;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 24px 54px -24px rgba(50, 42, 30, 0.38);
  animation: popover-in 150ms var(--ease-out);
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.kitchen-menu {
  width: 308px;
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--sage-deep);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0;
}

.live-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6f9661;
  box-shadow: 0 0 0 2px rgba(111, 150, 97, 0.12);
}

.live-pill.is-offline {
  color: var(--muted);
}

.live-pill.is-offline i {
  background: var(--faint);
  box-shadow: none;
}

.popover-list {
  max-height: 284px;
  overflow: auto;
  padding: 5px;
}

.kitchen-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.kitchen-menu-item:hover {
  background: #f4ede1;
}

.kitchen-menu-item.is-current {
  background: #f2e9da;
}

.kitchen-menu-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

.kitchen-menu-item:nth-child(3n + 2) .kitchen-menu-avatar {
  background: #f5e3da;
  color: #a9583f;
}

.kitchen-menu-item:nth-child(3n + 3) .kitchen-menu-avatar {
  background: #ede5ec;
  color: #7f6579;
}

.kitchen-menu-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.kitchen-menu-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kitchen-menu-copy small {
  color: var(--faint);
  font-size: 8px;
}

.kitchen-menu-check {
  width: 14px;
  height: 14px;
  color: var(--tomato);
}

.popover-footer-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fbf6ec;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.popover-footer-button:hover {
  background: #f4ede1;
  color: var(--tomato-deep);
}

.popover-footer-button .icon {
  width: 12px;
  height: 12px;
}

.user-menu {
  width: 236px;
}

.user-menu-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.avatar-lg {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tomato);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.user-menu-identity strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.user-menu-identity span:last-child {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
}

.user-menu-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  text-align: left;
  cursor: pointer;
}

.user-menu-logout:hover {
  background: #f9e7df;
  color: var(--tomato-deep);
}

.user-menu-logout .icon {
  width: 13px;
  height: 13px;
}

/* ---------- Planner additions ---------- */

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.65);
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.role-badge[data-role="owner"] {
  border-color: rgba(200, 151, 56, 0.28);
  background: #f7ecd5;
  color: #8c6525;
}

.role-badge[data-role="editor"] {
  border-color: rgba(113, 139, 98, 0.24);
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.role-badge[data-role="viewer"] {
  border-color: rgba(138, 113, 133, 0.22);
  background: #eee6ed;
  color: #7f657a;
}

.summary-target {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  border: 1px solid rgba(244, 238, 223, 0.18);
  border-radius: 999px;
  background: rgba(244, 238, 223, 0.055);
  color: rgba(244, 238, 223, 0.7);
  font-family: var(--sans);
  font-size: 8.5px;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.summary-target:hover {
  border-color: rgba(244, 238, 223, 0.35);
  background: rgba(244, 238, 223, 0.1);
}

.summary-target:disabled {
  cursor: default;
  opacity: 0.72;
}

.summary-target:disabled:hover {
  border-color: rgba(244, 238, 223, 0.18);
  background: rgba(244, 238, 223, 0.055);
}

.summary-target strong {
  color: #f7f1e4;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-target > span {
  opacity: 0.62;
}

.summary-target .icon {
  width: 10px;
  height: 10px;
  margin-left: 1px;
  opacity: 0.45;
}

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

.planner-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.72);
  color: var(--ink-soft);
  font-size: 9.5px;
  cursor: pointer;
  transition:
    background 170ms ease,
    border-color 170ms ease,
    color 170ms ease;
}

.planner-print:hover {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink);
}

.planner-print .icon {
  width: 14px;
  height: 14px;
}

.readonly-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 10px 13px;
  border: 1px solid #ddd0df;
  border-radius: 12px;
  background: #f3ebf2;
  color: #715f6e;
  font-size: 9.5px;
}

.readonly-banner .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.readonly-banner p {
  flex: 1;
  line-height: 1.55;
}

.readonly-banner button {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(113, 95, 110, 0.35);
  background: transparent;
  color: #715f6e;
  font-size: 9px;
  cursor: pointer;
}

.board-shell {
  position: relative;
  margin-top: 17px;
}

.board-shell .week-board {
  margin-top: 0;
}

.board-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(246, 240, 230, 0.82);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: var(--muted);
  font-size: 10px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--tomato);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.week-board.is-loading {
  min-height: 300px;
}

/* ---------- Shared view headings ---------- */

.app-main {
  min-height: calc(100vh - 160px);
}

.view {
  padding-bottom: 50px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 45px 0 30px;
  border-bottom: 1px solid var(--line-strong);
}

.view-heading h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(44px, 4.3vw, 61px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.title-dot {
  color: var(--tomato);
}

.view-lede {
  max-width: 570px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.view-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.62);
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.button .icon {
  width: 14px;
  height: 14px;
}

/* ---------- Ingredient library ---------- */

.ingredient-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.category-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.55);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}

.category-tab:hover {
  background: #f4ede1;
  color: var(--ink-soft);
}

.category-tab.is-active {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 2px 6px rgba(68, 54, 34, 0.06);
  color: var(--ink);
  font-weight: 600;
}

.category-tab span {
  color: var(--faint);
  font-size: 7.5px;
  font-variant-numeric: tabular-nums;
}

.search-box {
  display: flex;
  flex: 0 1 230px;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.65);
  transition:
    border-color 170ms ease,
    background 170ms ease;
}

.search-box:focus-within {
  border-color: var(--tomato);
  background: var(--card);
}

.search-box .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 9.5px;
}

.search-box input:focus {
  outline: none;
}

.search-box input::placeholder {
  color: var(--faint);
}

.ingredient-week-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 15px;
  color: var(--faint);
  font-size: 8.5px;
}

.ingredient-week-note strong {
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ingredient-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 202px;
  overflow: hidden;
  padding: 16px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0%, var(--cat-bg), transparent 52%),
    var(--card);
  box-shadow: var(--shadow-card);
  transition:
    border-color 180ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--ease-out);
}

.ingredient-card:hover {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 22px 36px -32px rgba(54, 44, 28, 0.38);
  transform: translateY(-2px);
}

.ingredient-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color);
  opacity: 0.72;
}

.ingredient-card[data-category="staple"] { --cat-color: var(--cat-staple); --cat-bg: var(--cat-staple-bg); }
.ingredient-card[data-category="protein"] { --cat-color: var(--cat-protein); --cat-bg: var(--cat-protein-bg); }
.ingredient-card[data-category="vegetable"] { --cat-color: var(--cat-vegetable); --cat-bg: var(--cat-vegetable-bg); }
.ingredient-card[data-category="fruit"] { --cat-color: var(--cat-fruit); --cat-bg: var(--cat-fruit-bg); }
.ingredient-card[data-category="drink"] { --cat-color: var(--cat-drink); --cat-bg: var(--cat-drink-bg); }
.ingredient-card[data-category="other"] { --cat-color: var(--cat-other); --cat-bg: var(--cat-other-bg); }

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

.ingredient-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cat-color);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ingredient-category::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat-color);
}

.ingredient-edit {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  opacity: 0.72;
}

.ingredient-card:hover .ingredient-edit {
  opacity: 1;
}

.ingredient-edit:hover {
  border-color: var(--line);
  background: rgba(255, 252, 246, 0.75);
  color: var(--ink-soft);
}

.ingredient-edit .icon {
  width: 12px;
  height: 12px;
}

.ingredient-name {
  margin-top: 14px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ingredient-unit {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.ingredient-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 17px;
}

.ingredient-calories {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ingredient-calories strong {
  color: var(--ink);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.ingredient-calories span {
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.ingredient-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.66);
  color: var(--ink-soft);
  font-size: 8.5px;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.ingredient-add:hover {
  border-color: var(--cat-color);
  background: var(--card);
  color: var(--cat-color);
}

.ingredient-add .icon {
  width: 10px;
  height: 10px;
}

.ingredient-readonly {
  color: var(--faint);
  font-size: 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
  padding: 64px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.5);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.empty-icon .icon {
  width: 23px;
  height: 23px;
}

.empty-state h3 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 22px;
}

.empty-state p {
  max-width: 340px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.empty-state .button {
  margin-top: 17px;
}

.library-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 17px;
  color: var(--faint);
  font-size: 8.5px;
}

.library-note .icon {
  width: 12px;
  height: 12px;
}

/* ---------- Kitchen page ---------- */

.kitchen-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.7fr);
  gap: 14px;
  margin-top: 23px;
}

.kitchen-title-card,
.invite-card,
.members-card,
.role-guide-card,
.my-kitchens-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.kitchen-title-card {
  display: flex;
  flex-direction: column;
  padding: 23px;
  background:
    radial-gradient(circle at 97% 0%, rgba(231, 236, 223, 0.9), transparent 40%),
    linear-gradient(180deg, #fffcf6, #fbf6ec);
}

.kitchen-title-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.kitchen-big-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 67px;
  height: 67px;
  border-radius: 19px;
  background: var(--forest);
  box-shadow: 0 14px 26px -16px rgba(43, 49, 37, 0.65);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
}

.kitchen-title-copy {
  min-width: 0;
  flex: 1;
  padding-top: 4px;
}

.kitchen-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kitchen-name-row h2 {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kitchen-title-copy > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.kitchen-title-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.text-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  cursor: pointer;
}

.text-icon-button:hover {
  border-color: var(--line);
  background: rgba(255, 252, 246, 0.7);
  color: var(--ink-soft);
}

.text-icon-button.danger-text:hover {
  border-color: #eed4ca;
  background: #f9e7df;
  color: var(--tomato-deep);
}

.text-icon-button .icon {
  width: 11px;
  height: 11px;
}

.kitchen-meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: auto;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.kitchen-meta-row > div {
  min-width: 0;
}

.kitchen-meta-row span {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.kitchen-meta-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-card {
  display: flex;
  flex-direction: column;
  padding: 21px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 223, 214, 0.8), transparent 38%),
    var(--card);
}

.card-kicker {
  color: var(--tomato);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.21em;
}

.invite-card h3,
.role-guide-card h3 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.24;
}

.invite-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.invite-role-options {
  display: grid;
  gap: 5px;
  margin-top: 15px;
}

.invite-role {
  position: relative;
  cursor: pointer;
}

.invite-role input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.invite-role > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 252, 246, 0.62);
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.invite-role strong {
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
}

.invite-role small {
  color: var(--faint);
  font-size: 8px;
}

.invite-role input:checked + span {
  border-color: rgba(216, 100, 70, 0.5);
  background: #f9e9e2;
}

.invite-role input:checked + span strong {
  color: var(--tomato-deep);
}

.invite-role input:focus-visible + span {
  outline: 2px solid var(--tomato);
  outline-offset: 1px;
}

.invite-button {
  width: 100%;
  height: 37px;
  margin-top: 10px;
  font-size: 9.5px;
}

.invite-result {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-strong);
}

.invite-result > label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.invite-link-row input {
  flex: 1;
  min-width: 0;
  height: 33px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fffdf8;
  color: var(--ink-soft);
  font-size: 8px;
}

.invite-link-row input:focus {
  outline: none;
  border-color: var(--tomato);
}

.invite-link-row button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

.invite-link-row button:hover {
  border-color: var(--tomato);
  color: var(--tomato);
}

.invite-link-row button .icon {
  width: 13px;
  height: 13px;
}

.invite-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 7.5px;
}

.invite-owner-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f2e8;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.invite-owner-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.active-invites {
  margin-top: 11px;
}

.active-invite {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 8px;
  color: var(--faint);
}

.active-invite:first-child {
  border-top: 0;
}

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

.active-invite strong {
  display: block;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 500;
}

.active-invite-actions {
  display: flex;
  gap: 2px;
}

.active-invite-actions button {
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  font-size: 7.5px;
  cursor: pointer;
}

.active-invite-actions button:hover {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink-soft);
}

.kitchen-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
  gap: 14px;
  margin-top: 14px;
}

.members-card,
.role-guide-card {
  padding: 21px;
}

.card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.card-heading h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.card-heading h2 span {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
}

.member-hint {
  color: var(--faint);
  font-size: 8px;
}

.member-list {
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: 0;
  padding-bottom: 1px;
}

.member-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.member-row:nth-child(3n + 2) .member-avatar {
  background: #f5e2d9;
  color: #a75a42;
}

.member-row:nth-child(3n + 3) .member-avatar {
  background: #ece4ec;
  color: #7d6479;
}

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

.member-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.member-copy span {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 8px;
}

.member-role-static {
  flex: 0 0 auto;
}

.member-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.member-role-select {
  height: 28px;
  padding: 0 23px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--card);
  color: var(--ink-soft);
  font-size: 8.5px;
  cursor: pointer;
}

.member-remove {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.member-remove:hover {
  border-color: #eed4ca;
  background: #f9e7df;
  color: var(--tomato-deep);
}

.member-remove .icon {
  width: 11px;
  height: 11px;
}

.role-guide-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 236, 223, 0.85), transparent 44%),
    #f9f4ea;
}

.role-guide-row {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.role-guide-row:first-of-type {
  margin-top: 15px;
}

.role-guide-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
}

.role-guide-icon .icon {
  width: 13px;
  height: 13px;
}

.role-guide-icon.owner {
  background: #f6ead1;
  color: #9b6c23;
}

.role-guide-icon.editor {
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.role-guide-icon.viewer {
  background: #ede5ec;
  color: #7f6579;
}

.role-guide-row strong {
  display: block;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
}

.role-guide-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.my-kitchens-section {
  margin-top: 14px;
  padding: 21px;
}

.kitchen-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.kitchen-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcf8ef;
  transition:
    border-color 170ms ease,
    transform 180ms var(--ease-out),
    box-shadow 180ms ease;
}

.kitchen-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 26px -28px rgba(54, 44, 28, 0.4);
}

.kitchen-card.is-current {
  border-color: #d89a83;
  background: linear-gradient(180deg, #fffcf6, #fbf1e9);
  box-shadow: 0 0 0 1px rgba(216, 100, 70, 0.1);
}

.kitchen-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.kitchen-card-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

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

.kitchen-card-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kitchen-card-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.kitchen-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 13px;
}

.kitchen-card-role {
  color: var(--muted);
  font-size: 8px;
}

.kitchen-card-enter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tomato);
  font-size: 8.5px;
  font-weight: 600;
  cursor: pointer;
}

.kitchen-card-enter:hover {
  color: var(--tomato-deep);
}

.kitchen-card-enter .icon {
  width: 10px;
  height: 10px;
}

.current-kitchen-mark {
  position: absolute;
  top: 11px;
  right: 11px;
  color: var(--tomato);
}

.current-kitchen-mark .icon {
  width: 13px;
  height: 13px;
}

/* ---------- Added form controls ---------- */

.select-input {
  width: 100%;
  height: 46px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background-color: #fffdf8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23746e63' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  color: var(--ink);
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.select-input:hover {
  border-color: #bfb29d;
}

.select-input:focus {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 3px rgba(216, 100, 70, 0.12);
}

.select-input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row .form-group {
  min-width: 0;
}

.field-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
}

.inline-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(216, 100, 70, 0.3);
  background: transparent;
  color: var(--tomato);
  font-size: 8px;
  cursor: pointer;
}

.inline-link:hover {
  color: var(--tomato-deep);
  border-bottom-color: var(--tomato-deep);
}

.quick-add-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px 0 19px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf6ec;
}

.quick-add-category {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 8px;
  font-weight: 600;
}

.quick-add-summary strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.quick-add-summary p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

/* ---------- Mobile tabbar ---------- */

.mobile-tabbar {
  display: none;
}

/* ---------- New responsive rules ---------- */

@media (max-width: 1180px) {
  .header-inner {
    gap: 14px;
  }

  .nav-item {
    padding-inline: 10px;
  }

  .kitchen-switch {
    max-width: 182px;
  }

  .kitchen-switch-text strong,
  .kitchen-switch-text small {
    max-width: 94px;
  }

  .ingredient-grid {
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  }
}

@media (max-width: 1000px) {
  .nav-item span {
    display: none;
  }

  .nav-item {
    padding: 9px 11px;
  }

  .nav-item .icon {
    width: 15px;
    height: 15px;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  }

  .auth-story {
    padding-inline: 36px;
  }

  .kitchen-overview,
  .kitchen-content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  }
}

@media (max-width: 920px) {
  .auth-view {
    padding: 0;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 25px 22px;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-panel-inner {
    padding: 26px 0;
  }

  .auth-panel h2 {
    font-size: 33px;
  }
}

@media (max-width: 880px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .header-actions {
    justify-self: end;
  }

  .kitchen-switch {
    max-width: 186px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 7px max(16px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(210, 199, 181, 0.7);
    background: rgba(248, 243, 233, 0.93);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: 0 -8px 28px -22px rgba(50, 42, 30, 0.5);
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 47px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 8px;
    cursor: pointer;
  }

  .mobile-tab .icon {
    width: 17px;
    height: 17px;
  }

  .mobile-tab.is-active {
    border-color: var(--line);
    background: var(--card);
    box-shadow: 0 2px 7px rgba(68, 54, 34, 0.07);
    color: var(--tomato-deep);
    font-weight: 600;
  }

  .app-view {
    padding-bottom: 72px;
  }

  .toast {
    bottom: 82px;
  }

  .kitchen-overview,
  .kitchen-content-grid {
    grid-template-columns: 1fr;
  }

  .kitchen-title-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

  .invite-card {
    order: 2;
  }
}

@media (max-width: 760px) {
  .view {
    padding-bottom: 38px;
  }

  .view-head {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 30px 0 22px;
  }

  .view-heading h1 {
    margin-top: 11px;
    font-size: clamp(40px, 12vw, 53px);
  }

  .view-lede {
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.8;
  }

  .view-head-actions {
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .view-head-actions .button {
    flex: 1;
  }

  .count-chip {
    height: 32px;
  }

  .ingredient-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    margin-top: 16px;
  }

  .category-tabs {
    width: 100%;
  }

  .search-box {
    flex: 0 0 40px;
    width: 100%;
  }

  .ingredient-week-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-top: 11px;
  }

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

  .ingredient-card {
    min-height: 184px;
    padding: 13px 12px 11px;
    border-radius: 14px;
  }

  .ingredient-name {
    margin-top: 11px;
    font-size: 18px;
  }

  .ingredient-calories strong {
    font-size: 21px;
  }

  .ingredient-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
  }

  .ingredient-add {
    width: 100%;
    justify-content: center;
  }

  .ingredient-edit {
    opacity: 1;
  }

  .library-note {
    align-items: flex-start;
    line-height: 1.55;
  }

  .kitchen-title-card,
  .invite-card,
  .members-card,
  .role-guide-card,
  .my-kitchens-section {
    border-radius: 16px;
  }

  .kitchen-title-card,
  .invite-card,
  .members-card,
  .role-guide-card,
  .my-kitchens-section {
    padding: 16px;
  }

  .kitchen-title-main {
    gap: 11px;
  }

  .kitchen-big-avatar {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 24px;
  }

  .kitchen-name-row h2 {
    font-size: 24px;
  }

  .kitchen-title-actions {
    width: 100%;
    margin-left: 0;
    padding-top: 4px;
    justify-content: flex-start;
  }

  .kitchen-title-main {
    flex-wrap: wrap;
  }

  .kitchen-meta-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 14px;
  }

  .kitchen-meta-row strong {
    font-size: 10px;
  }

  .kitchen-content-grid {
    margin-top: 10px;
    gap: 10px;
  }

  .my-kitchens-section {
    margin-top: 10px;
  }

  .card-heading {
    align-items: flex-start;
  }

  .card-heading h2 {
    font-size: 21px;
  }

  .member-hint {
    text-align: right;
    line-height: 1.5;
  }

  .member-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .member-actions {
    width: 100%;
    padding-left: 44px;
  }

  .member-role-select {
    flex: 1;
    max-width: 150px;
  }

  .kitchen-card-grid {
    grid-template-columns: 1fr;
  }

  .planner-head {
    gap: 13px;
  }

  .planner-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: stretch;
  }

  .week-controls {
    flex: 1;
  }

  .planner-print {
    flex: 0 0 43px;
    width: 43px;
    padding: 0;
  }

  .planner-print span {
    display: none;
  }

  .role-badge {
    padding: 3px 6px;
    font-size: 7.5px;
  }

  .readonly-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    line-height: 1.55;
  }

  .readonly-banner p {
    flex-basis: calc(100% - 25px);
  }

  .readonly-banner button {
    margin-left: 23px;
  }

  .auth-panel {
    padding: 21px 18px;
  }

  .auth-panel-top {
    font-size: 7px;
  }

  .auth-panel-inner {
    width: 100%;
    padding: 22px 0 32px;
  }

  .auth-panel h2 {
    font-size: 31px;
  }

  .auth-sub {
    font-size: 10.5px;
  }

  .auth-mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .auth-mobile-brand .brand-name {
    font-size: 18px;
  }

  .auth-tabs {
    margin-top: 23px;
  }

  .auth-copyright {
    margin-top: auto;
  }

  .kitchen-menu {
    position: fixed;
    top: 73px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .user-menu {
    right: 0;
  }

  .kitchen-switch {
    max-width: 160px;
  }

  .kitchen-switch-text strong,
  .kitchen-switch-text small {
    max-width: 79px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal .select-input {
    height: 48px;
  }
}

@media (max-width: 430px) {
  .brand-en {
    display: none;
  }

  .brand-copy {
    gap: 0;
  }

  .kitchen-switch {
    max-width: 140px;
    height: 40px;
    gap: 6px;
    padding-right: 7px;
  }

  .kitchen-switch-avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .kitchen-switch-text strong,
  .kitchen-switch-text small {
    max-width: 69px;
  }

  .kitchen-switch-text strong {
    font-size: 9.5px;
  }

  .kitchen-switch-text small {
    font-size: 7px;
  }

  .user-avatar {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .header-actions {
    gap: 4px;
  }

  .ingredient-card {
    min-height: 170px;
  }

  .ingredient-bottom {
    flex-direction: row;
    align-items: flex-end;
  }

  .ingredient-add {
    width: auto;
  }

  .view-head-actions .button {
    flex: 0 1 auto;
    padding-inline: 11px;
  }

  .kitchen-title-actions .text-icon-button {
    font-size: 8px;
  }

  .member-actions {
    padding-left: 42px;
  }
}

@media (max-width: 360px) {
  .kitchen-switch-text {
    display: none;
  }

  .kitchen-switch {
    width: 43px;
    padding: 0;
    justify-content: center;
  }

  .kitchen-switch-chevron {
    display: none;
  }

  .ingredient-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-line::after,
  .spinner {
    animation-duration: 1.6s !important;
  }
}

/* ---------- Print additions ---------- */

@media print {
  .auth-view,
  .boot-screen,
  .main-nav,
  .header-actions,
  .mobile-tabbar,
  .planner-actions,
  .readonly-banner,
  .demo-banner,
  .view-head,
  #ingredientsView,
  #kitchenView {
    display: none !important;
  }

  .app-view {
    padding-bottom: 0;
  }
}

/* ---------- v2 state helpers ---------- */

.auth-invite-banner.is-error {
  border-color: #e7c3b6;
  background: #f9e6df;
}

.auth-invite-banner.is-error .auth-invite-icon {
  background: rgba(216, 100, 70, 0.12);
  color: var(--tomato-deep);
}

.auth-invite-banner.is-error strong {
  color: #8d402c;
}

.auth-invite-banner.is-error p {
  color: #9c6655;
}

.app-view.is-loading .app-main {
  opacity: 0.52;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.food-item.is-static {
  cursor: default;
}

.food-item.is-static:hover {
  background: transparent;
  color: var(--ink-soft);
}

.food-item.is-static:hover .food-dot {
  background: #c7bdaa;
}

.food-item.is-static:hover .food-kcal {
  color: var(--faint);
}

.empty-meal.is-static {
  cursor: default;
}

.empty-meal.is-static:hover {
  background: transparent;
  color: var(--faint);
}

.menu-empty {
  padding: 18px 13px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Kitchen week band & create tile ---------- */

.kitchen-week-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(246, 241, 231, 0.68);
}

.kitchen-week-copy p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.kitchen-week-copy strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kitchen-member-stack {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding-left: 7px;
}

.stack-avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-left: -7px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 600;
}

.stack-avatar:nth-child(2n) {
  background: #f5e2d9;
  color: #a75a42;
}

.stack-avatar:nth-child(3n) {
  background: #ece4ec;
  color: #7d6479;
}

.stack-more {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-left: -7px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-size: 7px;
}

.kitchen-card-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 142px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.kitchen-card-new:hover {
  border-color: var(--tomato);
  background: rgba(255, 252, 246, 0.5);
  color: var(--tomato);
}

.kitchen-card-new .icon {
  width: 20px;
  height: 20px;
}

@media (max-width: 760px) {
  .kitchen-week-band {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin-top: 15px;
  }

  .kitchen-member-stack {
    padding-left: 7px;
  }
}

/* ---------- Kitchen quote ---------- */

.kitchen-title-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 3px 2px;
}

.kitchen-title-quote p {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.kitchen-title-quote p span {
  margin-right: 2px;
  color: var(--tomato);
  font-size: 22px;
  line-height: 0;
  vertical-align: -4px;
}

.kitchen-quote-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(216, 100, 70, 0.28);
  background: transparent;
  color: var(--tomato);
  font-size: 8.5px;
  font-weight: 600;
  cursor: pointer;
}

.kitchen-quote-link:hover {
  color: var(--tomato-deep);
  border-bottom-color: var(--tomato-deep);
}

.kitchen-quote-link .icon {
  width: 11px;
  height: 11px;
}

.active-invites-label {
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

@media (max-width: 760px) {
  .kitchen-title-quote {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
  }

  .kitchen-title-quote p {
    font-size: 12px;
  }
}

.invite-card.is-readonly {
  align-self: start;
}

.active-invites-label {
  margin: 3px 0 2px;
  color: var(--muted);
  font-size: 8px;
}

.user-menu-admin {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9.5px;
  text-decoration: none;
}

.user-menu-admin:hover {
  background: #f2ede2;
  color: var(--tomato-deep);
}

.user-menu-admin .icon {
  width: 13px;
  height: 13px;
}

/* =========================================================
   Direct-file guidance screen
   ========================================================= */

.protocol-view {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(ellipse at 12% 4%, rgba(216, 100, 70, 0.15), transparent 38%),
    radial-gradient(ellipse at 92% 96%, rgba(119, 134, 106, 0.2), transparent 38%),
    var(--paper);
}

.protocol-card {
  width: min(620px, 100%);
  padding: 38px 40px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 236, 223, 0.65), transparent 40%),
    var(--card);
  box-shadow:
    0 40px 90px -45px rgba(50, 42, 30, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.protocol-card .brand {
  margin-bottom: 42px;
}

.protocol-card h1 {
  margin: 17px 0 18px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.04em;
}

.protocol-card h1 span {
  color: var(--tomato);
}

.protocol-lede {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.protocol-lede code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f2ebdf;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10.5px;
}

.protocol-command {
  margin-top: 24px;
  padding: 15px 17px;
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 18px 34px -26px rgba(35, 39, 30, 0.7);
}

.protocol-command > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(248, 241, 226, 0.48);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.protocol-command pre {
  margin: 0;
  overflow-x: auto;
  color: #f8f1e2;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.8;
}

.protocol-link {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
}

.protocol-link a {
  color: var(--tomato-deep);
  font-weight: 600;
  text-underline-offset: 3px;
}

.protocol-hint {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  line-height: 1.75;
}

@media (max-width: 600px) {
  .protocol-view {
    padding: 16px;
  }

  .protocol-card {
    padding: 27px 22px;
    border-radius: 20px;
  }

  .protocol-card .brand {
    margin-bottom: 32px;
  }

  .protocol-card h1 {
    font-size: 37px;
  }

  .protocol-lede {
    font-size: 11px;
  }

  .protocol-command pre {
    font-size: 10.5px;
  }
}

/* ---------- Account settings ---------- */

.user-menu-profile {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 9.5px;
  text-align: left;
  cursor: pointer;
}

.user-menu-profile:hover {
  background: #f2ede2;
  color: var(--tomato-deep);
}

.user-menu-profile .icon {
  width: 13px;
  height: 13px;
}

.profile-modal {
  width: min(100%, 540px);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -2px 0 18px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbf6ec;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--tomato);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.profile-identity strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.profile-identity span:last-child {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
}

.settings-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-section + .settings-section {
  margin-top: 22px;
}

.settings-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.settings-heading h3 {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
}

.settings-heading > span {
  color: var(--faint);
  font-size: 8px;
  line-height: 1.5;
  text-align: right;
}

.settings-hint {
  margin: -2px 0 12px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
}

.settings-submit {
  width: 100%;
  height: 40px;
}

@media (max-width: 760px) {
  .profile-modal {
    width: 100%;
  }

  .settings-heading {
    align-items: flex-start;
  }

  .settings-heading > span {
    max-width: 125px;
    font-size: 7.5px;
  }
}
