/* WinUI 3 / Fluent 2 skin for the shared mockup renderers (mockups/ui.js, mockups/main-menu.js).
   Same class names as mockups/styles.css; colors follow the WinUI theme resources
   (CardBackgroundFillColorDefault, ControlFillColorDefault, TextFillColorSecondary, SystemFillColor*, …).
   Theme: follows the OS, or forced with <html data-theme="light|dark">. */
:root {
  --mica: #F3F3F3; --layer: #F9F9F9; --card: #FDFDFD; --card-2: #F6F6F6; --smoke: rgba(0,0,0,.3);
  --stroke: rgba(0,0,0,.0803); --stroke-card: rgba(0,0,0,.0578); --stroke-strong: rgba(0,0,0,.447); --stroke-ctl-bottom: rgba(0,0,0,.1622);
  --fill-ctl: rgba(255,255,255,.7); --fill-ctl-hover: rgba(249,249,249,.5); --fill-ctl-press: rgba(249,249,249,.3);
  --fill-subtle: rgba(0,0,0,.0373); --fill-subtle-2: rgba(0,0,0,.0241); --fill-strong: rgba(0,0,0,.447); --fill-track: rgba(0,0,0,.6063);
  --text: rgba(0,0,0,.8956); --text-2: rgba(0,0,0,.6063); --text-3: rgba(0,0,0,.4458); --text-dis: rgba(0,0,0,.3614);
  --accent: #005FB8; --accent-hover: #1A6FC0; --accent-press: #3381C7; --accent-text: #003E92; --on-accent: #FFFFFF; --accent-subtle: rgba(0,95,184,.08);
  --success: #0F7B0F; --success-bg: #DFF6DD; --caution: #9D5D00; --caution-bg: #FFF4CE; --critical: #C42B1C; --critical-bg: #FDE7E9;
  --implied: #6B3FBF; --implied-bg: #F1EBFB;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04); --shadow-flyout: 0 8px 16px rgba(0,0,0,.14); --shadow-dialog: 0 32px 64px rgba(0,0,0,.1876), 0 2px 21px rgba(0,0,0,.1474);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23000' stroke-opacity='.6' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Aliases read by inline styles in the shared renderers. */
  --live: var(--success); --warn: var(--caution); --rebuild: var(--critical); --info: var(--accent); --muted: var(--text-2); --red: var(--accent);
  --font: 'Segoe UI Variable Text', 'Segoe UI', 'Inter', system-ui, sans-serif;
  --font-display: 'Segoe UI Variable Display', 'Segoe UI', 'Inter', system-ui, sans-serif;
  --mono: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, ui-monospace, monospace;
  --r-ctl: 4px; --r-card: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mica: #202020; --layer: #272727; --card: #2D2D2D; --card-2: #323232; --smoke: rgba(0,0,0,.5);
    --stroke: rgba(255,255,255,.0698); --stroke-card: rgba(255,255,255,.06); --stroke-strong: rgba(255,255,255,.5442); --stroke-ctl-bottom: rgba(255,255,255,.0465);
    --fill-ctl: rgba(255,255,255,.0605); --fill-ctl-hover: rgba(255,255,255,.0837); --fill-ctl-press: rgba(255,255,255,.0326);
    --fill-subtle: rgba(255,255,255,.0605); --fill-subtle-2: rgba(255,255,255,.0419); --fill-strong: rgba(255,255,255,.5442); --fill-track: rgba(255,255,255,.5442);
    --text: #FFFFFF; --text-2: rgba(255,255,255,.786); --text-3: rgba(255,255,255,.5442); --text-dis: rgba(255,255,255,.3628);
    --accent: #60CDFF; --accent-hover: #5AB9E6; --accent-press: #52A6CC; --accent-text: #99EBFF; --on-accent: #000000; --accent-subtle: rgba(96,205,255,.12);
    --success: #6CCB5F; --success-bg: #393D1B; --caution: #FCE100; --caution-bg: #433519; --critical: #FF99A4; --critical-bg: #442726;
    --implied: #C5A8F5; --implied-bg: #34294A;
    --shadow-card: none; --shadow-flyout: 0 8px 16px rgba(0,0,0,.26); --shadow-dialog: 0 32px 64px rgba(0,0,0,.37), 0 2px 21px rgba(0,0,0,.37);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23fff' stroke-opacity='.79' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --mica: #202020; --layer: #272727; --card: #2D2D2D; --card-2: #323232; --smoke: rgba(0,0,0,.5);
  --stroke: rgba(255,255,255,.0698); --stroke-card: rgba(255,255,255,.06); --stroke-strong: rgba(255,255,255,.5442); --stroke-ctl-bottom: rgba(255,255,255,.0465);
  --fill-ctl: rgba(255,255,255,.0605); --fill-ctl-hover: rgba(255,255,255,.0837); --fill-ctl-press: rgba(255,255,255,.0326);
  --fill-subtle: rgba(255,255,255,.0605); --fill-subtle-2: rgba(255,255,255,.0419); --fill-strong: rgba(255,255,255,.5442); --fill-track: rgba(255,255,255,.5442);
  --text: #FFFFFF; --text-2: rgba(255,255,255,.786); --text-3: rgba(255,255,255,.5442); --text-dis: rgba(255,255,255,.3628);
  --accent: #60CDFF; --accent-hover: #5AB9E6; --accent-press: #52A6CC; --accent-text: #99EBFF; --on-accent: #000000; --accent-subtle: rgba(96,205,255,.12);
  --success: #6CCB5F; --success-bg: #393D1B; --caution: #FCE100; --caution-bg: #433519; --critical: #FF99A4; --critical-bg: #442726;
  --implied: #C5A8F5; --implied-bg: #34294A;
  --shadow-card: none; --shadow-flyout: 0 8px 16px rgba(0,0,0,.26); --shadow-dialog: 0 32px 64px rgba(0,0,0,.37), 0 2px 21px rgba(0,0,0,.37);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23fff' stroke-opacity='.79' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--text); background: var(--mica); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-radius: var(--r-ctl); }
.mono { font-family: var(--mono); }
.ms { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 16px; line-height: 1; display: inline-block; vertical-align: -3px; font-variation-settings: 'FILL' 0, 'wght' 300; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { background: var(--fill-strong); border-radius: 3px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- badges (InfoBadge / tag style) ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 400; padding: 1px 7px; border-radius: var(--r-ctl); border: 1px solid var(--stroke-card); white-space: nowrap; }
.badge .ms { font-size: 13px; vertical-align: 0; }
.b-t3 { color: var(--success); background: var(--success-bg); }
.b-t2 { color: var(--caution); background: var(--caution-bg); }
.b-t1 { color: var(--critical); background: var(--critical-bg); }
.b-tR { color: #fff; background: var(--critical); }
.b-pending { color: var(--on-accent); background: var(--accent); border-radius: 99px; font-weight: 600; }
.b-implied { color: var(--implied); background: var(--implied-bg); }
.b-lock, .b-ro, .b-also { color: var(--text-2); background: var(--fill-subtle); }
.b-warn { color: var(--caution); background: var(--caution-bg); }
.b-proposed { color: var(--text-3); border: 1px dashed var(--stroke-strong); background: transparent; }
.b-rec { color: var(--success); background: var(--success-bg); }

/* ---------- setting card (Toolkit SettingsCard / SettingsExpander) ----------
   Row: header icon · header + description · control on the right. Lists of choices (provider tiles,
   chips) become the expander's item rows under the header, aligned with the header text. */
.card { --indent: 16px; background: var(--card); border: 1px solid var(--stroke-card); border-radius: var(--r-card); min-height: 68px; padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 8px; align-items: center; position: relative; scroll-margin-top: 16px; }
.card.has-icon { --indent: 68px; grid-template-columns: 36px minmax(0, 1fr) auto; }
.card-icon { width: 36px; height: 36px; border-radius: var(--r-ctl); background: var(--fill-subtle); color: var(--text); display: flex; align-items: center; justify-content: center; align-self: start; margin-top: 2px; }
.card-icon .ms { font-size: 20px; }
.card.is-pending .card-icon { background: var(--accent-subtle); color: var(--accent-text); }
/* Selected card (drives the inspector): the same 3px pill NavigationView uses for selection. */
.card.is-focus::before { content: ''; position: absolute; left: -1px; top: 26px; height: 16px; width: 3px; border-radius: 2px; background: var(--accent); }
.card.is-focus { background: var(--card-2); }
.card .readouts, .card .reason, .card.wide .ctl { grid-column: 1 / -1; }
.card.has-icon .readouts, .card.has-icon .reason, .card.has-icon.wide .ctl { grid-column: 2 / -1; }
.card.st-locked .ctl, .card.st-blocked .ctl, .card.st-readOnly .ctl { opacity: .5; }
/* Header: label, then status tags inline, then the description on its own line. */
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.card-head > div:first-child { display: contents; }
.card-label { font-size: 14px; line-height: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Modified-this-session dot, as in the prototype. */
.card.is-pending .card-label::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); order: 5; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; order: 1; }
/* Keep only the tags that change a decision: Live is the default, Pending has the dot, Locked has its reason line. */
.card .badges .b-t3, .card .badges .b-pending, .card .badges .b-lock { display: none; }
.card-help { order: 2; flex-basis: 100%; color: var(--text-2); font-size: 12px; line-height: 16px; }
.ctl { justify-self: end; min-width: 0; }
.card.wide .ctl { justify-self: stretch; }
.readouts { display: flex; flex-direction: column; gap: 2px; margin-top: -4px; }
.readout { font-size: 12px; line-height: 16px; color: var(--text-2); }
.readout.warn { color: var(--caution); font-weight: 600; }
/* Reasons: secondary text with a glyph; a blocked setting gets a Warning InfoBar. */
.reason { font-size: 12px; line-height: 16px; color: var(--text-2); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin-top: -4px; }
.reason > .ms { font-size: 14px; vertical-align: -2px; }
.reason.blocked { color: var(--text); background: var(--caution-bg); border: 1px solid var(--stroke-card); border-radius: var(--r-ctl); padding: 8px 12px; margin-top: 0; }
.reason.blocked > .ms { color: var(--caution); }
.reason.implied > .ms { color: var(--implied); }
.reason .fix { font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 400; font-size: inherit; }
.linkish:hover { text-decoration: underline; }

/* ---------- controls ---------- */
/* Shared control surface: ControlFillColorDefault with the darker bottom edge WinUI controls have. */
.seg, select.sel, .btn, .slider output { border: 1px solid var(--stroke); border-bottom-color: var(--stroke-ctl-bottom); background: var(--fill-ctl); border-radius: var(--r-ctl); }
/* Segmented (Community Toolkit Segmented control) */
.seg { display: inline-flex; flex-wrap: wrap; padding: 2px; gap: 2px; background: var(--fill-subtle-2); }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 3px; font-size: 14px; color: var(--text-2); position: relative; }
.seg button:hover:not(:disabled) { background: var(--fill-subtle); color: var(--text); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--stroke); }
.seg button.on::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 16px; margin-left: -8px; height: 3px; border-radius: 2px; background: var(--accent); }
.seg button:disabled { color: var(--text-dis); }
/* Expander items: the choice list runs edge to edge under the header, one RadioButton row per option. */
.card.wide .ctl:has(.tiles, .chips) { grid-column: 1 / -1; order: 10; margin: 5px -16px -13px; border-top: 1px solid var(--stroke-card); background: var(--card-2); border-radius: 0 0 7px 7px; overflow: hidden; }
.card.st-locked .ctl:has(.tiles, .chips), .card.st-blocked .ctl:has(.tiles, .chips) { opacity: 1; }
.tiles, .chips { display: flex; flex-direction: column; }
.tile, .chip { text-align: left; border: 0; border-top: 1px solid var(--stroke-card); border-radius: 0; background: transparent; padding: 12px 16px 12px var(--indent); }
.tile:first-child, .chip:first-child { border-top: 0; }
.tile:hover:not(:disabled), .chip:hover:not(:disabled) { background: var(--fill-subtle-2); }
.tile:disabled, .chip:disabled { color: var(--text-dis); }
/* RadioButton glyph: 20px ring; checked = accent fill with a light center dot. */
.tile-label .dot, .chip::before { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--stroke-strong); background: var(--fill-subtle-2); flex-shrink: 0; }
.tile.on .dot, .chip.on::before { border-color: var(--accent); background: radial-gradient(circle, var(--on-accent) 0 5px, var(--accent) 5.5px); }
.tile:disabled .dot, .chip:disabled::before { border-color: var(--text-dis); }
.tile { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.tile-top { display: flex; align-items: center; }
.tile-label { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tile-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tile-sub, .tile-why { flex-basis: 100%; padding-left: 28px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.tile-why { color: var(--caution); }
.tile-why.dep { color: var(--text-2); }
.tile:disabled .tile-sub { color: var(--text-dis); }
.chip { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; align-items: center; }
.chip::before { content: ''; grid-row: 1 / span 2; align-self: start; }
.chip-label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.chip-sub { grid-column: 2; font-size: 12px; line-height: 16px; color: var(--text-2); }
/* Slider */
.slider { display: flex; align-items: center; gap: 12px; }
.slider input[type=range] { -webkit-appearance: none; appearance: none; width: 240px; height: 4px; background: var(--fill-track); border-radius: 2px; outline: none; }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--stroke); background: radial-gradient(circle, var(--accent) 0 5.5px, var(--card) 6px); box-shadow: 0 1px 2px rgba(0,0,0,.2); cursor: pointer; transition: background .1s; }
.slider input[type=range]::-webkit-slider-thumb:hover { background: radial-gradient(circle, var(--accent) 0 6.5px, var(--card) 7px); }
.slider input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--stroke); background: radial-gradient(circle, var(--accent) 0 5px, var(--card) 5.5px); }
.slider input[type=range]:disabled::-webkit-slider-thumb { background: radial-gradient(circle, var(--text-dis) 0 5.5px, var(--card) 6px); }
.slider output { font-family: var(--mono); font-size: 12px; min-width: 84px; text-align: center; padding: 5px 8px; }
/* ToggleSwitch: "On"/"Off" text sits to the left, as in Windows Settings. */
.toggle-row { display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; font-size: 14px; color: var(--text); }
.toggle { width: 40px; height: 20px; border-radius: 10px; background: var(--fill-subtle-2); border: 1px solid var(--stroke-strong); position: relative; flex-shrink: 0; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); transition: transform .15s, width .1s, height .1s, top .1s; }
.toggle:hover:not(:disabled)::after { width: 14px; height: 14px; top: 2px; }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { background: var(--on-accent); transform: translateX(20px); }
.toggle.on:hover:not(:disabled)::after { transform: translateX(18px); }
.toggle:disabled { border-color: var(--text-dis); } .toggle:disabled::after { background: var(--text-dis); }
/* ComboBox */
select.sel { font: inherit; font-size: 14px; height: 32px; padding: 0 32px 0 11px; min-width: 260px; max-width: 420px; color: var(--text); -webkit-appearance: none; appearance: none; background: var(--fill-ctl) var(--chevron) no-repeat right 10px center; }
select.sel:hover:not(:disabled) { background-color: var(--fill-ctl-hover); }
select.sel:disabled { color: var(--text-dis); }
select.sel option { background: var(--card); color: var(--text); }
.pipeline { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 12px; line-height: 16px; background: var(--fill-subtle-2); border: 1px solid var(--stroke-card); color: var(--text-2); padding: 10px 12px; border-radius: var(--r-ctl); }
.pipeline div:first-child { color: var(--text); font-weight: 600; }

