/* Parsely-bench — Material 3 inspired, Google Sans. Tokens follow the M3
   baseline roles, generated from a parsley-green seed. */
:root {
  --md-primary: #3b6939; --md-on-primary: #ffffff;
  --md-primary-container: #bcf0b4; --md-on-primary-container: #23501f;
  --md-secondary: #52634f; --md-on-secondary: #ffffff;
  --md-secondary-container: #d5e8cf; --md-on-secondary-container: #3b4b38;
  --md-tertiary: #39656b; --md-tertiary-container: #bcebf2; --md-on-tertiary-container: #1f4d53;
  --md-error: #ba1a1a; --md-error-container: #ffdad6; --md-on-error-container: #93000a;
  --md-surface: #f7fbf1; --md-on-surface: #181d17; --md-on-surface-variant: #424940;
  --md-surface-container-lowest: #ffffff; --md-surface-container-low: #f1f5ec;
  --md-surface-container: #ebefe6; --md-surface-container-high: #e6e9e0; --md-surface-container-highest: #e0e4db;
  --md-outline: #72796f; --md-outline-variant: #c2c9bd;
  --md-inverse-surface: #2d322c; --md-inverse-on-surface: #eef2e9; --md-inverse-primary: #a1d39a;
  --score-hi: #2e7d32; --score-mid: #b26a00; --score-lo: #ba1a1a;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --shadow-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);
  --font: "Google Sans", "Google Sans Flex", "Product Sans", Roboto, system-ui, sans-serif;
  --font-code: "Google Sans Code", ui-monospace, "SF Mono", Menlo, monospace;
  --rail-w: 88px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --md-primary: #a1d39a; --md-on-primary: #0a390f;
  --md-primary-container: #23501f; --md-on-primary-container: #bcf0b4;
  --md-secondary: #bacbb3; --md-on-secondary: #253423;
  --md-secondary-container: #3b4b38; --md-on-secondary-container: #d5e8cf;
  --md-tertiary: #a1ced5; --md-tertiary-container: #1f4d53; --md-on-tertiary-container: #bcebf2;
  --md-error: #ffb4ab; --md-error-container: #93000a; --md-on-error-container: #ffdad6;
  --md-surface: #10140f; --md-on-surface: #e0e4db; --md-on-surface-variant: #c2c9bd;
  --md-surface-container-lowest: #0b0f0a; --md-surface-container-low: #181d17;
  --md-surface-container: #1c211b; --md-surface-container-high: #272b25; --md-surface-container-highest: #323630;
  --md-outline: #8c9388; --md-outline-variant: #424940;
  --md-inverse-surface: #e0e4db; --md-inverse-on-surface: #2d322c; --md-inverse-primary: #3b6939;
  --score-hi: #8fd18b; --score-mid: #f0b85a; --score-lo: #ffb4ab;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --md-primary: #a1d39a; --md-on-primary: #0a390f;
    --md-primary-container: #23501f; --md-on-primary-container: #bcf0b4;
    --md-secondary: #bacbb3; --md-on-secondary: #253423;
    --md-secondary-container: #3b4b38; --md-on-secondary-container: #d5e8cf;
    --md-tertiary: #a1ced5; --md-tertiary-container: #1f4d53; --md-on-tertiary-container: #bcebf2;
    --md-error: #ffb4ab; --md-error-container: #93000a; --md-on-error-container: #ffdad6;
    --md-surface: #10140f; --md-on-surface: #e0e4db; --md-on-surface-variant: #c2c9bd;
    --md-surface-container-lowest: #0b0f0a; --md-surface-container-low: #181d17;
    --md-surface-container: #1c211b; --md-surface-container-high: #272b25; --md-surface-container-highest: #323630;
    --md-outline: #8c9388; --md-outline-variant: #424940;
    --md-inverse-surface: #e0e4db; --md-inverse-on-surface: #2d322c; --md-inverse-primary: #3b6939;
    --score-hi: #8fd18b; --score-mid: #f0b85a; --score-lo: #ffb4ab;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--md-surface); color: var(--md-on-surface); -webkit-font-smoothing: antialiased; min-height: 100vh; }
code { font-family: var(--font-code); font-size: .9em; background: var(--md-surface-container-high); padding: 1px 6px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--md-primary); }

