/* Warm Tuscan palette, carried over from the original protocol page. */
:root {
  /*
   * Declaring this is not cosmetic. Without it, Chrome on Android is entitled
   * to run its own Force Dark pass over the page, darkening it by filtering at
   * the compositing level. That pass is a known source of stale, faintly
   * visible content whenever the page repaints, which is what was showing on
   * tab switches and on expanding a section. Declaring support turns it off,
   * and native controls and scrollbars follow the theme as a bonus.
   */
  color-scheme: light;
  --primary: #A33E18;
  --on-primary: #FFFFFF;
  --primary-container: #FFDBD0;
  --on-primary-container: #3B0900;
  --secondary: #58634A;
  --secondary-container: #DCE8C8;
  --on-secondary-container: #161E0C;
  --tertiary: #835400;

  --surface: #FDF8F7;
  --surface-lowest: #FFFFFF;
  --surface-low: #F8F2F0;
  --surface-high: #EDE6E4;
  --on-surface: #201A19;
  --on-surface-variant: #52433E;
  --outline: #85736E;
  --outline-variant: #D7C2BB;

  --good: #3F6C36;
  --good-bg: #E7F2E1;
  --warn: #8A5A00;
  --warn-bg: #FBEFD6;
  --bad: #A32118;
  --bad-bg: #FDE4E1;

  --c1: #A33E18; --c2: #58634A; --c3: #835400; --c4: #3C6E8F; --c5: #7A4A7E; --c6: #96703C;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .07), 0 6px 18px rgba(60, 30, 20, .05);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/*
 * Dark is applied by attribute, not by media query, so the in-app toggle can
 * override the operating system. An inline script in the head resolves the
 * choice before first paint, so there is no flash of the wrong theme.
 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #FFB59D;
  --on-primary: #5C1900;
  --primary-container: #7D2C09;
  --on-primary-container: #FFDBD0;
  --secondary: #C0CCAD;
  --secondary-container: #404A33;
  --on-secondary-container: #DCE8C8;

  --surface: #191111;
  --surface-lowest: #201817;
  --surface-low: #241B1A;
  --surface-high: #2E2422;
  --on-surface: #F0DEDA;
  --on-surface-variant: #D7C2BB;
  --outline: #A08C86;
  --outline-variant: #4A3B37;

  --good: #A7D69A; --good-bg: #24331F;
  --warn: #E8C07A; --warn-bg: #382C15;
  --bad: #FFB4AB; --bad-bg: #3A1512;

  --c1: #FFB59D; --c2: #C0CCAD; --c3: #E8C07A; --c4: #9BC6E4; --c5: #D6B0D9; --c6: #D3B78A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

body {
  /*
   * Always at least a viewport tall, plus a pixel.
   *
   * Screens differ hugely in height. When a tall one is replaced by a short
   * one the document can stop being scrollable, and Android Chrome responds by
   * animating its address bar back in. That resizes the viewport and forces a
   * re-raster, and the browser composites the outgoing frame while it happens,
   * which is the previous screen showing through for about a second. Keeping
   * the document permanently scrollable removes the trigger.
   */
  min-height: calc(100vh + 1px);
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  background: var(--surface);
  color: var(--on-surface);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(28px + var(--safe-bottom));
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; letter-spacing: -.015em; margin: 0; }

.msym {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25rem; line-height: 1; vertical-align: middle; user-select: none;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 10px; }

/* ------------------------------- chrome -------------------------------- */

.appbar {
  position: sticky; top: 0; z-index: 20;
  /*
   * Deliberately opaque, with no backdrop-filter.
   *
   * A blurred backdrop on a sticky element forces the whole scrolling page into
   * a texture that the compositor re-samples, and on Android that texture is
   * not always invalidated when the content is replaced. The result is the
   * previous screen ghosting through the new one for about a second. The blur
   * bought almost nothing over a 94% opaque bar, so it is gone.
   */
  background: var(--surface);
  border-bottom: 1px solid var(--outline-variant);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { font-size: 1.9rem; color: var(--primary); font-variation-settings: 'FILL' 1; }
.brand h1 { font-size: 1.15rem; font-weight: 700; }
.brand p { margin: 0; font-size: .75rem; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.progress-chip { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
/* display:flex would otherwise defeat the hidden attribute. */
.progress-chip[hidden] { display: none; }
.progress-track { width: 60px; height: 6px; background: var(--surface-high); border-radius: 99px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--secondary); border-radius: 99px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  /* No scroll-behavior here: it swallows the programmatic scroll that keeps
     the active tab in view during load. Each scrollTo passes its own. */
  padding: 6px 12px 8px;
  border-top: 1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--on-surface-variant);
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: 7px 13px; border-radius: 99px; cursor: pointer; white-space: nowrap;
}
.tab:hover { background: var(--surface-high); }
.tab.active { background: var(--primary-container); color: var(--on-primary-container); }
.tab .msym { font-size: 1.05rem; }

/* An opaque ground under the cards. Without it, a page that shrinks can leave
   the previous screen's tiles visible underneath until the next repaint. */
/*
 * An opaque ground under the cards, and no scroll anchoring. Every screen
 * replaces this element's contents wholesale, and anchoring tries to preserve
 * the scroll position against content that no longer exists.
 */
main { max-width: 1080px; margin: 0 auto; padding: 16px 14px 40px; display: grid; gap: 16px; background: var(--surface); overflow-anchor: none; }
.foot { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; }
.foot p { font-size: .74rem; color: var(--on-surface-variant); }

/* -------------------------------- cards -------------------------------- */

/* Both of these already clip their own overflow, so containment costs nothing
   and lets the browser invalidate one card rather than the whole page. */
.card { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; contain: layout paint; }
.card-head { padding: 14px 16px 0; }
.card-head h2 { font-size: 1.02rem; font-weight: 700; }
.card-head .sub { margin: 3px 0 0; font-size: .8rem; color: var(--on-surface-variant); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 12px; }

.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2.wide-left { grid-template-columns: 3fr 2fr; } }

/*
 * Field rows are a grid, not a flex line. With flex, a field carrying a hint
 * was taller than its neighbour and bottom alignment pushed the two labels out
 * of line. A grid gives every field in a row the same top edge.
 */
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px 10px; align-items: start; }
/* Button and chip rows, and rows that size their own columns, stay flex. */
.row.tight { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.tight > * { flex: 0 0 auto; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* -------------------------------- fields ------------------------------- */

.field { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; font-size: .78rem; min-width: 0; }
/* Reserve two lines so a label that wraps does not push its own input below
   the inputs beside it. */
.field-label { font-weight: 600; color: var(--on-surface-variant); display: flex; justify-content: space-between; gap: 8px; align-items: start; min-height: 2.5em; }
.field-input { display: flex; align-items: center; gap: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; font-family: inherit; font-size: .9rem; color: var(--on-surface);
  background: var(--surface-low); border: 1px solid var(--outline-variant);
  border-radius: 11px; padding: 9px 11px; min-width: 0;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.field .suffix { font-size: .78rem; color: var(--on-surface-variant); white-space: nowrap; }
.field .hint { font-size: .7rem; color: var(--on-surface-variant); line-height: 1.4; }
/* A field with a right answer says so under itself, in the verdict's colour. */
.field .hint.good { color: var(--good); }
.field .hint.warn { color: var(--warn); }
.field .hint.bad { color: var(--bad); }
.field.slider output { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  background: var(--surface-high); border-radius: 99px; padding: 0; border: 0;
  /*
   * A horizontal control has no business claiming a vertical gesture. Without
   * this, a swipe to scroll the page that happens to start on the track drags
   * the thumb instead, and the value appears to change on its own.
   */
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--surface-lowest); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface-lowest); cursor: pointer; }

/* ------------------------------- buttons ------------------------------- */

.btn {
  font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  border-radius: 99px; padding: 9px 16px; border: 1px solid transparent;
  background: var(--primary); color: var(--on-primary);
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--primary); border-color: var(--outline-variant); }
.btn.ghost:hover { background: var(--surface-high); }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; font-size: .75rem; }
.btn.icon-btn { padding: 7px 11px; min-width: 42px; font-variant-numeric: tabular-nums; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip {
  font-family: inherit; font-size: .76rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--outline-variant); background: var(--surface-low); color: var(--on-surface-variant);
  border-radius: 99px; padding: 6px 12px;
}
.chip.active { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { display: inline-block; white-space: nowrap; font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-high); color: var(--on-surface-variant); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.accent { background: var(--primary-container); color: var(--on-primary-container); }

/* -------------------------------- stats -------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.stat { background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 13px; padding: 10px 12px; display: grid; gap: 1px; }
.stat-label { font-size: .68rem; font-weight: 600; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-family: 'Fraunces', serif; font-size: 1.22rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.2; text-wrap: balance; }
/* A date or a phrase needs more room than a number; shrink rather than stack. */
.stat-value:not(:has(*)) { font-size: clamp(.95rem, 3.4vw, 1.22rem); }
.stat-sub { font-size: .7rem; color: var(--on-surface-variant); }

.note { margin: 0; font-size: .78rem; line-height: 1.5; padding: 11px 14px; border-radius: 11px; background: var(--surface-low); color: var(--on-surface-variant); border-left: 3px solid var(--outline); }
.note.good { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.note.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.note.neutral { border-color: var(--outline-variant); }

/* -------------------------------- tables ------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: 13px; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; }
th, td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--outline-variant); white-space: nowrap; }
th { background: var(--surface-low); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--on-surface-variant); cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-low); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------- protocol ------------------------------ */

.phase { border: 1px solid var(--outline-variant); border-radius: var(--radius); background: var(--surface-lowest); overflow: hidden; box-shadow: var(--shadow); contain: layout paint; }
.phase-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; background: var(--surface-low); border-bottom: 1px solid var(--outline-variant); }
.phase-head .msym { color: var(--primary); font-size: 1.4rem; }
.phase-head h3 { font-size: .93rem; font-weight: 700; }
.phase-head p { margin: 1px 0 0; font-size: .74rem; color: var(--on-surface-variant); }
.phase-steps { display: grid; gap: 8px; padding: 10px; }

.step { display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--outline-variant); border-radius: 14px; background: var(--surface); cursor: pointer; }
.step:hover { background: var(--surface-low); }
.step.done { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.step.done .step-title { text-decoration: line-through; color: var(--secondary); }
.step-check { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--outline); display: grid; place-items: center; margin-top: 2px; }
.step.done .step-check { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.step-check .msym { font-size: 1rem; opacity: 0; }
.step.done .step-check .msym { opacity: 1; }
.step-main { min-width: 0; flex: 1; }
.step-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: .89rem; }
.step-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 2px 0 4px; }
.step-time { font-size: .72rem; font-weight: 700; color: var(--primary); }
.step-body { font-size: .8rem; color: var(--on-surface-variant); margin: 0; }
.step-body strong { color: var(--on-surface); font-weight: 600; }
.step-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--outline-variant); }

