/* ————————————————————————————————————————————————
   HOMEPLATE — the kitchen ledger
   Paper + ink serif world (Julienne base) carrying
   food-material color. Two people, one page.
   ———————————————————————————————————————————————— */

@import url('fonts/fonts.css');

:root {
  --paper: #F5EFE3;
  --paper-deep: #ECE3D0;
  --cream: #FBF8F1;
  --ink: #23201B;
  --ink-soft: #6B6353;
  --hairline: #D9CDB6;
  --hairline-soft: #E5DCC9;

  --green: #33582F;
  --green-wash: #E2E8D5;
  --berry: #A63D55;
  --berry-wash: #F1DCDF;
  --butter: #E9B23F;
  --butter-wash: #F5E8CB;
  --yolk: #D97E2B;
  --tomato: #B84A2B;
  --tomato-wash: #F0DCD2;
  --cocoa: #8C6A3F;

  --p-col: #B84A2B;   /* protein */
  --c-col: #A87418;   /* carbs   */
  --f-col: #8C6A3F;   /* fat     */

  --serif: 'Erode', Georgia, serif;
  --sans: 'General Sans', -apple-system, 'Helvetica Neue', sans-serif;

  --shadow: 0 2px 10px rgba(60, 48, 22, 0.10), 0 1px 3px rgba(60, 48, 22, 0.08);
  --shadow-lift: 0 6px 24px rgba(60, 48, 22, 0.14), 0 2px 6px rgba(60, 48, 22, 0.10);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* paper grain over everything, beneath interaction */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

#app {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 20px calc(96px + env(safe-area-inset-bottom));
}

/* ————— header ————— */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 10px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark svg { display: block; }
.masthead .gear {
  background: none;
  border: none;
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: 50%;
}
.masthead .gear:hover { color: var(--ink); }

/* ————— shared type ————— */

.screen-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 14px 0 2px;
}
.screen-sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16.5px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.section-head {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 30px 0 12px;
}

/* dotted menu-card leader between a label and its value */
.leader {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.leader .dots {
  flex: 1;
  border-bottom: 2px dotted var(--hairline);
  transform: translateY(-4px);
}

/* ————— view transitions ————— */

.view.anim { animation: rise 420ms var(--ease-out); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view, .toast, .sheet-panel { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* ————— today: two-person tracks ————— */

.people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.person-card {
  border-radius: var(--radius);
  padding: 16px 15px 15px;
  box-shadow: var(--shadow);
}
.person-card.green { background: var(--green-wash); }
.person-card.berry { background: var(--berry-wash); }
.person-card.butter { background: var(--butter-wash); }
.person-card.yolk { background: #F3DFC9; }
.person-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  margin-bottom: 2px;
}
.person-card.green .person-name { color: var(--green); }
.person-card.berry .person-name { color: var(--berry); }
.person-card.butter .person-name { color: #7A5A10; }
.person-card.yolk .person-name { color: #96501A; }

.streak {
  display: flex;
  gap: 5px;
  margin: 7px 0 13px;
}
.streak i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(35, 32, 27, 0.3);
  transition: transform 300ms var(--ease-out), background 300ms;
}
.person-card.green .streak i.hit { background: var(--green); border-color: var(--green); }
.person-card.berry .streak i.hit { background: var(--berry); border-color: var(--berry); }
.person-card.butter .streak i.hit { background: #7A5A10; border-color: #7A5A10; }
.person-card.yolk .streak i.hit { background: #96501A; border-color: #96501A; }
.streak i.pop { transform: scale(1.45); }

.macro-row { margin-bottom: 10px; }
.macro-row:last-child { margin-bottom: 0; }
.macro-row .lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.macro-row .lbl .val { font-weight: 600; font-size: 12.5px; }
.macro-row .lbl .val small { color: rgba(35,32,27,0.72); font-weight: 500; font-size: 11px; }
.bar {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 700ms var(--ease-out);
}
.bar > i.p { background: var(--p-col); }
.bar > i.c { background: var(--c-col); }
.bar > i.f { background: var(--f-col); }

.targets-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
}
.targets-note button {
  background: none; border: none; padding: 0;
  font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}

/* ————— meal rows (today + week) ————— */

.meal-row {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.meal-row .illus {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 11px;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
}
.meal-row .illus svg { width: 38px; height: 38px; }
.meal-row .body { flex: 1; min-width: 0; }
.meal-row .title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meal-row .digest {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-chips { display: flex; gap: 6px; flex: none; }
.log-chip {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 200ms var(--ease-out);
}
.log-chip.green.on { background: var(--green); border-color: var(--green); color: var(--cream); }
.log-chip.berry.on { background: var(--berry); border-color: var(--berry); color: var(--cream); }
.log-chip.butter.on { background: #7A5A10; border-color: #7A5A10; color: var(--cream); }
.log-chip.yolk.on { background: #96501A; border-color: #96501A; color: var(--cream); }
.meal-row .remove {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 6px; margin: -6px -6px -6px 0;
  border-radius: 50%; flex: none;
  position: relative;
}
.meal-row .remove::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

/* ————— week ledger ————— */

.day-entry { padding: 16px 0 6px; border-top: 1.5px solid var(--hairline-soft); }
.day-entry:first-of-type { border-top: none; padding-top: 4px; }
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.day-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
}
.day-name em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 15px;
  margin-left: 7px;
}
.day-name .today-flag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--tomato);
  margin-left: 8px;
}
.day-add {
  background: none;
  border: 1.5px dashed var(--hairline);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
}
.day-add:hover { border-color: var(--ink-soft); color: var(--ink); }
.day-empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14.5px;
  padding: 2px 0 10px;
}

/* ————— buttons ————— */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  padding: 15px 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 200ms var(--ease-out), box-shadow 200ms;
}
.btn-primary:active { transform: scale(0.985); }
.btn-quiet {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 10px;
}
.btn-quiet:hover { color: var(--ink); }

/* ————— recipes ————— */

.recipe-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--cream);
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform 250ms var(--ease-out), box-shadow 250ms;
}
.recipe-card:active { transform: scale(0.99); }
.recipe-card.is-draft { cursor: default; }
.recipe-card.is-draft:active { transform: none; }
.recipe-card .art {
  height: 132px;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  position: relative;
}
.recipe-card .art svg { width: 92px; height: 92px; }
.recipe-card .art .from-tag {
  position: absolute;
  top: 10px; left: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream);
  border-radius: 999px;
  padding: 3px 9px;
  box-shadow: var(--shadow);
}
.recipe-card .body { padding: 14px 16px 15px; }
.recipe-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 5px;
}
.stat-row b { color: var(--ink); font-weight: 600; }
.stat-row .sep { margin: 0 7px; color: var(--hairline); }