.headline-small { font-size: 24px; line-height: 32px; }
.title-large { font-size: 22px; line-height: 28px; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 500; margin: 0; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-large { font-size: 16px; line-height: 24px; }
.body-medium { font-size: 14px; line-height: 20px; }
.body-small { font-size: 12px; line-height: 16px; letter-spacing: .2px; }
.label-large { font-size: 14px; line-height: 20px; font-weight: 500; }
.muted { color: var(--md-on-surface-variant); }

.msr { font-family: "Material Symbols Rounded"; font-size: 20px; line-height: 1; display: inline-block; font-variation-settings: "FILL" 0, "wght" 400, "opsz" 24; user-select: none; }
.msr.filled { font-variation-settings: "FILL" 1, "wght" 400, "opsz" 24; }

/* Logos (LobeHub). Colour icons are <img>; mono icons are masks tinted with currentColor. */
.logo { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; }
img.logo { object-fit: contain; }
.logo.mono { background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.logo.fallback { border-radius: 6px; background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); font-size: 11px; font-weight: 700; }
.logo .msr { font-size: 18px; }

/* App bar with tabs */
.app-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 16px; background: var(--md-surface); border-bottom: 1px solid transparent; }
.app-bar.scrolled { border-bottom-color: var(--md-outline-variant); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--md-primary-container); color: var(--md-on-primary-container); }
.brand-mark .msr { font-size: 20px; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs button { border: 0; background: none; cursor: pointer; height: 40px; padding: 0 16px; border-radius: 20px; font-size: 14px; font-weight: 500; color: var(--md-on-surface-variant); }
.tabs button:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.tabs button[aria-selected="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--md-on-surface-variant); flex: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.block { padding: 8px 0 20px; }
.block + .block { border-top: 1px solid var(--md-outline-variant); padding-top: 20px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; min-height: 40px; }

/* Buttons */
.filled-btn, .text-btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; border-radius: 20px; }
.filled-btn { height: 48px; padding: 0 24px 0 20px; border-radius: 24px; background: var(--md-primary); color: var(--md-on-primary); }
.filled-btn:hover { box-shadow: var(--shadow-1); }
.filled-btn:disabled { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); color: color-mix(in srgb, var(--md-on-surface) 38%, transparent); box-shadow: none; cursor: default; }
.filled-btn .msr { font-size: 20px; }
.text-btn { height: 40px; padding: 0 12px; background: none; color: var(--md-primary); }
.text-btn.small { height: 32px; font-size: 13px; }
.text-btn:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.text-btn .msr { font-size: 18px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; border-radius: 10px; border: 1px solid var(--md-outline-variant); background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 10px; font-size: 14px; font-weight: 500; color: var(--md-on-surface-variant); transition: background .15s, border-color .15s; max-width: 100%; }
.chip:hover:not(:disabled) { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.chip[aria-pressed="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-sub { font-weight: 400; font-size: 12px; opacity: .75; white-space: nowrap; }
.chip .chip-x { font-size: 16px; margin-right: -4px; opacity: 0; transition: opacity .15s; }
.chip:hover .chip-x { opacity: .7; }
.chip .chip-x:hover { opacity: 1; }
.chip.locked { border-style: dashed; cursor: default; opacity: .7; }
.chips + .reveal { margin-top: 10px; }
.reveal { border: 0; background: none; cursor: pointer; padding: 4px 0; font-size: 13px; color: var(--md-on-surface-variant); display: inline-flex; align-items: center; gap: 4px; }
.reveal:hover { color: var(--md-on-surface); }
.reveal .msr { font-size: 18px; }
.reveal + .chips { margin-top: 10px; }

/* Disclosure */
details.more { border-top: 1px solid var(--md-outline-variant); }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 0; font-size: 16px; font-weight: 500; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary > .msr:first-child { color: var(--md-on-surface-variant); }
details.more .summary-hint { color: var(--md-on-surface-variant); font-weight: 400; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.more .chevron { margin-left: auto; color: var(--md-on-surface-variant); transition: transform .2s; }
details.more .summary-hint + .chevron { margin-left: 0; }
details.more[open] .chevron { transform: rotate(180deg); }
details.more[open] .summary-hint { display: none; }
details.more[open] .summary-hint + .chevron { margin-left: auto; }
.more-body { padding: 0 0 20px; display: flex; flex-direction: column; gap: 20px; }
details.more.inline { border-top: 0; }
details.more.inline > summary { padding: 8px 0; font-size: 14px; color: var(--md-on-surface-variant); }
.field { display: flex; flex-direction: column; gap: 10px; }
.field-head { display: flex; align-items: center; justify-content: space-between; }
.field p { margin: 0; }

.segmented { display: inline-flex; border: 1px solid var(--md-outline); border-radius: 20px; overflow: hidden; align-self: flex-start; }
.segmented button { height: 40px; padding: 0 16px; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.segmented button + button { border-left: 1px solid var(--md-outline); }
.segmented .seg-check { font-size: 18px; width: 0; overflow: hidden; transition: width .2s; }
.segmented button[aria-checked="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.segmented button[aria-checked="true"] .seg-check { width: 18px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch { appearance: none; flex: none; width: 52px; height: 32px; border-radius: 16px; position: relative; cursor: pointer; margin: 0; background: var(--md-surface-container-highest); border: 2px solid var(--md-outline); transition: background .2s, border-color .2s; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; top: 6px; left: 6px; background: var(--md-outline); transition: all .2s cubic-bezier(.2,0,0,1); }
.switch:checked { background: var(--md-primary); border-color: var(--md-primary); }
.switch:checked::after { width: 24px; height: 24px; top: 2px; left: 22px; background: var(--md-on-primary); }

/* Run bar */
.run-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 8px 8px 8px 20px; border-radius: 28px; background: var(--md-surface-container-high); box-shadow: var(--shadow-1); }

.linear-progress { height: 4px; border-radius: 2px; background: var(--md-secondary-container); overflow: hidden; }
.linear-progress .bar { height: 100%; width: 0; background: var(--md-primary); transition: width .3s; }
.progress { margin-top: 24px; border-top: 0 !important; }
.live-log { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; font-size: 13px; }
.live-log li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--md-outline-variant); align-items: center; }
.live-log .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--md-on-surface-variant); }

