/* style.css — Bean & Leaf menu costing
   Direction: a café's working ledger — leaf green and roasted brown on a cool sage paper.
   Fonts: Bricolage Grotesque (display) + Figtree (body), with system fallbacks. */

:root {
  --bg: #e9eee8;
  --surface: #ffffff;
  --surface-2: #f3f6f1;
  --ink: #18231d;
  --ink-2: #4f5d55;
  --ink-3: #7a877f;
  --line: #d3dcd3;
  --accent: #2b6a4c;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe1;
  --roast: #6b3f24;
  --roast-soft: #f1e6dc;
  --good: #23764a;
  --warn: #a85a06;
  --bad: #b42318;
  --good-soft: #def1e5;
  --warn-soft: #fbecd7;
  --bad-soft: #fbe2df;
  --track: #e2e8e2;
  --shadow: 0 1px 0 rgba(24, 35, 29, .04), 0 6px 20px -12px rgba(24, 35, 29, .25);
  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #19221d; --surface-2: #1f2a24; --ink: #e3ebe5; --ink-2: #a6b3ab; --ink-3: #7e8c84;
    --line: #2d3a33; --accent: #78c99f; --accent-ink: #0d1a13; --accent-soft: #1f3a2c; --roast: #d8a77c; --roast-soft: #33251b;
    --good: #72d29d; --warn: #f2a855; --bad: #f58a80; --good-soft: #193526; --warn-soft: #3a2a14; --bad-soft: #3d1d1a;
    --track: #2a362f; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #19221d; --surface-2: #1f2a24; --ink: #e3ebe5; --ink-2: #a6b3ab; --ink-3: #7e8c84;
  --line: #2d3a33; --accent: #78c99f; --accent-ink: #0d1a13; --accent-soft: #1f3a2c; --roast: #d8a77c; --roast-soft: #33251b;
  --good: #72d29d; --warn: #f2a855; --bad: #f58a80; --good-soft: #193526; --warn-soft: #3a2a14; --bad-soft: #3d1d1a;
  --track: #2a362f; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app { max-width: 1240px; margin: 0 auto; padding: 20px 20px 64px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn-danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1a0d0b; }
.btn-icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 0 22px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transform: rotate(-6deg); }
.brand-name { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.02em; }
.brand-tag { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved { font-size: 13px; color: var(--good); opacity: 0; transition: opacity .3s; margin-right: 4px; }
.saved.show { opacity: 1; }

/* ---------- summary ---------- */
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0;
}
.tile:first-child { background: var(--roast); border-color: var(--roast); color: var(--roast-soft); }
:root[data-theme="dark"] .tile:first-child { color: #1d130c; }
.tile:first-child .tile-label, .tile:first-child .tile-sub { color: inherit; opacity: .8; }
.tile-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile-value { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-alert { cursor: pointer; font: inherit; color: inherit; }
.tile-alert.is-on { background: var(--warn-soft); border-color: var(--warn); }
.tile-alert.is-on .tile-label, .tile-alert.is-on .tile-value { color: var(--warn); }
.tile-alert .i { width: 15px; height: 15px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  background: none; border: 0; padding: 12px 16px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px;
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip .count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.is-active .count { color: inherit; opacity: .7; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search input, .select-wrap select {
  min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px;
}
.search input { padding-left: 38px; width: 220px; max-width: 100%; }

/* ---------- menu groups & cards ---------- */
.group { margin-bottom: 30px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.group-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.group-head span { color: var(--ink-3); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
  position: relative;
}
.card.s-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 24px; }
.cat-tag { font-size: 12px; font-weight: 700; color: var(--roast); background: var(--roast-soft); border-radius: 6px; padding: 3px 8px; }
.batch-tag { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-left: 6px; }
.badge-below { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--bad); background: var(--bad-soft); border-radius: 999px; padding: 3px 9px; }
.badge-below .i { width: 13px; height: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-name { min-width: 0; }
.card-name h3 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.card-ings { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.card-error { margin: 0; font-size: 13px; color: var(--bad); display: flex; gap: 6px; align-items: flex-start; }

.donut { position: relative; width: 58px; height: 58px; flex: none; }
.donut svg { display: block; }
.donut-track { fill: none; stroke: var(--track); stroke-width: 6; }
.donut-fill { fill: none; stroke-width: 6; stroke-linecap: round; stroke: var(--ink-3); transition: stroke-dasharray .4s ease; }
.donut-target { stroke: var(--ink); stroke-width: 2; opacity: .55; }
.donut.s-good .donut-fill { stroke: var(--good); }
.donut.s-warn .donut-fill { stroke: var(--warn); }
.donut.s-bad .donut-fill { stroke: var(--bad); }
.donut-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.s-good .donut-label { color: var(--good); }
.s-warn .donut-label { color: var(--warn); }
.s-bad .donut-label { color: var(--bad); }

.hpp { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.mini-label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.hpp-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown { margin: 0; font-size: 12px; color: var(--ink-2); text-align: right; }
.breakdown div { display: flex; gap: 8px; justify-content: flex-end; }
.breakdown dt { color: var(--ink-3); }
.breakdown dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }

.bar { position: relative; height: 6px; border-radius: 99px; background: var(--track); }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--ink-3); transition: width .4s ease; }
.bar i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink); opacity: .5; border-radius: 1px; }
.s-good .bar span { background: var(--good); }
.s-warn .bar span { background: var(--warn); }
.s-bad .bar span { background: var(--bad); }

.price-block, .delivery { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.delivery { border-top: 1px dashed var(--line); padding-top: 10px; }
.price-field { display: flex; flex-direction: column; gap: 2px; }
.inline-price {
  width: 120px; font-family: var(--font-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 8px; background: var(--surface);
}
.inline-price:hover { border-color: var(--ink-3); }
.price-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--ink-2); gap: 1px; }
.price-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.m-good { color: var(--good) !important; }
.m-warn { color: var(--warn) !important; }
.m-bad { color: var(--bad) !important; }
.suggest { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-sm); padding: 6px 10px; }
.suggest b { color: var(--ink); font-variant-numeric: tabular-nums; }
.on-target { font-size: 13px; color: var(--good); font-weight: 600; }

