/* Bakease — "ink & caramel", the pâtisserie member of the Ease family.
   Built on NovelEase's language: editorial headers (small coloured label over
   a large Fraunces title), quiet surfaces with no boxes-in-boxes, one
   floating tab bar, three radii and a 4-pt scale. Light is a warm daylight
   kitchen; dark is NovelEase's lamp-lit ink, with gold for the accent.
   Figures stay tabular throughout: this is a costing tool first. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-italic.woff2') format('woff2');
  font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('fonts/outfit.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light dark;

  /* daylight kitchen */
  --porcelain:  #f6f1e9;              /* page */
  --surface:    #fffdf9;              /* cards */
  --raised:     #ffffff;              /* inputs, segmented pill */
  --ink:        #1c1726;              /* warm ink, NovelEase's hue */
  --ink-soft:   #554e63;
  --ink-faint:  #857d92;              /* ≥4.5:1 on surface at 12 px */
  --line:       #ece5da;
  --line-firm:  #dcd2c3;

  --accent:     #b8692a;              /* caramel */
  --blue:       #9a5418;              /* links and quiet actions: caramel, darker for contrast */
  --blue-wash:  #f7e7d4;
  --action:     #1c1726;              /* primary buttons */
  --on-action:  #fdf8f0;

  --rust:       #a83a2c;  --rust-wash:  #f8e4df;
  --moss:       #33744a;  --moss-wash:  #e2f0e5;
  --amber:      #8a5d0c;  --amber-wash: #f8ecd2;

  --shadow:     0 1px 2px rgba(28, 23, 38, .04), 0 6px 18px rgba(28, 23, 38, .05);
  --bar-bg:     rgba(255, 253, 249, .86);

  --r-s: 8px;  --r-m: 12px;  --r-l: 20px;
  --tap: 44px; --pad: 16px;

  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;

  /* Android: Capacitor's SystemBars sets --safe-area-inset-* (older Android
     WebViews report env() as 0). iPhone: WKWebView reports the notch and home
     indicator through env(), and the variables may be unset or 0 there. The
     larger of the two is right on both, and in a browser. */
  --safe-top: max(var(--safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    /* NovelEase's ink */
    --porcelain:  #120f1d;
    --surface:    #1d1930;
    --raised:     #241f3a;
    --ink:        #f6f2fb;
    --ink-soft:   #cfc6dc;
    --ink-faint:  #a99fba;
    --line:       rgba(255, 255, 255, .07);
    --line-firm:  rgba(255, 255, 255, .14);

    --accent:     #f5b84b;              /* NovelEase gold */
    --blue:       #f5b84b;
    --blue-wash:  rgba(245, 184, 75, .13);
    --action:     #f5b84b;
    --on-action:  #1c1726;

    --rust:  #ff8a7a;  --rust-wash:  rgba(255, 138, 122, .13);
    --moss:  #7fd1a0;  --moss-wash:  rgba(127, 209, 160, .12);
    --amber: #eac16b;  --amber-wash: rgba(234, 193, 107, .13);

    --shadow:  none;
    --bar-bg:  rgba(27, 22, 41, .86);
  }
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--porcelain); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body {
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(96px + var(--safe-bottom));
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
::selection { background: var(--blue-wash); }

main { padding: 0 var(--pad) var(--pad); max-width: 720px; margin: 0 auto; position: relative; }
main.enter { animation: screenIn .18s ease-out; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- app bar
   Transparent over the masthead; once the big title scrolls away a compact
   bar fades in with the same title on a blurred backdrop (NovelEase's
   ScreenTitle). Sub-screens show it from the start. */
.appbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-top);
  transition: background .18s ease-out, box-shadow .18s ease-out;
}
.appbar .inner {
  max-width: 720px; margin: 0 auto; height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 calc(var(--pad) - 6px) 0 var(--pad);
}
.appbar .title {
  font-size: 16px; font-weight: 600; opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease-out, transform .18s ease-out;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar.compact {
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}
.appbar.compact .title { opacity: 1; transform: none; }

.icon-btn {
  width: 40px; height: 40px; padding: 0; flex: none;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- masthead
   Small coloured label with its rule, large serif title, italic lead-in
   word; each tab has its own pair of colours and a soft glow behind. */
.masthead { position: relative; margin: -4px 0 20px; --c1: #e0a04b; --c2: #f07c5b; }
.masthead::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -230px; left: -120px; width: 760px; height: 400px;
  background:
    radial-gradient(40% 55% at 22% 45%, color-mix(in srgb, var(--c1) 22%, transparent) 0%, transparent 70%),
    radial-gradient(34% 50% at 62% 38%, color-mix(in srgb, var(--c2) 18%, transparent) 0%, transparent 70%);
}
.masthead .label {
  display: flex; align-items: center; gap: 7px; margin: 0 0 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: color-mix(in srgb, var(--c1) 72%, var(--ink));
}
.masthead .label::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
}
.masthead h1 {
  font-family: var(--serif); font-size: 36px; font-weight: 640;
  font-variation-settings: 'opsz' 144; letter-spacing: -0.6px; line-height: 1.08;
}
.masthead h1 em { font-style: italic; font-weight: 500; color: var(--ink-soft); }
.masthead .sub { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
@media (prefers-color-scheme: dark) {
  .masthead .label { color: var(--c1); }
  .masthead::before {
    background:
      radial-gradient(40% 55% at 22% 45%, color-mix(in srgb, var(--c1) 20%, transparent) 0%, transparent 70%),
      radial-gradient(34% 50% at 62% 38%, color-mix(in srgb, var(--c2) 16%, transparent) 0%, transparent 70%);
  }
}

/* ---------------------------------------------------------------- tab bar
   One floating bar, icon over label on every tab, a tinted pill behind the
   active icon. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 10px calc(10px + var(--safe-bottom));
  pointer-events: none;
}
.tabbar .bar-inner {
  pointer-events: auto;
  max-width: 560px; margin: 0 auto; height: 64px;
  display: grid; grid-template-columns: repeat(6, 1fr); align-items: center;
  padding: 0 4px; border-radius: 26px;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(28, 23, 38, .14);
}
.tabbar button {
  height: 58px; border: none; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-faint); font: inherit; font-size: 10.5px; font-weight: 500;
  transition: color .2s;
}
.tabbar .pill {
  position: relative; width: 48px; height: 28px; display: grid; place-items: center;
}
.tabbar .pill::before {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: var(--blue-wash); opacity: 0; transform: scaleX(.5);
  transition: opacity .2s, transform .2s;
}
.tabbar button[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar button[aria-current="page"] .pill::before { opacity: 1; transform: none; }
.tabbar svg { position: relative; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- surfaces
   A section is a quiet card: label inside, rows separated by hairlines. */
.section {
  background: var(--surface); border-radius: var(--r-l);
  padding: 14px 16px 10px; margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.section > h2 {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 4px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.section > h2 span { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.card .section, .section .section, .lotblock .section { background: none; box-shadow: none; padding: 0; margin: 0 0 12px; border-radius: 0; }

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .lead { min-width: 0; }
.row .name { font-size: 15.5px; font-weight: 500; }
.row .meta { font-size: 12.5px; color: var(--ink-faint); }
.row .amt { font-size: 15.5px; text-align: right; white-space: nowrap; font-weight: 500; }
.row .amt .meta { font-size: 12.5px; font-weight: 400; }
.section > .row:last-of-type { border-bottom: none; }

button.row {
  width: 100%; text-align: left; background: none; border-left: none;
  border-right: none; border-top: none; font: inherit; color: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums; border-radius: 0;
}
button.row::after {
  content: ""; width: 7px; height: 7px; flex: none; margin-left: 2px;
  border-right: 1.7px solid var(--ink-faint); border-top: 1.7px solid var(--ink-faint);
  transform: rotate(45deg);
}
/* lists of tappable rows that sit straight on the page (no section) */
main > button.row { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 8px; border: none; box-shadow: var(--shadow); }

.card {
  background: var(--surface); border-radius: var(--r-l);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card.warn { background: var(--amber-wash); box-shadow: none; }
.card.warn .note { color: var(--ink-soft); }

/* the hero figure: cost per portion, profit, the number you came for */
.figure { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 16px; }
.figure b {
  font-family: var(--serif); font-size: 44px; font-weight: 600;
  font-variation-settings: 'opsz' 144; letter-spacing: -0.02em; line-height: 1;
}
.figure small { font-size: 13.5px; color: var(--ink-soft); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pane { background: var(--surface); border-radius: var(--r-l); padding: 14px 15px; box-shadow: var(--shadow); }
.pane .k { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint); }
.pane .v {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  font-variation-settings: 'opsz' 144; letter-spacing: -0.02em; margin-top: 2px;
}

/* lot chip — a batch of stock, priced when it was bought */
.lot {
  display: inline-block; font-size: 11.5px; padding: 1px 8px;
  border-radius: 999px; color: var(--ink-soft); background: var(--line);
}
.lot.first { color: var(--moss); background: var(--moss-wash); }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.tag.blue  { background: var(--blue-wash);  color: var(--blue); }
.tag.moss  { background: var(--moss-wash);  color: var(--moss); }
.tag.amber { background: var(--amber-wash); color: var(--amber); }
.tag.rust  { background: var(--rust-wash);  color: var(--rust); }
.tag.grey  { background: var(--line);       color: var(--ink-soft); }

.neg { color: var(--rust); }
.pos { color: var(--moss); }

.empty {
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow);
  color: var(--ink-soft); font-size: 14.5px; padding: 22px 18px; margin-bottom: 14px;
}
.empty b {
  display: block; margin-bottom: 4px; color: var(--ink);
  font-family: var(--serif); font-size: 21px; font-weight: 600; font-variation-settings: 'opsz' 144;
}

.note { font-size: 12.5px; color: var(--ink-faint); margin: 8px 0 0; }
.note.fine { font-size: 11.5px; line-height: 1.5; }
.err  { font-size: 13.5px; color: var(--rust); margin: 6px 0 0; min-height: 1px; }

/* ---------------------------------------------------------------- Pro plans
   Two quiet cards side by side; the chosen one takes the accent edge. Prices
   in Fraunces, like every other figure you came for. */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 4px; }
.plan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-l);
  padding: 14px 14px 13px; box-shadow: var(--shadow); cursor: pointer; min-width: 0;
}
.plan[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--blue-wash); }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; flex-wrap: wrap; }
.plan-name { font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); }
.plan-price {
  font-family: var(--serif); font-size: 26px; font-weight: 600;
  font-variation-settings: 'opsz' 144; letter-spacing: -0.02em; line-height: 1.1;
}
.plan-price small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.plan-sub { font-size: 12.5px; color: var(--ink-faint); }
.linkbtn { border: none; background: none; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
.note.fine a { color: var(--blue); }

/* ---------------------------------------------------------------- controls */
button, input, select, textarea { font: inherit; color: var(--ink); font-variant-numeric: tabular-nums; }

.btn {
  min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line-firm); border-radius: var(--r-m);
  background: var(--raised); color: var(--ink); font-weight: 500;
  cursor: pointer; transition: transform .08s;
}
.btn.primary { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 600; }
.btn.quiet { border: none; background: none; color: var(--blue); padding: 0; min-height: 40px; font-weight: 600; }
.btn.danger { color: var(--rust); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
button:not(.noPress):not(:disabled):active { transform: scale(.97); }

.btnrow { display: flex; gap: 8px; margin: 14px 0; }
.btnrow .btn { flex: 1; }

input, select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 9px 12px;
  background: var(--raised);
  border: 1px solid var(--line-firm); border-radius: var(--r-m);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
textarea { min-height: 76px; resize: vertical; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
optgroup { font-style: normal; color: var(--ink-faint); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control: a pill track, the chosen one lifted */
.seg { display: grid; gap: 3px; background: var(--line); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
.seg button {
  min-height: 36px; border: none; border-radius: 999px; background: none;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(28,23,38,.12); }

/* stepper */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 10px 12px 10px 16px; margin-bottom: 14px;
}
.stepper .controls { display: flex; align-items: center; gap: 14px; }
.stepper .controls b { font-family: var(--serif); font-size: 24px; font-weight: 600; min-width: 34px; text-align: center; }
.stepper .btn { width: 42px; height: 42px; min-height: 42px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }

/* check toggle */
.check {
  width: 32px; height: 32px; min-height: 32px; flex: none; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--line-firm); background: var(--raised);
  color: transparent; cursor: pointer; font-size: 15px; line-height: 1;
}
.check[aria-pressed="true"] { border-color: var(--moss); background: var(--moss-wash); color: var(--moss); }
.row.muted .name, .row.muted .meta { color: var(--ink-faint); }

/* bars */
.bar { margin-bottom: 12px; }
.bar .lab { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.bar .track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar.rev .fill { background: var(--moss); }
.bar.cost .fill { background: var(--rust); }

/* video link */
.video {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 14px;
}
.video .play {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--rust-wash); color: var(--rust);
  display: grid; place-items: center; font-size: 13px;
}
.video .t { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 14px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-faint); padding-bottom: 4px; }
.cal button {
  min-height: 44px; border: none; border-radius: var(--r-m);
  background: none; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 14px;
}
.cal button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
.cal .dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.cal .dot.on { background: var(--accent); }
.cal button[aria-pressed="true"] .dot.on { background: var(--on-action); }
.cal .today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

.stop { border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 12px; margin-bottom: 8px; border-radius: 0 var(--r-m) var(--r-m) 0; }

/* ---------------------------------------------------------------- bars that float over everything */

/* running timers — visible from any tab, because you will walk away from the recipe */
.timerbar {
  position: sticky; top: calc(52px + var(--safe-top)); z-index: 25;
  margin: 0 auto 10px; max-width: 720px;
  padding: 0 var(--pad);
  display: flex; flex-direction: column; gap: 6px;
}
.timerbar .t {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; padding: 8px 10px 8px 14px; border-radius: var(--r-m);
  background: var(--action); color: var(--on-action); box-shadow: 0 6px 18px rgba(28,23,38,.18);
}
.timerbar .t b { font-family: var(--serif); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timerbar .t .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; font-size: 13px; }
.timerbar .t button { min-height: 32px; padding: 0 12px; font-size: 13px; background: transparent; color: inherit; border-color: currentColor; }
.timerbar .done { color: #ffb4a8; font-weight: 600; }
.timerbar .hint { font-size: 12px; color: var(--ink-soft); }

/* a new release is waiting */
.updatebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 720px; margin: 0 auto 10px; padding: 10px 12px 10px 16px;
  font-size: 14px; border-radius: var(--r-m);
  background: var(--moss-wash); color: var(--ink);
}
.updatebar .btn { min-height: 34px; padding: 0 14px; }
.updatebar[hidden], .timerbar[hidden] { display: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom));
  transform: translate(-50%, 12px) scale(.97);
  background: var(--action); color: var(--on-action);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(28,23,38,.2);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 40; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------------------------------------------------------------- feature bits */