.score { display: inline-flex; min-width: 40px; justify-content: center; padding: 2px 8px; border-radius: 8px; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 13px; }
.score.hi { background: color-mix(in srgb, var(--score-hi) 16%, transparent); color: var(--score-hi); }
.score.mid { background: color-mix(in srgb, var(--score-mid) 16%, transparent); color: var(--score-mid); }
.score.lo { background: color-mix(in srgb, var(--score-lo) 14%, transparent); color: var(--score-lo); }

/* Results */
.results-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.select-wrap { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px; border-radius: 20px; background: var(--md-surface-container-high); flex: 1; min-width: 0; }
.select-wrap select { appearance: none; border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 14px; font-weight: 500; cursor: pointer; padding-right: 4px; text-overflow: ellipsis; }
.select-wrap select option { background: var(--md-surface-container-high); color: var(--md-on-surface); }
.select-wrap .msr:last-child { pointer-events: none; color: var(--md-on-surface-variant); }
.select-wrap.compact { flex: none; width: 200px; }

.hero { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 24px; background: var(--md-primary-container); color: var(--md-on-primary-container); margin-bottom: 8px; }
.hero .big { font-size: 44px; line-height: 48px; font-weight: 400; font-variant-numeric: tabular-nums; }
.hero .logo { width: 36px; height: 36px; }
.hero-meta { flex: 1; min-width: 0; }
.hero-meta .body-small { opacity: .85; }
.stats-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--md-on-surface-variant); padding: 8px 4px 16px; }