/* ---------- ledger ---------- */
.led-group { margin-bottom: 16px; }
.led-group-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.led-group-h > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.led { background: var(--card); border: 1px solid var(--stroke-card); border-radius: var(--r-card); padding: 10px 12px; margin-bottom: 4px; }
.led-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; }
.led-top .lbl { cursor: pointer; }
.led-top .lbl:hover { color: var(--accent-text); text-decoration: underline; }
.led-val { font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-top: 2px; }
.led-val b { color: var(--accent-text); font-weight: 600; }
.led-child { margin: 8px 0 0 4px; padding-left: 10px; border-left: 2px solid var(--implied); font-size: 12px; line-height: 16px; }
.led-child .why { color: var(--text-2); font-size: 12px; }
.led-sys { border-style: dashed; }
.icon-btn { border: 0; background: transparent; color: var(--text-2); width: 28px; height: 28px; border-radius: var(--r-ctl); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.icon-btn:hover { background: var(--fill-subtle); color: var(--text); }
.empty { color: var(--text-2); font-size: 12px; line-height: 16px; text-align: center; padding: 20px 8px; border: 1px dashed var(--stroke-strong); border-radius: var(--r-card); }

/* ---------- inspector ---------- */
.insp h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.insp .kv { display: grid; grid-template-columns: 88px 1fr; gap: 4px 10px; font-size: 12px; line-height: 16px; margin: 0; }
.insp .kv dt { color: var(--text-2); }
.insp .kv dd { margin: 0; color: var(--text); }
.insp .sub { font-size: 12px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.metric { background: var(--card); border: 1px solid var(--stroke-card); border-radius: var(--r-ctl); padding: 6px 10px; }
.metric .k { font-size: 11px; line-height: 14px; color: var(--text-2); }
.metric .v { font-family: var(--mono); font-weight: 600; font-size: 14px; margin-top: 1px; }
.metric .d { font-family: var(--mono); font-size: 11px; }
.d.cost { color: var(--critical); } .d.gain { color: var(--success); }
.note { font-size: 12px; line-height: 16px; color: var(--text-2); }
.dep-link { display: inline-block; margin: 0 4px 4px 0; font-size: 12px; padding: 2px 8px; border-radius: var(--r-ctl); background: var(--fill-ctl); border: 1px solid var(--stroke); cursor: pointer; }
.dep-link:hover { color: var(--accent-text); background: var(--fill-ctl-hover); }

/* ---------- toast (InfoBar-style notification) / ContentDialog ---------- */
.toast { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); background: var(--card); color: var(--text); border: 1px solid var(--stroke); padding: 10px 16px; border-radius: var(--r-card); font-size: 14px; box-shadow: var(--shadow-flyout); display: flex; gap: 10px; align-items: center; z-index: 60; }
.toast .ms { color: var(--accent); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--fill-subtle); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.lg { margin: 4px auto 16px; width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.overlay { position: fixed; inset: 0; background: var(--smoke); display: flex; align-items: center; justify-content: center; z-index: 70; }
.modal { background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 24px; width: min(480px, 92vw); box-shadow: var(--shadow-dialog); }
.modal h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; }
.modal p { color: var(--text); margin: 0 0 16px; }
.btn { padding: 5px 12px; min-height: 32px; font-size: 14px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover:not(:disabled) { background: var(--fill-ctl-hover); }
.btn:active:not(:disabled) { background: var(--fill-ctl-press); color: var(--text-2); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; border-bottom-color: rgba(0,0,0,.4); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); color: var(--on-accent); }
.btn:disabled { color: var(--text-dis); background: var(--fill-subtle-2); border-color: var(--stroke); }
.countdown { font-family: var(--font-display); font-size: 40px; line-height: 52px; font-weight: 600; color: var(--accent-text); margin-bottom: 16px; }
pre.diff { font-family: var(--mono); font-size: 12px; background: var(--card); border: 1px solid var(--stroke-card); color: var(--text); padding: 12px; border-radius: var(--r-ctl); max-height: 50vh; overflow: auto; }

/* Review comments (mockups/comments.js): add/count buttons on groups, sections and cards, the thread dialog and the collection panel. */
.cmt-btn { display: inline-flex; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--text-3); height: 22px; min-width: 22px; padding: 0 4px; border-radius: var(--r-ctl); font-size: 12px; line-height: 16px; vertical-align: middle; }
.cmt-btn .ms { font-size: 15px; vertical-align: 0; }
.cmt-btn:hover { background: var(--fill-subtle); color: var(--text); }
.cmt-btn.has { color: var(--accent-text); background: var(--accent-subtle); }
.cmt-btn.has .ms { font-variation-settings: 'FILL' 1, 'wght' 400; }
.card .badges .cmt-btn { order: 9; }
.group-h { display: flex; align-items: center; gap: 8px; }
.group-h .cmt-btn { margin-bottom: 8px; }
.sec-h .cmt-btn { align-self: center; }
.nav-i .ncmt { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 11px; line-height: 16px; color: var(--accent-text); }
.nav-i .ncmt .ms { font-size: 13px; vertical-align: 0; font-variation-settings: 'FILL' 1, 'wght' 400; }
.nav-i .ncmt + .cnt, .nav-i .ncmt + .sev { margin-left: 8px; }
.cmt-kind { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: var(--r-ctl); text-transform: capitalize; white-space: nowrap; }
.cmt-kind .ms { font-size: 12px; vertical-align: 0; }
.cmt-kind.k-rule { color: var(--implied); background: var(--implied-bg); }
.cmt-kind.k-suggestion { color: var(--accent-text); background: var(--accent-subtle); }
.cmt-kind.k-question { color: var(--caution); background: var(--caution-bg); }
.cmt-kind.k-bug { color: var(--critical); background: var(--critical-bg); }
.cmt-modal { width: min(600px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.cmt-crumb { font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-bottom: 4px; }
.cmt-crumb .ms { font-size: 14px; vertical-align: 0; }
.cmt-crumb b { color: var(--text); font-weight: 600; }
.cmt-key { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.cmt-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cmt, .cmt-ver { background: var(--card); border: 1px solid var(--stroke-card); border-radius: var(--r-card); padding: 10px 12px; }
.cmt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-2); }
.cmt-actions { margin-left: auto; display: inline-flex; }
.cmt-actions .icon-btn { width: 24px; height: 24px; }
.cmt-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-hist { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cmt-ver { background: var(--fill-subtle-2); padding: 8px 10px; }
.cmt-ver .cmt-text { color: var(--text-2); }
.cmt-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--stroke); padding-top: 16px; }
.cmt-kinds button { display: inline-flex; align-items: center; gap: 5px; text-transform: capitalize; font-size: 13px; }
.cmt-form textarea, .cmt-row input { font: inherit; color: var(--text); background: var(--fill-ctl); border: 1px solid var(--stroke); border-bottom-color: var(--stroke-strong); border-radius: var(--r-ctl); padding: 6px 10px; }
.cmt-form textarea { resize: vertical; min-height: 84px; }
.cmt-form textarea:focus, .cmt-row input:focus { outline: none; background: var(--card); border-bottom: 2px solid var(--accent); }
.cmt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmt-row input { width: 200px; height: 32px; }
.cmt-hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.cmt-panel { width: min(860px, 94vw); max-height: 90vh; display: flex; flex-direction: column; }
.cmt-panel h3 { display: flex; align-items: center; gap: 8px; }
.cmt-toolbar, .cmt-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmt-sp { flex: 1; }
.cmt-body { margin: 12px 0 16px; overflow-y: auto; min-height: 120px; }
.cmt-body pre.diff { max-height: none; margin: 0; }
.cmt-danger:not(:disabled) { color: var(--critical); }
.cmt-tree, .cmt-tree ul { list-style: none; margin: 0; padding: 0; }
.cmt-grp { margin-bottom: 14px; }
.cmt-h1 { font-weight: 600; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--stroke); margin-bottom: 6px; }
.cmt-h2 { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 0 2px 12px; }
.cmt-sec > ul { padding-left: 12px; }
.cmt-node { margin: 2px 0 6px; }
.cmt-go { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 4px 8px; border-radius: var(--r-ctl); color: var(--accent-text); }
.cmt-go:hover { background: var(--fill-subtle); }
.cmt-node.l1 > .cmt-go::before, .cmt-node.l2 > .cmt-go::before { font-family: 'Material Symbols Outlined'; content: 'folder'; font-size: 14px; color: var(--text-3); }
.cmt-n { margin-left: auto; font-size: 11px; color: var(--text-2); }
.cmt-items { padding-left: 16px !important; }
.cmt-items li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; padding: 3px 8px; font-size: 13px; }
.cmt-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-by { font-size: 11px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 640px) { .cmt-items li { grid-template-columns: auto 1fr; } .cmt-by { grid-column: 2; } .cmt-hint { display: none; } }