/* recipe detail */

.detail-hero {
  height: 150px;
  border-radius: var(--radius);
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.detail-hero svg { width: 104px; height: 104px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border-radius: 999px;
  padding: 7px 13px;
  box-shadow: var(--shadow);
}
.macro-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 6px 13px;
  margin: 16px 0;
  text-align: center;
}
.macro-card .num {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.macro-card .num.p { color: var(--p-col); }
.macro-card .num.c { color: var(--c-col); }
.macro-card .num.f { color: var(--f-col); }
.macro-card .cap {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 1px;
}
.serves-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.serves-row .cap { font-weight: 600; font-size: 15px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  background: none;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}
.stepper .n { font-weight: 600; font-size: 17px; min-width: 28px; text-align: center; }
.ing-row { padding: 9px 0; font-size: 15px; }
.ing-row .qty { font-weight: 600; white-space: nowrap; }
.ing-row .opt { color: var(--ink-soft); font-size: 13px; font-style: italic; }
.assumption {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 8px 0 18px;
}
.step-list { counter-reset: step; margin: 4px 0 8px; list-style: none; }
.step-list li {
  counter-increment: step;
  display: flex;
  gap: 13px;
  padding: 10px 0;
  font-size: 15px;
  line-height: 1.55;
}
.step-list li::before {
  content: counter(step);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  width: 27px; height: 27px;
  flex: none;
  border-radius: 50%;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
}
.note-card {
  background: var(--butter-wash);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: var(--shadow);
  margin: 16px 0;
}
.note-card b { font-weight: 600; }
.cost-card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0;
}
.cost-card .leader { margin-bottom: 8px; font-size: 15px; }
.cost-card .leader:last-child { margin-bottom: 0; }
.cost-card .save {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--green);
  margin-top: 12px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 10px 0 2px;
}

