/*
 * Helen Keller Intl — VAS Bid Analysis Agent
 * Colours follow the 2025 brand guidelines (see .claude/skills/kellervoice).
 * Purple Horizon #7A4183 is the dominant brand colour; semantic green/red are
 * kept for compliance pass/fail clarity.
 */
:root {
    /* Brand palette (from kellervoice/assets/brand-palette.css) */
    --hk-purple: #7A4183;        /* Purple Horizon — primary */
    --hk-purple-dark: #653670;   /* darker, for hover/pressed */
    --hk-purple-75: #93649C;
    --hk-purple-50: #BCA0C1;
    --hk-purple-25: #DDD0E1;
    --hk-purple-10: #F2EBF3;     /* soft tint for backgrounds */
    --hk-blue: #41B6E6;          /* Blue Sky — secondary */
    --hk-coral: #F87C56;         /* Coral Sunshine — secondary */
    --hk-gray: #5B6770;          /* Gray Shadow — secondary */
    --hk-yellow: #F1C400;        /* Yellow Sunset — accent */

    /* Roles mapped onto the brand palette */
    --bg: #f4f1f7;               /* soft warm-neutral, leans to Purple Horizon */
    --surface: #ffffff;
    --surface-2: #faf8fc;        /* subtle raised/zebra fill */
    --border: #e7e1ee;
    --border-strong: #d7cede;
    --text: #241d2b;             /* plum-black — warmer than a blue-grey */
    --muted: #6b6474;            /* readable muted with a faint purple bias */
    --primary: var(--hk-purple);
    --primary-hover: var(--hk-purple-dark);
    --primary-weak: var(--hk-purple-10);
    --ok-bg: #e7f6ec; --ok-text: #137333;
    --fail-bg: #fdecea; --fail-text: #c5221f;

    /* Radius & elevation scale — softer, layered, brand-tinted shadows */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-xs: 0 1px 2px rgba(51,30,58,.06);
    --shadow: 0 1px 2px rgba(51,30,58,.05), 0 4px 14px rgba(122,65,131,.06);
    --shadow-md: 0 2px 6px rgba(51,30,58,.07), 0 10px 28px rgba(122,65,131,.10);
    --shadow-lg: 0 12px 40px rgba(51,30,58,.14);
    --maxw: 1040px;

    /* Motion */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .16s;

    /* Brand type: Arial-led stack per the guidelines, with a graceful modern
       fallback chain. Headings tighten tracking; labels/eyebrows add it. */
    --font-body: 'Arial', 'Helvetica Neue', Helvetica, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text); background: var(--bg); line-height: 1.6;
    font-size: 16px; letter-spacing: .002em;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Visible keyboard focus everywhere (accessibility) */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.stat:focus-visible {
    outline: 2px solid var(--hk-purple); outline-offset: 2px; border-radius: 4px;
}
.topbar a:focus-visible { outline-color: var(--topbar-ink, #fff); }

/* Visually hidden but available to screen readers */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip-to-content link — visible only when focused */
.skip-link {
    position: absolute; left: .5rem; top: -3rem; z-index: 50;
    background: var(--hk-purple); color: #fff; padding: .5rem .9rem;
    border-radius: 6px; transition: top .15s ease;
}
.skip-link:focus { top: .5rem; text-decoration: none; }

/* Top bar — the Helen Keller half-circle mark + wordmark, on a brand colour set
   in Settings → Appearance. The colour lives in a preset class (below), not an
   inline style, so it stays within the app's Content-Security-Policy. Each
   preset carries a contrasting --topbar-ink so text and the mark stay legible. */
.topbar {
    --topbar-bg: var(--hk-purple);
    --topbar-ink: #ffffff;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,.10), transparent), var(--topbar-bg);
    padding: .7rem 1.6rem;
    box-shadow: 0 2px 10px rgba(51,30,58,.22);
    position: sticky; top: 0; z-index: 40;
}
.topbar-purple { --topbar-bg: #7a4183; --topbar-ink: #ffffff; }
.topbar-blue   { --topbar-bg: #41b6e6; --topbar-ink: #241d2b; }
.topbar-yellow { --topbar-bg: #f1c400; --topbar-ink: #241d2b; }
.topbar-coral  { --topbar-bg: #f87c56; --topbar-ink: #241d2b; }
.topbar-gray   { --topbar-bg: #5b6770; --topbar-ink: #ffffff; }

.topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar .brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--topbar-ink); }
.topbar .brand:hover { text-decoration: none; opacity: .92; }
.topbar .brand-mark { width: 30px; height: 30px; display: block; flex: 0 0 auto; color: var(--topbar-ink); }
.topbar .brand-word { font-weight: 800; font-size: 1.05rem; letter-spacing: .07em; color: var(--topbar-ink); }
.topbar .app-name {
    color: color-mix(in srgb, var(--topbar-ink) 86%, transparent); font-size: .9rem; font-weight: 600; white-space: nowrap;
    padding-left: .8rem; margin-left: .15rem; border-left: 1px solid color-mix(in srgb, var(--topbar-ink) 30%, transparent);
    letter-spacing: .01em;
}
.topbar nav { display: flex; gap: .2rem; margin-left: 1.3rem; }
.topbar nav a {
    color: color-mix(in srgb, var(--topbar-ink) 82%, transparent); padding: .42rem .8rem; border-radius: 999px; font-size: .9rem;
    font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.topbar nav a:hover { background: color-mix(in srgb, var(--topbar-ink) 15%, transparent); color: var(--topbar-ink); text-decoration: none; }
.topbar nav a.active { background: var(--topbar-ink); color: var(--topbar-bg); font-weight: 700; box-shadow: 0 1px 4px rgba(51,30,58,.18); }
.topbar .user { font-size: .86rem; color: color-mix(in srgb, var(--topbar-ink) 86%, transparent); white-space: nowrap; }
.topbar .user a { color: var(--topbar-ink); text-decoration: underline; text-underline-offset: 2px; }

/* Layout */
main { max-width: var(--maxw); margin: 2rem auto; padding: 0 1.5rem; }
main.center-narrow { max-width: 400px; margin-top: 8vh; }
main.wide { max-width: 1320px; } /* data-dense pages: wide tables, list views */

/* Login page — branded sign-in with the soft "horizon" arc motif */
main.login { position: relative; z-index: 1; }
.login-arc {
    position: fixed; left: 50%; bottom: -380px; transform: translateX(-50%);
    width: 840px; height: 840px; max-width: 150vw; border-radius: 50%;
    background: var(--hk-purple-10); z-index: -1; pointer-events: none;
}
.login-intro { text-align: center; margin-bottom: 1.2rem; }
.login-intro h1 { margin: .2rem 0 .4rem; }
.login-intro p { margin: 0 auto; max-width: 34ch; }
.login-card { max-width: none; }
.login-card button { width: 100%; margin-top: .2rem; }
/* SSO offered first inside the card: a full-width branded button, then a soft
   "or" divider before the email/password fields. */
.login-sso-btn { width: 100%; margin: 0; font-size: .95rem; padding: .62rem 1.2rem; }
.login-or { display: flex; align-items: center; gap: .7rem; margin: 1.15rem 0; color: var(--muted); font-size: .8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-foot { text-align: center; font-size: .8rem; margin-top: 1.3rem; }

/* Dashboard */
.govern {
    border: 1px solid var(--hk-purple-25); border-left: 4px solid var(--hk-purple);
    background: linear-gradient(180deg, #ffffff55, transparent), var(--hk-purple-10); border-radius: var(--radius);
    padding: 1.05rem 1.3rem; margin: 1.2rem 0 1.6rem; box-shadow: var(--shadow);
}
.govern h2 { margin: 0 0 .3rem; font-size: 1.02rem; }
.govern p { margin: 0; font-size: .92rem; }
/* Full-width informational note (e.g. the dashboard "financial evaluation is a
   planned fast-follow" notice) — a banner, not a narrow floating card. */
.infonote {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--hk-yellow);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; margin: 0 0 1.6rem;
}
.infonote p { margin: 0; font-size: .92rem; line-height: 1.55; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin: 1rem 0 1.4rem; }
.stat {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.3rem;
    position: relative; overflow: hidden;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hk-purple); opacity: .85; }
.stat.attention::before { background: var(--hk-coral); }
a.stat:hover { text-decoration: none; border-color: var(--hk-purple-50); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat .num { font-size: 2.1rem; font-weight: 800; color: var(--hk-purple-dark); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .label { font-size: .82rem; color: var(--muted); margin-top: .3rem; font-weight: 500; }
.stat.attention .num { color: var(--hk-coral); }
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1.4rem; }
.sysline { font-size: .88rem; color: var(--muted); }

/* Dashboard: a gentle fade-up on load so the page feels alive, with a slight
   stagger across the stat tiles. Disabled under prefers-reduced-motion by the
   global guard near the top of this file. */
@keyframes hk-rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.govern, .infonote, .stat, .needs-attention, .awaiting-block {
    animation: hk-rise .42s var(--ease) both;
}
.stat:nth-child(1) { animation-delay: .03s; }
.stat:nth-child(2) { animation-delay: .08s; }
.stat:nth-child(3) { animation-delay: .13s; }
.stat:nth-child(4) { animation-delay: .18s; }

/* Reusable: horizontal-scroll wrapper so wide tables never break the layout */
.table-wrap { overflow-x: auto; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; }
/* When printing (the decision pack is printed to PDF), never clip a wrapped
   table — let it render in full on paper instead of scrolling. */
@media print { .table-wrap { overflow: visible; } }

/* Reusable: small button (e.g. inline row actions) */
.btn-sm { padding: .25rem .65rem; font-size: .8rem; }
.form-inline { margin: 0; }

/* Back link above a detail page */
.back { margin: 0 0 .3rem; font-size: .9rem; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: .2rem 0 1rem; color: var(--hk-purple-dark); font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 1.28rem; line-height: 1.3; margin: 2rem 0 .7rem; color: var(--hk-purple-dark); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h3 { line-height: 1.35; }
p { margin: .55rem 0; }
.muted { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.toolbar-actions .btn-secondary { margin-left: 0; }

/* Destructive actions (admin-only procurement deletion). */
.danger-btn { background: var(--fail-text); }
.danger-btn:hover { background: #a51b18; }
.cell-actions a { margin-right: .7rem; }
.cell-actions a:last-child { margin-right: 0; }
.danger-link { color: var(--fail-text); }
.danger-link:hover { color: #a51b18; }

/* Cards & forms */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 1.5rem 1.7rem; max-width: 560px;
}
/* Multi-field forms: lay fields out in two columns so they use the available
   width instead of a single cramped column. Items that need the full width
   (textareas, the country picker, paired date fields, the submit button) get
   .span-2. Collapses to one column on narrow screens. */
.card.form-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem; max-width: 880px; align-items: start;
}
.card.form-grid > .span-2 { grid-column: 1 / -1; }
/* Keep buttons at their natural width (grid items stretch by default). */
.card.form-grid > button, .card.form-grid > .btn { justify-self: start; }
@media (max-width: 600px) {
    .card.form-grid { grid-template-columns: 1fr; }
}
label { display: block; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; color: var(--text); }
input, select, textarea {
    width: 100%; padding: .6rem .75rem; margin-top: .35rem; font-size: .95rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-family: inherit;
    color: var(--text); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: #a79fb0; }
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.5; }
/* Multi-role checkboxes (Users page). */
.role-checks { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.role-checks .check-label { margin-bottom: .1rem; white-space: nowrap; font-size: .85rem; font-weight: 400; }
.role-checks .check { width: auto; margin: 0 .35rem 0 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
input[type=file] { padding: .4rem; }
/* Branded file picker button */
input[type=file]::file-selector-button {
    background: var(--hk-purple-10); color: var(--hk-purple); border: 1px solid var(--hk-purple-25);
    border-radius: 6px; padding: .35rem .7rem; margin-right: .7rem; cursor: pointer;
    font: inherit; font-weight: 600;
}
input[type=file]::file-selector-button:hover { background: var(--hk-purple-25); }
/* Required-field marker (darkened Coral Sunshine for AA contrast on white) */
.req { color: #b23c17; font-weight: 700; margin-left: .15rem; text-decoration: none; cursor: help; }
/* Checkbox rows (label not bold, box sized to content) */
.check-label { font-weight: 400; }
.check-label .check { width: auto; margin: 0 .45rem 0 0; }
/* Two date fields side by side (valid from / until) */
.form-2col { display: flex; gap: 1rem; }
.form-2col > label { flex: 1; }
/* Grid country picker */
.countryset {
    border: 1px solid var(--border); border-radius: 6px; padding: .8rem 1rem 1rem;
    margin: 0 0 1rem;
}
.countryset legend { font-size: .9rem; font-weight: 500; color: #344054; padding: 0 .3rem; }
.country-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: .15rem .8rem;
    margin: .5rem 0; max-height: 16rem; overflow-y: auto;
}
.country-grid .check-label { margin-bottom: .2rem; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: .15rem; }
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: .58rem 1.2rem; font-size: .92rem; font-weight: 600; cursor: pointer; font-family: inherit;
    line-height: 1.2; box-shadow: var(--shadow-xs);
    transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn-secondary {
    background: var(--surface); color: var(--hk-purple-dark);
    border-color: var(--border-strong); margin-left: .5rem; box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--hk-purple-10); border-color: var(--hk-purple-50); color: var(--hk-purple-dark); }
.quick-actions .btn-secondary { margin-left: 0; }

/* Tables */
table {
    border-collapse: collapse; width: 100%; margin: 1rem 0; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-xs);
}
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: top; }
th { background: var(--hk-purple-10); font-weight: 700; color: var(--hk-purple-dark); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: var(--surface-2); }

/* Sortable tables — clickable headers (see assets/sortable.js) */
table.sortable th { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th:hover { color: var(--hk-purple); }
table.sortable th:focus-visible { outline: 2px solid var(--hk-purple); outline-offset: -2px; }
table.sortable th::after { content: "\2195"; margin-left: .4rem; font-size: .9em; opacity: .3; } /* ↕ hint */
table.sortable th[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; }   /* ↑ */
table.sortable th[aria-sort="descending"]::after { content: "\2193"; opacity: 1; }  /* ↓ */
table.sortable th[data-no-sort] { cursor: default; } /* e.g. an actions column */
table.sortable th[data-no-sort]:hover { color: inherit; }
table.sortable th[data-no-sort]::after { content: none; }

/* Status badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: #efecf2; color: #475467; }
.badge.pending { background: #fef6e7; color: #b25e09; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.fail { background: var(--fail-bg); color: var(--fail-text); }

/* Flash messages */
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); border-color: #bfe3c9; }
.flash.fail { background: var(--fail-bg); color: var(--fail-text); border-color: #f5c6c2; }

/* Misc */
.ok { color: var(--ok-text); } .fail { color: var(--fail-text); }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
code { background: #f1eef4; padding: .1rem .35rem; border-radius: 4px; font-size: .88em; }
.meta { font-size: .85rem; color: var(--muted); }

/* Searchable combobox */
.combo { position: relative; }
.combo-panel {
    position: absolute; z-index: 30; left: 0; right: 0; margin-top: 2px;
    max-height: 260px; overflow-y: auto; background: #fff;
    border: 1px solid #cdd3da; border-radius: 6px; box-shadow: var(--shadow);
}
.combo-group {
    padding: .35rem .65rem; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em;
    color: #475467; background: #f6f4f8; position: sticky; top: 0;
}
.combo-group.hk { color: var(--primary); }
.combo-item { padding: .45rem .65rem; cursor: pointer; font-size: .92rem; }
.combo-item:hover { background: var(--primary-weak); }
.combo-item.hk { font-weight: 600; }
.combo-item.hk::before { content: "★ "; color: var(--primary); }

/* Grid detail (criteria view) */
.gridmeta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0 .2rem; }
/* A long filename shown as a badge here should wrap/shrink, never force the row
   wider than the viewport on mobile. */
.gridmeta .badge { max-width: 100%; overflow-wrap: anywhere; }
.section-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    margin: 1.8rem 0 .6rem; padding-bottom: .35rem; border-bottom: 2px solid var(--hk-purple-25);
}
.bands { margin-top: .3rem; }
.section-head h2 { margin: 0; font-size: 1.12rem; }
.section-head .sub { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* Collapsible grid sections (grid-view.php) */
.section-tools { display: flex; justify-content: flex-end; margin: 1.2rem 0 -0.6rem; }
details.section { margin: 0; }
summary.section-head { cursor: pointer; list-style: none; }
summary.section-head::-webkit-details-marker { display: none; }
summary.section-head:hover h2 { color: var(--hk-purple); }
summary.section-head:focus-visible { outline: 2px solid var(--hk-purple); outline-offset: 3px; border-radius: 3px; }
summary.section-head h2::before { content: "\25B8"; color: var(--hk-purple); font-size: .8em; margin-right: .5rem; } /* ▸ collapsed */
details.section[open] summary.section-head h2::before { content: "\25BE"; } /* ▾ expanded */
.section-body { padding-top: .2rem; }
.crit {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: .8rem;
}
/* Compliance pass/fail rows get a semantic left stripe so failures pop. */
.crit.crit-pass { border-left: 4px solid #2f9e5f; }
.crit.crit-fail { border-left: 4px solid #d9534f; }
.crit-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.crit-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.crit-head .code { color: var(--muted); font-weight: 700; font-size: .82rem; }
.crit-max {
    white-space: nowrap; font-weight: 700; font-size: .78rem;
    color: var(--hk-purple); background: var(--hk-purple-10);
    padding: .15rem .55rem; border-radius: 999px;
}
.crit .field { margin-top: .65rem; }
.crit .field-label {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
    color: #475467; font-weight: 600; margin-bottom: .2rem;
}
.crit .field-body { font-size: .9rem; }
.crit .ex-strong { border-left: 3px solid var(--ok-text); padding-left: .6rem; }
.crit .ex-weak { border-left: 3px solid var(--fail-text); padding-left: .6rem; }

/* "preview text" link beside a proposal's filename. */
.preview-link { display: inline-block; margin-top: .15rem; font-size: .8rem; }

/* Keep a long file name from stretching the table; full name is in the title. */
.cell-file { display: block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Multi-file upload drop zone (assets/upload.js) */
.dropzone {
    border: 2px dashed var(--hk-purple-25); border-radius: var(--radius);
    background: var(--hk-purple-10); padding: 1rem; margin-top: .3rem; cursor: pointer;
}
.dropzone.dragover { border-color: var(--hk-purple); background: var(--hk-purple-25); }
.dropzone input[type=file] { display: block; width: 100%; cursor: pointer; }
.dropzone-hint { margin: .55rem 0 0; font-size: .85rem; color: var(--muted); }
.dropzone-list { margin: .55rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--text); }
.dropzone-list:empty { display: none; }

/* Per-row action buttons (Re-parse / Screen / Score) stacked tidily in one
   narrow column so their labels never wrap or clip. */
.row-actions { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; min-width: 6.5rem; }
.row-actions .form-inline { margin: 0; }
.row-actions .btn { margin-left: 0; white-space: nowrap; text-align: center; }

/* Quick status filter links above the procurements list. */
.filterbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.filter-link {
    font-size: .82rem; padding: .2rem .7rem; border-radius: 999px;
    border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}
.filter-link:hover { text-decoration: none; border-color: var(--hk-purple-50); }
.filter-link.active { background: var(--hk-purple); border-color: var(--hk-purple); color: #fff; }

/* Procurement progress stepper: Upload → Screen → Score → Review → Decision. */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; list-style: none; padding: 0; margin: .9rem 0 .6rem; }
.step { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.step:not(:last-child)::after { content: "\203A"; margin-left: .5rem; color: var(--hk-purple-50); font-size: 1.15rem; line-height: 1; }
.step-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.45rem; height: 1.45rem; border-radius: 50%; flex: 0 0 auto;
    font-size: .76rem; font-weight: 700;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.step.done .step-mark { background: var(--hk-purple); border-color: var(--hk-purple); color: #fff; }
.step.done .step-label { color: var(--text); }
.step.current .step-mark { border-color: var(--hk-purple); background: var(--hk-purple-10); color: var(--hk-purple); }
.step.current .step-label { color: var(--hk-purple); font-weight: 700; }

/* "What's next" guidance line under a procurement's status. */
.nextstep {
    margin: .2rem 0 1rem; padding: .6rem .9rem; font-size: .9rem;
    background: var(--hk-purple-10); border-left: 3px solid var(--hk-purple);
    border-radius: var(--radius); color: var(--text);
}

/* Dashboard "awaiting the committee" list. */
.awaiting-block { margin: 1.5rem 0; }

/* Pilot scoring entry rows: criterion + score input, with an optional note. */
.pilot-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .9rem; }
.pilot-row > label { flex: 1 1 22rem; margin-bottom: 0; }
.pilot-row .pilot-note { flex: 1 1 16rem; }
.pilot-row input[type=number] { max-width: 8rem; }
.pilot-row .code { color: var(--muted); font-weight: 700; font-size: .82rem; }

/* Top-3 rows in the committee shortlist. */
tr.top3 > td { background: var(--hk-purple-10); }
tr.top3 > td:first-child { box-shadow: inset 3px 0 0 var(--hk-purple); }

/* A score's verbatim citation; flagged variant when it isn't found in the text. */
.crit-cite { font-style: italic; color: var(--muted); }
.crit-cite.cite-flagged {
    font-style: normal; color: var(--text);
    border-left: 3px solid var(--fail-text); padding-left: .6rem;
}

/* Verbatim extracted-text preview (proposal-text.php). */
.doc-text {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.2rem; max-height: 70vh; overflow: auto;
    white-space: pre-wrap; word-break: break-word;
    font-size: .85rem; line-height: 1.55; color: var(--text);
}

/* Disclosure (collapsible create forms) */
.disclosure { margin-top: 1.6rem; }
.disclosure > summary {
    cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .4rem;
    font-size: 1.2rem; font-weight: 700; color: var(--hk-purple);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
    content: "+"; display: inline-flex; align-items: center; justify-content: center;
    width: 1.3rem; height: 1.3rem; border-radius: 50%; font-size: 1rem; line-height: 1;
    background: var(--hk-purple-10); color: var(--hk-purple);
}
.disclosure[open] > summary::before { content: "\2212"; } /* minus */
.disclosure > summary:hover { text-decoration: underline; }
.disclosure[open] > summary { margin-bottom: .4rem; }

@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; padding: .5rem 1rem; gap: .5rem; }
    .topbar-left { flex-wrap: wrap; row-gap: .35rem; }
    .topbar .app-name { border-left: 0; padding-left: 0; font-size: .82rem; }
    .topbar nav { margin-left: 0; flex-wrap: wrap; width: 100%; }
    .topbar .user { font-size: .8rem; }
}

/* User guide (guide.php) */
.lang-switch { align-items: center; }
.guide-steps { margin: .4rem 0 1.4rem; }
.guide-step {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: .6rem; overflow: hidden;
}
.guide-step > summary {
    cursor: pointer; list-style: none; padding: .85rem 1.1rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: .6rem;
}
.guide-step > summary::-webkit-details-marker { display: none; }
.guide-step > summary::before {
    content: "\25B8"; color: var(--hk-purple); font-size: .8em; flex: 0 0 auto;
}
.guide-step[open] > summary::before { content: "\25BE"; }
.guide-step[open] > summary { border-bottom: 1px solid var(--border); background: var(--hk-purple-10); color: var(--hk-purple); }
.guide-step > summary:hover { color: var(--hk-purple); }
.guide-step-body { padding: .9rem 1.1rem 1.1rem; }
.guide-step-body p:first-child { margin-top: 0; }
.guide-prose { max-width: 70ch; }
.guide-prose ul, .guide-prose ol { margin: .4rem 0; padding-left: 1.3rem; }
.guide-prose li { margin: .3rem 0; }

/* Committee list on the procurement page. */
.committee-list { list-style: none; padding: 0; margin: .4rem 0 1rem; max-width: 560px; }
.committee-list li {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .5rem .8rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); margin-bottom: .4rem;
}
.committee-list .form-inline { margin: 0; }
.committee-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; max-width: 560px; }
.committee-add select { width: auto; flex: 1 1 16rem; margin-top: 0; }
/* When the person picker is enhanced into a searchable combobox, the .combo
   wrapper (not the now-hidden <select>) becomes the flex item — size it here. */
.committee-add .combo { flex: 1 1 16rem; min-width: 0; }
.committee-add .combo .combo-input { margin-top: 0; }

/* Dashboard "Needs attention" nudges — actionable items for editors. Mirrors the
   committee-list row pattern with a coral accent to signal something to act on. */
.needs-attention { margin: 1.5rem 0; }
.nudges { list-style: none; padding: 0; margin: .4rem 0 0; max-width: 680px; }
.nudges li {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .65rem .95rem; border: 1px solid var(--border); border-left: 3px solid var(--hk-coral);
    border-radius: var(--radius); background: var(--surface); margin-bottom: .5rem; box-shadow: var(--shadow-xs);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.nudges li:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.nudges .nudge-label { flex: 1; }
/* -----------------------------------------------------------------------------
 * Procurement page — committee table & proposals table enhancements.
 * (Presentation only; the markup that carries these classes lives in
 * public/procurement.php.)
 * -------------------------------------------------------------------------- */

/* Serial-number column: narrow, right-aligned, tabular figures, de-emphasised. */
.col-sn { width: 2.6rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Colour-coded role chips, so the five roles read apart at a glance. */
.role-chip { display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: .1rem .5rem; border: 1px solid transparent; white-space: nowrap; }
.role-chip.superadmin { background: #efe7f4; color: #653670; border-color: var(--hk-purple-25); }
.role-chip.admin      { background: #e6f6fb; color: #1c6c86; border-color: #c3e8f4; }
.role-chip.meal       { background: #fff4dc; color: #7a5c00; border-color: #f0dca0; }
.role-chip.committee  { background: #eef0f2; color: #475467; border-color: #dfe3e7; }
.role-chip.viewer     { background: #f2f0f4; color: #6b7280; border-color: var(--border); }

/* Committee membership marker (who scores vs who runs the process). */
.committee-mark.member    { background: var(--ok-bg); color: var(--ok-text); }
.committee-mark.nonmember { background: #efecf2; color: #475467; }

/* Inline "set as member / set non-scoring" toggle under the marker — a subtle
 * ghost pill, so it reads as a secondary control (scoped to beat the base
 * `button` fill, which otherwise makes it a heavy solid button). */
.membership-toggle { margin: .3rem 0 0; }
.membership-toggle button {
    background: transparent; color: var(--primary); border: 1px solid var(--hk-purple-25);
    padding: .1rem .55rem; font-size: .72rem; font-weight: 600; line-height: 1.55;
    border-radius: 999px; cursor: pointer;
}
.membership-toggle button:hover { background: var(--hk-purple-10); border-color: var(--hk-purple-50); color: var(--primary-hover); text-decoration: none; }
.membership-toggle button:focus-visible { outline: 2px solid var(--hk-purple); outline-offset: 2px; border-radius: 999px; }

/* Committee table: vertical rhythm and the members-first summary line. */
.committee-table td { vertical-align: middle; }
.committee-table .who { font-weight: 600; }
.committee-table .email a { font-size: .85rem; }
.committee-summary { color: var(--muted); font-size: .85rem; margin: .1rem 0 .3rem; }

/* Proposals table beautification. */
.data-table thead th { position: sticky; top: 0; z-index: 1; }
.data-table tbody tr:nth-child(even) { background: #fbfafc; }
.data-table tbody tr:hover { background: var(--hk-purple-10); }
.vendor-cell a, .vendor-cell .vendor-plain { font-weight: 600; }
.pts { font-variant-numeric: tabular-nums; }
/* Thin left status stripe: green compliant, red non-compliant, neutral otherwise.
 * A semantic cue, kept separate from the purple brand accent. */
.data-table tbody tr { box-shadow: inset 3px 0 0 var(--border); }
.data-table tbody tr.is-compliant    { box-shadow: inset 3px 0 0 #38a169; }
.data-table tbody tr.is-noncompliant { box-shadow: inset 3px 0 0 #e07a72; }

/* Summary strip above the proposals table. */
.table-summary { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .2rem 0 .1rem; }
.badge.count { background: var(--hk-purple-10); color: var(--hk-purple-dark); }

/* Bid-intake banner — the officer's "all bids uploaded" gate. Purple while
 * intake is open (action needed), green once closed (ready to process). */
.intake-note {
    display: flex; justify-content: space-between; align-items: center; gap: .6rem 1.2rem; flex-wrap: wrap;
    border: 1px solid var(--border); border-left: 4px solid var(--hk-purple); border-radius: var(--radius);
    padding: .8rem 1rem; margin: .2rem 0 1.1rem; background: var(--hk-purple-10);
}
.intake-note.closed { border-left-color: #2f9e5f; background: #f3faf5; }
.intake-note .hint { margin-top: .2rem; }
.intake-note form { margin: 0; }
/* Visible ghost pill (scoped so the base solid-button style can't leak in and
   render it as an unreadable purple block). */
.intake-note .intake-reopen {
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--primary);
    padding: .42rem .85rem; border-radius: var(--radius-sm); font: inherit; font-size: .85rem; font-weight: 600;
    text-decoration: none; cursor: pointer; box-shadow: var(--shadow-xs); white-space: nowrap;
}
.intake-note .intake-reopen:hover { background: var(--hk-purple-10); border-color: var(--hk-purple-50); color: var(--primary-hover); text-decoration: none; }

/* On-brand tooltip: a small dark bubble on hover/focus. Keyboard-accessible
 * (works on :focus-visible) and CSP-clean (no JS). Set the text via data-tip. */
.tip { position: relative; }
.tip[data-tip]:hover::after,
.tip[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: calc(100% + .4rem); transform: translateX(-50%);
    background: #2b2431; color: #fff; font-size: .72rem; font-weight: 400; line-height: 1.3;
    white-space: normal; width: max-content; max-width: 15rem; text-align: left;
    padding: .4rem .55rem; border-radius: 6px; box-shadow: var(--shadow); z-index: 5;
    pointer-events: none;
}
/* Inside a horizontally-scrollable table the wrapper clips (overflow-x:auto
 * forces overflow-y:auto), so the action-column tooltip opens to the LEFT,
 * vertically centred — into the table interior, clear of both clipped edges. */
.row-actions .tip[data-tip]:hover::after,
.row-actions .tip[data-tip]:focus-visible::after {
    left: auto; right: calc(100% + .5rem); bottom: auto; top: 50%; transform: translateY(-50%);
}

/* Warning-tinted hint (e.g. non-compliant exclusions on the review page). */
.hint-warn { color: var(--fail-text); }

/* Non-blocking "check this" notice — e.g. a possibly-missing bid document. */
.docflag {
    background: #FFF7DB; border: 1px solid #E7C200; color: #6b5600;
    border-radius: var(--radius); padding: .6rem .9rem; font-size: .88rem; margin: .2rem 0 1rem;
}
.docflag-mini { display: inline-block; margin-top: .15rem; font-size: .76rem; color: #8a6d00; }

/* ---- AI recognition (proposal-files.php) --------------------------------- */
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .2rem 0 1rem; }
.ai-actions form { margin: 0; }
.recognition { max-width: 40rem; margin: 0 0 1.2rem; }
.recognition .rec-name { font-size: 1.05rem; margin: .2rem 0 .4rem; }
.recognition .rec-evidence {
    border-left: 3px solid var(--hk-purple-25); margin: .5rem 0; padding: .3rem 0 .3rem .8rem;
    color: var(--muted); font-style: italic;
}
.recognition .rec-confirm { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; }
.recognition .rec-confirm button { background: var(--hk-gray); }
.recognition .rec-confirm:first-of-type button { background: var(--primary); }

/* ---- Per-procurement checklist (checklist.php) --------------------------- */
/* Each requirement is a collapsible card: the requirement + source badge form a
 * one-line summary (so a long RFP checklist stays scannable), and the edit form
 * or guidance lives in the body, revealed on click. */
.checklist-item { max-width: 46rem; margin: 0 0 .6rem; padding: 0; }
.checklist-item > summary {
    list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .5rem;
    padding: .65rem 1rem;
}
.checklist-item > summary::-webkit-details-marker { display: none; }
.checklist-item > summary::before { content: "\25B8"; color: var(--hk-purple); font-size: .8em; }
.checklist-item[open] > summary::before { content: "\25BE"; }
.checklist-item[open] > summary { border-bottom: 1px solid var(--border); }
.checklist-item > summary:hover .ci-req { color: var(--hk-purple); }
.checklist-item > summary:focus-visible { outline: 2px solid var(--hk-purple); outline-offset: -2px; border-radius: var(--radius); }
.checklist-item .ci-req { font-weight: 600; overflow-wrap: anywhere; }
.checklist-item .ci-body { padding: .8rem 1rem 1rem; }
.checklist-item .inline-delete { margin-top: .4rem; }
.generate-form { margin-top: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.btn-danger { background: #b23c17; }
.btn-danger:hover { background: #97300f; }

/* ---- Start-from-RFP setup (procurements.php) ----------------------------- */
.rfp-setup { max-width: none; margin-bottom: 1rem; background: var(--hk-purple-10); border-color: var(--hk-purple-25); }
.prefill-note {
    background: #FFF7DB; border: 1px solid #E7C200; color: #6b5600;
    border-radius: var(--radius); padding: .6rem .9rem; font-size: .9rem; margin: 0 0 1rem; max-width: none;
}

/* ---- Grid authorization (grid-view.php, criteria.php) -------------------- */
.authbar {
    border-radius: var(--radius); padding: .7rem 1rem; margin: .6rem 0 1.2rem; font-size: .92rem;
    border: 1px solid var(--border);
}
.authbar.ok { background: var(--ok-bg); border-color: #b7e1c4; color: var(--ok-text); }
.authbar.fail { background: var(--fail-bg); border-color: #f4c7c3; color: #7a271a; }
/* Pending authorization is a "not yet" state, not an error — amber, not red. */
.authbar.warn { background: #fef6e7; border-color: #f2d19a; color: #8a5a00; }
.authbar .authorize-form { margin: .6rem 0 0; }
.authbar .authorize-form input[type=text] { max-width: 30rem; }
.authbar .authorize-form button { margin-top: .4rem; }

/* Settings page (settings.php): a quick section jump-nav, and each setting laid
 * out as description-left / control-right so the page reads as a tidy list
 * rather than a tall stack of identical cards. Collapses to one column on
 * narrow screens. */
.settings-nav { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: .4rem 0 1.4rem; }
.settings-nav a {
    font-size: .85rem; padding: .28rem .7rem; border-radius: 999px;
    border: 1px solid var(--hk-purple-25); background: var(--surface); color: var(--primary);
}
.settings-nav a:hover { background: var(--hk-purple-10); text-decoration: none; }
.settings-section {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 1rem 2.4rem;
    align-items: start; padding: 1.4rem 0; border-top: 1px solid var(--border);
}
.settings-section:first-of-type { border-top: 0; padding-top: .4rem; }
.settings-section .settings-desc h2 { margin-top: 0; }
.settings-section .settings-desc p { margin-bottom: 0; }
.settings-section .card { margin: 0; max-width: none; width: 100%; }
@media (max-width: 760px) {
    .settings-section { grid-template-columns: 1fr; gap: .4rem; padding: 1.1rem 0; }
}
/* Monospace textarea for line-per-item lists (e.g. the countries list). */
textarea.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9rem; }

/* Appearance: nav-bar colour picker (Settings → Appearance). */
.theme-picker { border: 0; padding: 0; margin: 0 0 .4rem; display: flex; flex-direction: column; gap: .5rem; }
.theme-choice { display: flex; align-items: center; gap: .65rem; margin: 0; font-weight: 500; cursor: pointer; }
.theme-choice input { width: auto; margin: 0; }
.theme-choice .swatch {
    width: 2.4rem; height: 1.5rem; border-radius: 6px; flex: 0 0 auto;
    border: 1px solid rgba(36,29,43,.14); box-shadow: var(--shadow-xs);
}
.swatch--purple { background: #7a4183; }
.swatch--blue   { background: #41b6e6; }
.swatch--yellow { background: #f1c400; }
.swatch--coral  { background: #f87c56; }
.swatch--gray   { background: #5b6770; }
.theme-name { font-size: .92rem; }
.crit-move form { display: flex; gap: .2rem; margin: 0; }
.crit-move button { line-height: 1; }

/* ---- Committee decision pack (report.php) -------------------------------- */
.report-actions { display: flex; gap: .6rem; align-items: center; margin: 0 0 1.2rem; }
.report { max-width: 50rem; }
.report-head { border-bottom: 2px solid var(--hk-purple); padding-bottom: .8rem; margin-bottom: 1.2rem; }
.report-org { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--hk-purple); font-weight: 700; margin: 0; }
.report-head h1 { margin: .2rem 0; }
.report-sub { margin: .1rem 0; font-size: 1.05rem; }
.report-meta { font-size: .82rem; color: var(--muted); margin: .3rem 0 0; }
.report-govern { background: var(--hk-purple-10); border-radius: var(--radius); padding: .7rem .9rem; font-size: .88rem; }
.report-decision { border-left: 4px solid var(--hk-purple); padding: .4rem .9rem; margin: 1rem 0; }
.report-rationale { margin-top: .3rem; font-size: .9rem; }
.report-note, .report-foot p { font-size: .82rem; color: var(--muted); }
.report-flag { font-size: .72rem; color: var(--fail-text); font-weight: 700; margin-left: .35rem; }
.report-proposal { margin-top: 1.6rem; }
.report-proposal h2 { border-bottom: 1px solid var(--border); padding-bottom: .25rem; }
.report-total { float: right; font-size: .9rem; color: var(--hk-purple); font-weight: 700; }
.report-file { font-size: .82rem; color: var(--muted); margin: .1rem 0 .6rem; }
.report-block { margin: .7rem 0; }
.report-block-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #475467; font-weight: 600; margin-bottom: .2rem; }
.report-checks { margin: .2rem 0; padding-left: 1.1rem; font-size: .88rem; }
.report-checks .pass { color: var(--ok-text); font-weight: 700; }
.report-checks .fail { color: var(--fail-text); font-weight: 700; }
.report-score-cell { white-space: nowrap; font-weight: 600; }
.report-cite { margin: .35rem 0 0; padding-left: .7rem; border-left: 3px solid var(--border); color: var(--muted); font-style: italic; font-size: .86rem; }
.report .code { color: var(--muted); font-weight: 700; font-size: .8rem; }
.report-foot { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.report-audit { margin-top: 2rem; }
.report-audit h2 { border-bottom: 2px solid var(--hk-purple); padding-bottom: .3rem; }
.report-audit h3 { font-size: 1rem; color: var(--hk-purple); margin: 1.4rem 0 .4rem; }
.report-audit table { font-size: .84rem; }
.report-stale { background: var(--fail-bg); color: var(--fail-text); border-radius: var(--radius); padding: .6rem .9rem; font-size: .9rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

@media print {
    /* Strip the app chrome and on-screen controls — print only the document. */
    .topbar, .skip-link, .report-actions, .flash-region { display: none !important; }
    main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    a { color: inherit; text-decoration: none; }
    .report { max-width: none; }
    .report-govern { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    /* Each shortlisted proposal starts on a fresh page; keep rows intact. */
    .report-proposal { page-break-before: always; }
    .report-audit { page-break-before: always; }
    .report-scores tr, .report-checks li, .report-cite,
    .report-timeline tr, .report-ailog tr, .report-allprops tr { page-break-inside: avoid; }
    h2, h3 { page-break-after: avoid; }
}

/* --- Scoring-grid weights editor (public/criteria.php) -------------------- */
.wpanel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1rem 0 1.5rem; box-shadow: var(--shadow-xs); }
.wpanel > h2 { margin-top: 0; }
.wchart { display: flex; flex-direction: column; gap: .4rem; margin: .75rem 0; }
.wchart-row { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr auto; align-items: center; gap: .6rem; }
.wchart-label { font-size: .9rem; overflow-wrap: anywhere; }
.wchart-track { position: relative; height: .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.wbar { display: block; height: 100%; width: 0; border-radius: 999px; transition: width var(--dur) var(--ease); background: var(--hk-purple); }
.wbar.wbar-c0 { background: var(--hk-purple); }
.wbar.wbar-c1 { background: var(--hk-blue); }
.wbar.wbar-c2 { background: var(--hk-coral); }
.wbar.wbar-c3 { background: var(--hk-yellow); }
.wbar.wbar-c4 { background: var(--hk-gray); }
.wbar.over { background: var(--fail-text); }
.wchart-val { font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wtotal { font-size: .95rem; padding: .4rem .6rem; border-radius: var(--radius-sm); background: var(--bg); }
.wtotal.ok { background: var(--ok-bg); color: var(--ok-text); }
.wtotal.fail { background: var(--fail-bg); color: var(--fail-text); }
.wfield { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .75rem; margin: .6rem 0; }
.wfield legend { font-weight: 600; padding: 0 .35rem; }
.wrow { display: grid; grid-template-columns: 1fr 7rem; align-items: center; gap: .6rem; padding: .2rem 0; }
.wrow-name { font-size: .9rem; overflow-wrap: anywhere; }
.wrow .weight-input { width: 100%; }
.wactions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