/* forward trace under each lot: who had this batch */
.lotblock { border-bottom: 1px solid var(--line); }
.lotblock:last-of-type { border-bottom: none; }
.lotblock > .row { border-bottom: none; }
.lotblock .went { margin: -4px 0 10px 12px; padding-left: 10px; border-left: 2px solid var(--line-firm); }
.lotblock .went > .meta { font-size: 12px; color: var(--ink-faint); padding-top: 2px; }
.row.trace { padding: 6px 0; border-bottom: none; }
.row.trace .name { font-size: 14px; font-weight: 400; }

/* to-buy groups: one block per supplier */
.buygroup { border-radius: var(--r-m); padding: 2px 12px 6px; margin: 6px 0 10px; background: var(--porcelain); }
.buygroup > .row:first-child { border-bottom: 1px solid var(--line); }

/* label preview: roughly the printed proportions, black on white whatever the theme */
.label-preview {
  background: #fff; color: #000; border: 1px dashed #c9c2b6; border-radius: var(--r-m);
  padding: 12px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.4;
  font-family: Arial, Helvetica, sans-serif;
}
.label-preview > div { margin-bottom: 5px; }
.label-preview .lbl-name { font-size: 16px; font-weight: 700; }

/* the privacy page, shown inside the app */
.privacy { background: var(--surface); border-radius: var(--r-l); padding: 6px 18px 18px; box-shadow: var(--shadow); }
.privacy h1 { font-family: var(--serif); font-size: 26px; margin: 12px 0 2px; }
.privacy h2 { font-size: 16px; margin: 20px 0 4px; color: var(--ink); }
.privacy p, .privacy li { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.privacy a { color: var(--blue); }
.privacy .small { font-size: 13px; color: var(--ink-faint); }

code { font-size: 12px; word-break: break-word; }

/* back links at the top of sub-screens */
main > .btn.quiet:first-child { margin-top: 2px; }
/* titles of sub-screens (order, ingredient, purchase order…) */
main > h2 { font-family: var(--serif); font-variation-settings: 'opsz' 144; font-weight: 640; letter-spacing: -0.4px; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  button:not(.noPress):active { transform: none; }
}

/* ---------------------------------------------------------------- print
   Printing exists for one reason here: handing a customer an invoice. */
@media print {
  .appbar, .tabbar, .btnrow, .btn, .toast, .timerbar, .updatebar, .card.warn, .masthead { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  main { max-width: none; padding: 0; }
  .card, .section { box-shadow: none; padding: 0; background: none; }
  .row { break-inside: avoid; }
}

/* rows built from spans (tappable rows are <button>s) still stack name over meta */
.row .lead > .name, .row .lead > .meta, .row .amt > .meta { display: block; }
.section > h2 { flex-wrap: wrap; row-gap: 2px; }
.section > h2 span { margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------- welcome
   First open only. No app bar or tab bar: one calm screen, the editorial
   title, three lines on what Bakease does, and the way in. */
body.onboarding { padding-bottom: calc(24px + var(--safe-bottom)); }
body.onboarding .appbar, body.onboarding .tabbar, body.onboarding .timerbar, body.onboarding .updatebar { display: none !important; }
.welcome {
  max-width: 460px; margin: 0 auto;
  padding: calc(48px + var(--safe-top)) 4px 8px;
  min-height: calc(100vh - 32px);
  display: flex; flex-direction: column; gap: 22px;
}
.welcome-head { position: relative; }
.welcome-head::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -170px; left: -140px; width: 700px; height: 380px;
  background:
    radial-gradient(38% 52% at 25% 50%, color-mix(in srgb, #e0a04b 24%, transparent) 0%, transparent 70%),
    radial-gradient(32% 46% at 62% 40%, color-mix(in srgb, #f07c5b 18%, transparent) 0%, transparent 70%);
}
.welcome-head .label {
  display: flex; align-items: center; gap: 7px; margin: 0 0 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: color-mix(in srgb, #e0a04b 72%, var(--ink));
}
.welcome-head .label::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #e0a04b, #f07c5b); }
.welcome-head h1 {
  font-family: var(--serif); font-size: 52px; font-weight: 640; line-height: 1;
  font-variation-settings: 'opsz' 144; letter-spacing: -1px;
}
.welcome-head .sub { margin: 10px 0 0; font-size: 16.5px; color: var(--ink-soft); }
.welcome-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.welcome-points li { position: relative; padding-left: 22px; }
.welcome-points li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, #e0a04b, #f07c5b);
}
.welcome-points b { display: block; font-size: 15.5px; }
.welcome-points span { font-size: 14px; color: var(--ink-soft); }
.welcome-actions, .welcome-alt { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: auto; }
.welcome-actions .btn.quiet, .welcome-alt .btn.quiet { align-self: center; }
.welcome-actions .note, .welcome-card .note { text-align: center; margin: 0; }
.welcome-card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.welcome-card h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-bottom: 8px; font-variation-settings: 'opsz' 144; }
.welcome-card .btn.quiet { align-self: center; }
@media (prefers-color-scheme: dark) {
  .welcome-head .label { color: #e0a04b; }
}