/* -------------------------------- charts ------------------------------- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--outline-variant); stroke-width: 1; }
.chart .grid.strong { stroke: var(--outline); }
.chart .tick { font-family: 'Lora', serif; font-size: 11px; fill: var(--on-surface-variant); }
.chart .tick.strong { font-weight: 600; fill: var(--on-surface); }
.chart .tick.tiny { font-size: 9.5px; }
.chart .axis-label { font-family: 'Fraunces', serif; font-size: 12px; font-weight: 600; fill: var(--on-surface-variant); }
.chart .chart-empty { font-family: 'Lora', serif; font-size: 13px; fill: var(--on-surface-variant); }
.chart .dot { stroke: var(--surface-lowest); stroke-width: 1.5; cursor: pointer; }
.chart .dot.hi { stroke: var(--on-surface); stroke-width: 2.5; }
.chart .trend { stroke: var(--outline); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .line { fill: none; stroke-width: 2.5; }
.chart .marker { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .bar { }
.chart .radar-ring { fill: none; stroke: var(--outline-variant); }
.chart .radar-shape { stroke-width: 2; }
.chart .seg { }
.chart .seg-label { font-family: 'Fraunces', serif; font-size: 11px; font-weight: 600; fill: #fff; }

/* ------------------------------ simulator ------------------------------ */