.board { list-style: none; margin: 0; padding: 0; }
.board > li { border-bottom: 1px solid var(--md-outline-variant); }
.board .row { display: grid; grid-template-columns: 24px 24px minmax(0, 1fr) 120px 48px 20px; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; }
.board .row:hover { background: color-mix(in srgb, var(--md-on-surface) 4%, transparent); }
.board .rank { font-size: 13px; color: var(--md-on-surface-variant); text-align: center; font-variant-numeric: tabular-nums; }
.board .name { min-width: 0; }
.board .name div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .chev { color: var(--md-on-surface-variant); transition: transform .2s; font-size: 20px; }
.board li.open .chev { transform: rotate(180deg); }
.board .detail { display: none; padding: 0 4px 16px 76px; }
.board li.open .detail { display: block; }
.track { height: 6px; border-radius: 3px; background: var(--md-surface-container-highest); overflow: hidden; display: flex; }
.track .seg { height: 100%; }
.seg-ingredients { background: var(--md-primary); }
.seg-instructions { background: var(--md-tertiary); }
.seg-title { background: #8a7a2a; }
.seg-metadata { background: #9c5b8f; }
.seg-grounding { background: var(--md-outline); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 16px; font-size: 13px; }
.kv div span { display: block; color: var(--md-on-surface-variant); font-size: 12px; }
.kv div b { font-weight: 500; font-variant-numeric: tabular-nums; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table td { padding: 8px 4px; border-bottom: 1px solid var(--md-outline-variant); }
.mini-table td:first-child { display: flex; align-items: center; gap: 8px; }
.mini-table td.bar { width: 40%; }
.mini-table td.num { text-align: right; width: 56px; }

.heat-wrap { overflow-x: auto; }
.heatmap { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heatmap th { font-weight: 400; color: var(--md-on-surface-variant); padding: 4px 8px 4px 0; text-align: left; white-space: nowrap; }
.heatmap thead th { padding: 0; vertical-align: bottom; }
.heatmap thead th .logo { margin: 0 auto 4px; display: block; }
.heatmap td { width: 40px; min-width: 40px; height: 30px; text-align: center; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums; font-weight: 500; }
.heatmap td:hover { outline: 2px solid var(--md-primary); }
.heatmap td.err { background: var(--md-error-container); color: var(--md-on-error-container); }
.heat-legend { font-size: 12px; color: var(--md-on-surface-variant); margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }

.empty { text-align: center; padding: 64px 16px; color: var(--md-on-surface-variant); }
.empty .msr { font-size: 40px; opacity: .6; }

/* Setup */
.key-list { display: flex; flex-direction: column; }
.key-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--md-outline-variant); }
.key-row:last-child { border-bottom: 0; }
.key-row .grow { flex: 1; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--md-outline-variant); flex: none; }
.dot.on { background: var(--score-hi); }
.recipe-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--md-outline-variant); }
.recipe-row a { font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.plain { padding-left: 18px; margin: 8px 0; }
ul.plain li { margin: 4px 0; }

/* Dialogs */
.dialog { border: 0; padding: 0; border-radius: 28px; background: var(--md-surface-container-high); color: var(--md-on-surface); width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-3); }
.dialog.wide { width: min(1000px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0,0,0,.32); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 8px 24px; position: sticky; top: 0; background: var(--md-surface-container-high); z-index: 1; }
.dialog-body { padding: 0 24px 24px; }
.search-row { display: flex; gap: 8px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--md-surface-container-highest); min-width: 0; }
.search-field input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; min-width: 0; }
.search-field .msr { color: var(--md-on-surface-variant); }
.search-row .select-wrap { height: 48px; border-radius: 24px; background: var(--md-surface-container-highest); }
.catalog-meta { padding: 10px 4px 4px; }
.catalog { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; }
.catalog li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--md-outline-variant); }
.catalog li .grow { flex: 1; min-width: 0; }
.catalog li .grow div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog .tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); margin-left: 4px; }
.catalog .add { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--md-outline); background: none; color: var(--md-primary); font-size: 13px; font-weight: 500; cursor: pointer; flex: none; }
.catalog .add:disabled { color: var(--md-on-surface-variant); border-color: var(--md-outline-variant); cursor: default; }
.manual { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 4px; }
.text-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--md-on-surface-variant); flex: 1; }
.text-field input, .text-field select { height: 48px; border: 1px solid var(--md-outline); border-radius: 8px; padding: 0 14px; background: transparent; font-size: 15px; color: var(--md-on-surface); outline: none; }
.text-field input:focus, .text-field select:focus { border: 2px solid var(--md-primary); padding: 0 13px; }
.text-field select option { background: var(--md-surface-container-high); }
.price-row { display: flex; gap: 12px; }
.manual .filled-btn { align-self: flex-start; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare > div { background: var(--md-surface-container); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.compare h4 { margin: 12px 0 6px; font-size: 13px; font-weight: 500; color: var(--md-on-surface-variant); }
.compare ol, .compare ul { margin: 0; padding-left: 20px; font-size: 13px; line-height: 19px; }
.meta-line { font-size: 13px; color: var(--md-on-surface-variant); margin-bottom: 12px; }
.error-box { background: var(--md-error-container); color: var(--md-on-error-container); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }

.snackbar { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140px); background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); padding: 14px 16px; border-radius: 4px; font-size: 14px; box-shadow: var(--shadow-3); transition: transform .25s cubic-bezier(.2,0,0,1); z-index: 50; max-width: calc(100vw - 32px); }
.snackbar.show { transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .app-bar { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 4px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tabs button { flex: 1; }
  #theme-toggle { margin-left: auto; }
  .board .row { grid-template-columns: 20px 22px minmax(0, 1fr) 44px 18px; }
  .board .row .track { display: none; }
  .board .detail { padding-left: 4px; }
  .compare { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .select-wrap.compact { width: 100%; }
  .hero .big { font-size: 36px; }
  .dialog { border-radius: 20px; }
  .dialog-body { padding: 0 16px 16px; }
}

/* ── Charts ─────────────────────────────────────────────────────────── */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --status-critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
}
main.wide { max-width: 1120px; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--md-on-surface); }
.chart-legend.small { font-size: 12px; color: var(--md-on-surface-variant); margin: 0 0 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-filter { display: inline-flex; border: 1px solid var(--md-outline); border-radius: 18px; overflow: hidden; }
.chart-filter button { height: 32px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--md-on-surface); }
.chart-filter button + button { border-left: 1px solid var(--md-outline); }
.chart-filter button[aria-pressed="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.chart-card { background: var(--md-surface-container-low); border-radius: 20px; padding: 16px 16px 8px; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-head { margin-bottom: 8px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--md-outline-variant); stroke-width: 1; opacity: .7; }
.chart-svg .row-line { stroke: var(--md-outline-variant); stroke-width: 1; opacity: .5; }
.chart-svg .tick { fill: var(--md-on-surface-variant); font-size: 11px; font-family: var(--font); }
.chart-svg .label { fill: var(--md-on-surface); font-size: 12px; font-family: var(--font); }
.chart-svg .value { fill: var(--md-on-surface-variant); font-size: 12px; font-weight: 500; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .axis-title { fill: var(--md-on-surface-variant); font-size: 12px; font-family: var(--font); }
.chart-svg .hint { fill: var(--md-on-surface-variant); font-size: 11px; font-family: var(--font); opacity: .8; }
.chart-svg .dot-label { fill: var(--md-on-surface); font-size: 11px; font-family: var(--font); pointer-events: none; }
.chart-svg .dot { stroke: var(--md-surface-container-low); stroke-width: 2; }
.chart-svg .dot.small { stroke-width: 1.5; }
.chart-svg .median { stroke: var(--md-on-surface); stroke-width: 2; stroke-linecap: round; }
.chart-svg .fail-mark { fill: var(--status-critical); font-size: 15px; font-weight: 700; font-family: var(--font); pointer-events: none; }
.chart-svg .mark { transition: opacity .15s; }
.chart-svg:hover .mark { opacity: .55; }
.chart-svg .mark:hover { opacity: 1; }
.chart-svg [data-cell] { cursor: pointer; }
.chart-tip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .1s; background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 17px; max-width: 280px; box-shadow: var(--shadow-3); }
.chart-tip.show { opacity: 1; }
.chart-tip b { font-weight: 500; }
@media (max-width: 800px) { .chart-grid { grid-template-columns: 1fr; } }
.results-seg { margin: 0 0 4px; }
.results-seg button { min-width: 130px; justify-content: center; }
.chart-filter { max-width: 100%; overflow-x: auto; }
.chart-filter button { white-space: nowrap; flex: none; }
.chart-svg { max-width: 100%; height: auto; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chart-head-text { min-width: 0; }
.chart-actions { position: relative; flex: none; margin: -6px -6px 0 0; }
.icon-btn.small { width: 32px; height: 32px; border-radius: 16px; }
.icon-btn.small .msr { font-size: 18px; }
.chart-card .chart-actions .icon-btn { opacity: .6; }
.chart-card:hover .chart-actions .icon-btn, .chart-actions .icon-btn:focus-visible { opacity: 1; }
.chart-menu { position: absolute; right: 0; top: 36px; z-index: 5; min-width: 120px; padding: 6px 0; border-radius: 8px; background: var(--md-surface-container); box-shadow: var(--shadow-3); }
.chart-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 16px; border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--md-on-surface); }
.chart-menu button:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.chart-menu .msr { font-size: 18px; color: var(--md-on-surface-variant); }
.chart-toolbar .text-btn.small { margin-left: auto; }
.pub-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; cursor: pointer; flex: none; color: var(--md-on-surface-variant); }