.card-actions { display: flex; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.act { background: none; border: 0; padding: 6px 8px; border-radius: var(--r-sm); display: inline-flex; gap: 5px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.act .i { width: 15px; height: 15px; }
.act:hover { background: var(--surface-2); color: var(--ink); }
.act-danger:hover { color: var(--bad); background: var(--bad-soft); }
.card-actions .act-danger { margin-left: auto; }

.add-card {
  border: 2px dashed var(--line); border-radius: var(--r-lg); background: transparent; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-2); font-weight: 600; cursor: pointer;
}
.add-card:hover { border-color: var(--accent); color: var(--accent); }
.add-card .i { width: 26px; height: 26px; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }

/* ---------- ingredients table ---------- */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 13px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing-name { font-weight: 600; display: block; }
.ing-note { font-size: 13px; color: var(--ink-3); }
.per { color: var(--ink-3); font-size: 13px; }
.row-actions { white-space: nowrap; text-align: right; }
.empty-cell { text-align: center; color: var(--ink-2); padding: 32px; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.set-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.set-block h2 { font-size: 20px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .oh-row input, .cat-row input, .line input, .line select {
  min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 8px 10px; width: 100%;
}
.field input:focus, .field select:focus, .oh-row input:focus, .cat-row input:focus, .line input:focus, .line select:focus { border-color: var(--accent); }
.hint { font-size: 12px; color: var(--ink-3); }
.note { margin: 0; font-size: 14px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.oh-list { display: flex; flex-direction: column; gap: 8px; }
.oh-list.is-off { opacity: .45; }
.oh-row, .cat-row { display: grid; grid-template-columns: 1fr 130px 40px; gap: 8px; align-items: center; }
.cat-row { grid-template-columns: 1fr auto 40px; }
.cat-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.oh-list > .btn, .set-block > .btn { align-self: flex-start; }
.oh-result { display: grid; grid-template-columns: auto auto; gap: 2px 12px; align-items: baseline; background: var(--accent-soft); border-radius: var(--r-sm); padding: 10px 12px; align-self: end; }
.oh-result b { font-variant-numeric: tabular-nums; text-align: right; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 42px; height: 24px; border-radius: 99px; background: var(--track); position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- dialogs ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 18, 14, .5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.overlay[hidden] { display: none; }
.overlay-top { z-index: 60; }
.overlay-top2 { z-index: 70; }
.dialog { background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.dialog-wide { width: min(860px, 100%); }
.dialog-small { width: min(440px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.dialog-head h2 { font-size: 22px; font-weight: 800; }
.dialog-body { padding: 10px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.dialog-body p { margin: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.used-list { margin: 0; padding-left: 20px; }

.recipe { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.recipe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.recipe-head h3 { font-size: 17px; }
.recipe-lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 92px 92px 40px; gap: 8px; align-items: center; }
.line-cost { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.line input[aria-invalid="true"] { border-color: var(--bad); }
.line-error { grid-column: 1 / -1; margin: -2px 0 0; font-size: 12px; color: var(--bad); }
.recipe-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.live { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; width: 100%; }
.live-item b { font-variant-numeric: tabular-nums; font-size: 16px; }
.live-item.strong b { font-family: var(--font-display); font-size: 22px; }
.live-item.accent b { color: var(--accent); font-family: var(--font-display); font-size: 22px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--bad); color: #fff; }

.print-report { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .app { padding: 14px 14px 56px; }
  .header-actions { width: 100%; }
  .header-actions .btn-primary { flex: 1; }
  #printBtn span { display: none; }
  #printBtn { width: 40px; padding: 0; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary .tile-alert { grid-column: 1 / -1; }
  .toolbar-right, .search, .search input { width: 100%; }
  .select-wrap, .select-wrap select { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .overlay { padding: 0; align-items: stretch; }
  .dialog, .dialog-wide { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .dialog-small { height: auto; margin: auto 16px; border-radius: var(--r-lg); }
  .line { grid-template-columns: 1fr 1fr 40px; }
  .line-ing { grid-column: 1 / -1; }
  .line-cost { grid-column: 1 / 3; text-align: left; }
  .line .btn-icon { grid-row: 2; grid-column: 3; }
  .line-qty { grid-column: 1; } .line-unit { grid-column: 2; }
  .oh-row { grid-template-columns: 1fr 100px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --ink: #111; color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .app, .overlay, .toast { display: none !important; }
  .print-report { display: block; }
  .r-head h1 { font-family: var(--font-display); font-size: 22pt; }
  .r-head p { margin: 2pt 0 12pt; color: #555; }
  .r-summary { display: flex; gap: 18pt; margin-bottom: 12pt; flex-wrap: wrap; }
  .r-summary span { display: block; font-size: 9pt; color: #666; }
  .r-summary b { font-size: 13pt; }
  .r-table { width: 100%; border-collapse: collapse; }
  .r-table th, .r-table td { border-bottom: 1px solid #ccc; padding: 5pt 6pt; text-align: right; font-variant-numeric: tabular-nums; }
  .r-table th:first-child, .r-table td:first-child { text-align: left; }
  .r-table thead th { font-size: 9pt; color: #555; border-bottom: 2px solid #111; }
  .r-cat th { text-align: left !important; background: #eef2ee; font-size: 11pt; padding-top: 8pt; }
  .r-table small { color: #666; }
  .r-good { color: #1d6b40; } .r-warn { color: #9a5205; } .r-bad { color: #b42318; }
  tr { break-inside: avoid; }
}
@media (max-width: 640px) { .tab { padding: 12px 10px; } }