.sim { display: grid; gap: 12px; }
.sim-stage { display: grid; gap: 3px; }
.sim-oven { position: relative; max-width: 420px; margin: 0 auto; width: 100%; aspect-ratio: 1.35; background: radial-gradient(circle at 50% 92%, #6b1d05, #2a0f06 70%); border-radius: 16px; display: grid; place-items: center; overflow: hidden; }
.sim-pizza { width: 52%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #E9C27E 55%, #C98B3E 76%, #8B4A18 100%); transition: transform .45s cubic-bezier(.2,0,0,1); box-shadow: 0 0 40px rgba(255,150,60,.45); position: relative; }
.sim-north { position: absolute; top: -3px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.sim-flame { position: absolute; left: 8px; top: 8px; font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.flame-warm { background: #FBEFD6; color: #8A5A00; }
.flame-hot { background: #FDE4E1; color: #A32118; }
.flame-done { background: var(--secondary-container); color: var(--on-secondary-container); }

/* -------------------------------- misc --------------------------------- */

.list { display: grid; gap: 9px; }
.item { border: 1px solid var(--outline-variant); border-radius: 14px; padding: 11px 13px; background: var(--surface-lowest); display: grid; gap: 6px; }
.item.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; align-items: flex-start; }
.item-head > *:first-child { flex: 1 1 190px; min-width: 0; }
.item-head > *:last-child { flex: 0 0 auto; }
.item-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: .92rem; }
.item-sub { font-size: .74rem; color: var(--on-surface-variant); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.score-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; }
.rating { font-family: 'Fraunces', serif; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.stars { letter-spacing: 1px; color: var(--tertiary); font-size: .8rem; }

.toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); background: var(--on-surface); color: var(--surface); padding: 10px 18px; border-radius: 99px; font-size: .8rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(20,10,8,.45); display: grid; place-items: center; z-index: 70; padding: 20px; }
.modal { background: var(--surface-lowest); border-radius: var(--radius); padding: 20px; max-width: 420px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.modal p { margin: 0; font-size: .88rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.empty { text-align: center; padding: 30px 18px; color: var(--on-surface-variant); font-size: .85rem; }
.empty .msym { font-size: 2.4rem; display: block; margin-bottom: 8px; opacity: .5; }

.src-list { font-size: .74rem; color: var(--on-surface-variant); display: grid; gap: 4px; padding-left: 18px; }
.src-list a { color: var(--primary); }

details.foldout { border: 1px solid var(--outline-variant); border-radius: 12px; padding: 10px 12px; background: var(--surface-low); }
details.foldout summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--on-surface-variant); }
details.foldout[open] summary { margin-bottom: 8px; }

/* ------------------------------- narrow ------------------------------- */

@media (max-width: 560px) {
  main { padding: 12px 10px 32px; gap: 12px; }
  .card-body { padding: 12px 12px 14px; }
  .card-head { padding: 12px 12px 0; }
  .row { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .brand h1 { font-size: 1.05rem; }
  .brand p { max-width: 40vw; }
  /* The bar is decorative; the count is the information. */
  .progress-track { display: none; }
  .item-actions .btn { flex: 1 1 auto; }
  .phase-steps { padding: 8px; }
  .step { padding: 10px; gap: 9px; }
  .step-metrics { grid-template-columns: 1fr; }
  th, td { padding: 7px 9px; }
}

/* Nothing in this app needs to move. Honour the system setting outright. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------ editing bar ----------------------------- */

.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface-lowest);
  border-top: 1px solid var(--outline-variant);
  box-shadow: 0 -4px 18px rgba(60, 30, 20, .10);
  padding: 10px 14px calc(10px + var(--safe-bottom));
}
.save-bar[hidden] { display: none; }
.save-bar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.save-bar-what { min-width: 0; display: grid; gap: 1px; }
.save-bar-name {
  font-family: 'Fraunces', serif; font-weight: 700; font-size: .92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.save-bar-note { font-size: .72rem; color: var(--on-surface-variant); }
.save-bar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* Keep the bar from covering the end of the page. */
body.has-save-bar { padding-bottom: calc(84px + var(--safe-bottom)); }

/* Real times against planned times. */
.stamp-edit { margin-top: 6px; max-width: 230px; }
.stamp-edit .field-label { font-size: .68rem; }
.stamp-edit input { font-size: .8rem; padding: 5px 8px; }
tr.row-live td { background: var(--surface-low); }
td.num.warn { color: var(--warn); }

/* Running late: the ways out, one row each. */
.stack { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: 11px;
  background: var(--surface-low); border: 1px solid var(--outline-variant);
}
.choice-body { flex: 1 1 220px; min-width: 0; }
.choice-title { margin: 0 0 3px; font-size: .84rem; font-weight: 600; color: var(--on-surface); }
.choice-note { margin: 0; font-size: .76rem; line-height: 1.5; color: var(--on-surface-variant); }
.choice .btn { flex: 0 0 auto; }

/* The planned-against-actual table has to fit a phone. */
table.compact { font-size: .78rem; }
table.compact th, table.compact td { padding: 7px 8px; }
table.compact td:first-child { line-height: 1.35; }
table.compact .hint { display: block; font-size: .68rem; }


/* Photographs of a bake. */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 6px 0; }
.photo { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-low); border: 1px solid var(--outline-variant); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
}
.photo-remove .msym { font-size: 16px; }
.lightbox { display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; }

/* The step-by-step record of a finished bake. */
/* Every step of a filed bake, each time correctable where it is shown. */
.step-log-edit { display: grid; gap: 10px; margin-top: 4px; }
.step-log-edit .stamp-edit { margin-top: 0; max-width: none; }
.step-log-edit .stamp-edit .field-label { font-size: .78rem; }
@media (min-width: 620px) { .step-log-edit { grid-template-columns: 1fr 1fr; } }
.photo-missing {
  width: 100%; height: 100%; display: grid; place-content: center; gap: 2px;
  text-align: center; font-size: .66rem; color: var(--on-surface-variant);
}
.photo-missing .msym { font-size: 20px; }