/* ————— groceries ————— */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 4px;
  margin: 4px 0 20px;
}
.seg button {
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
}
.seg button.on {
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.gro-group-head {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 20px 0 8px;
}
.gro-row {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 13px;
  margin-bottom: 9px;
  transition: opacity 350ms var(--ease-out), transform 350ms var(--ease-out);
}
.gro-row .illus {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 10px;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
}
.gro-row .illus svg { width: 34px; height: 34px; }
.gro-row .body { flex: 1; min-width: 0; }
.gro-row .name { font-weight: 600; font-size: 15.5px; position: relative; display: inline-block; }
.gro-row .name .strike {
  position: absolute;
  left: -3px; right: -3px;
  top: 54%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 380ms var(--ease-out);
}
.gro-row.checked .name .strike { transform: scaleX(1); }
.gro-row.checked { opacity: 0.62; }
.gro-row .qty { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.gro-row .tick {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 250ms var(--ease-out);
  position: relative;
}
/* real 48px hit area — box-shadow never receives taps */
.gro-row .tick::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}
.gro-row .tick svg { width: 15px; height: 15px; }
.gro-row.checked .tick {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
}
.gro-add {
  display: flex;
  gap: 9px;
  margin: 18px 0 8px;
}
.gro-add input {
  flex: 1;
  border: 1.5px solid var(--hairline);
  background: var(--cream);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.gro-add input::placeholder { color: var(--ink-soft); }
.gro-add button {
  border: none;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  font-size: 14.5px;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
}
.cart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 8px;
}

/* ————— trending ————— */

.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.refresh-btn {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  margin-top: 16px;
}
.refresh-btn svg { width: 19px; height: 19px; }
.refresh-btn.spin svg { animation: spin 900ms var(--ease-out); }
@keyframes spin { to { transform: rotate(360deg); } }

.trend-card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 15px;
  margin-bottom: 13px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.trend-card .illus {
  width: 58px; height: 58px;
  flex: none;
  border-radius: 12px;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
}
.trend-card .illus svg { width: 42px; height: 42px; }
.trend-card .body { flex: 1; min-width: 0; }
.trend-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17.5px;
  line-height: 1.2;
}
.trend-card .why {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 4px 0 9px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.tag.protein { background: var(--tomato-wash); color: #8C3315; }
.tag.save-btn {
  background: none;
  border: 1.5px solid var(--hairline);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag.save-btn svg { width: 11px; height: 11px; }
.day-add { display: inline-flex; align-items: center; gap: 5px; }
.day-add svg { width: 11px; height: 11px; }
.tag.save-btn:disabled { opacity: 0.5; cursor: default; }
.trend-foot {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
  padding: 14px 0 4px;
}

/* ————— tab bar ————— */

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--hairline-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--ink); }

/* ————— sheets ————— */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet .scrim {
  position: absolute;
  inset: 0;
  background: rgba(35, 32, 27, 0.42);
  border: none;
  cursor: pointer;
}
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 82dvh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lift);
  animation: sheet-up 380ms var(--ease-out);
}
@keyframes sheet-up {
  from { transform: translateY(48px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.sheet-panel .grab {
  width: 40px; height: 4.5px;
  border-radius: 3px;
  background: var(--hairline);
  margin: 6px auto 16px;
}
.sheet-panel h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  margin-bottom: 16px;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: var(--cream);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: var(--sans);
}
.picker-row .illus {
  width: 46px; height: 46px; flex: none;
  border-radius: 10px;
  background: var(--paper-deep);
  display: grid; place-items: center;
}
.picker-row .illus svg { width: 34px; height: 34px; }
.picker-row .t { font-family: var(--serif); font-weight: 600; font-size: 16px; color: var(--ink); }
.picker-row .d { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }

/* settings */

.set-block { margin-bottom: 24px; }
.set-block > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.set-block input[type="text"], .set-block input[type="number"] {
  width: 100%;
  border: 1.5px solid var(--hairline);
  background: var(--cream);
  border-radius: 12px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
}
.set-person {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  margin-bottom: 14px;
}
.set-person .row2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-top: 10px; }
.set-person .row2 label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.set-person .name-line { display: flex; gap: 10px; align-items: center; }
.set-person .name-line input { flex: 1; min-width: 0; border: 1.5px solid var(--hairline); background: var(--paper); border-radius: 10px; padding: 9px 12px; font-size: 15px; font-family: var(--sans); color: var(--ink); }
.set-person .row2 input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--hairline);
  background: var(--paper);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
}
.swatches { display: flex; gap: 7px; }
.swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.green  { background: var(--green); }
.swatch.berry  { background: var(--berry); }
.swatch.butter { background: var(--butter); }
.swatch.yolk   { background: var(--yolk); }
.swatch.on { border-color: var(--ink); }
.sync-card {
  background: var(--paper-deep);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.sync-card b { color: var(--ink); }
.sync-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.sync-dot.live { background: var(--green); }
.sync-dot.local { background: var(--yolk); }

/* ————— empty states ————— */

.empty {
  text-align: center;
  padding: 34px 20px;
  background: var(--paper-deep);
  border-radius: var(--radius);
}
.empty .illus { margin-bottom: 10px; }
.empty .illus svg { width: 60px; height: 60px; opacity: 0.8; }
.empty p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.empty .btn-quiet { margin-top: 6px; color: var(--ink); text-decoration: underline; }

/* ————— toast ————— */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  animation: toast-in 320ms var(--ease-out);
  max-width: 86vw;
  text-align: center;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast.gone { opacity: 0; transition: opacity 300ms; }

/* ————— wider screens: the ledger sits on the desk ————— */

@media (min-width: 720px) {
  body { background: var(--paper-deep); }
  #app {
    background: var(--paper);
    box-shadow: var(--shadow-lift);
    border-radius: 0;
    min-height: 100dvh;
  }
  .tabbar { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 0; }
}
