/* GideonHelm design system.
 *
 * Two rules carry the whole look:
 *   green  = activity data and positive status (the heatmap scale)
 *   iris   = anything you can act on (links, primary buttons, focus, active tab)
 * Variable names predate this file and are used inline across templates, so
 * the originals are kept and only their values changed.
 */
:root {
    color-scheme: dark;

    --bg: #0f1217;          /* night: page */
    --surface: #161a21;     /* panel */
    --raised: #1e232c;      /* inputs, hover rows, menus */
    --border: #2a303b;      /* rule */
    --text: #e8ebf1;
    --text-muted: #8c94a4;
    --text-faint: #5f6778;

    --iris: #8f9dff;
    --iris-strong: #a9b4ff;
    --iris-ink: #10142b;    /* text on iris fills */
    --iris-tint: rgba(143, 157, 255, .14);
    --link: var(--iris);

    --green-1: #0e4429;
    --green-2: #006d32;
    --green-3: #26a641;
    --green-4: #39d353;
    --orange: #e0a440;
    --gray: #4a5160;
    --red: #f2555a;
    --danger: var(--red);

    --radius-panel: 10px;
    --radius-control: 6px;

    --font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-display: "IBM Plex Sans Condensed", "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-ui);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--iris-strong); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 4px; }

h1 {
    font-family: var(--font-display);
    font-size: 30px; font-weight: 600; line-height: 1.15;
    letter-spacing: -.01em; margin-bottom: 16px;
}
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
p + p { margin-top: 8px; }
strong { font-weight: 600; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Native controls, themed everywhere ---------- */

input, select, textarea, button { font: inherit; color: inherit; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input:not([type]), select, textarea {
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-control);
    padding: 7px 10px;
    font-size: 14px;
    min-height: 34px;
    transition: border-color .12s;
}
input:hover, select:hover, textarea:hover { border-color: #3a4252; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-tint); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { padding-right: 28px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--iris); width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }

/* ---------- Sidebar ----------
 * One grouped sidebar replaces the old top nav. Desktop collapses it to an
 * icon rail (html.side-collapsed, restored in <head> before paint); at phone
 * width it is an overlay opened from .mobile-bar (html.side-open). Icons sit
 * at the same x in both desktop states, so collapsing never moves them.
 */

:root { --side-w: 232px; --side-rail: 60px; }

.app { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }
.app-main { min-width: 0; }

.sidebar {
    position: sticky; top: 0; height: 100vh; width: var(--side-w);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--border);
    overflow: hidden; z-index: 100;
    transition: width .16s ease;
}
.side-head {
    display: flex; align-items: center; gap: 8px; height: 52px;
    padding: 0 12px 0 23px; flex: none; white-space: nowrap;
}
.side-brand {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text);
}
.side-brand:hover { color: var(--text); text-decoration: none; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-mark {
    display: inline-grid; grid-template-columns: repeat(2, 6px); gap: 2px; flex: none;
}
.brand-mark i { width: 6px; height: 6px; border-radius: 1.5px; background: var(--green-2); }
.brand-mark i:nth-child(2) { background: var(--green-4); }
.brand-mark i:nth-child(3) { background: var(--green-3); }
.brand-mark i:nth-child(4) { background: var(--green-1); }
.build-badge {
    font-family: var(--font-ui); font-size: 11px; font-weight: 500; color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

/* Sized so the full finance sidebar fits a 900px-tall window without scrolling */
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px 0 8px; }
.side-foot { flex: none; border-top: 1px solid var(--border); padding: 6px 0 10px; }
.side-group + .side-group { margin-top: 8px; }
.side-group ul { list-style: none; }
/* The only uppercase in the app: group headings are wayfinding, not content */
.side-heading {
    height: 22px; padding: 4px 22px 0; font-size: 11px; line-height: 18px; font-weight: 600; color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
/* Account needs no visible heading at the foot; it stays as the list's label */
.side-foot .side-heading {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%);
}

.side-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    margin: 0 8px; padding: 0 14px; height: 28px;
    border-radius: var(--radius-control); color: var(--text-muted);
    font-size: 14px; font-weight: 500; white-space: nowrap;
    background: none; border: 0; cursor: pointer; width: calc(100% - 16px); text-align: left;
}
.side-icon { flex: none; }
.side-label { overflow: hidden; text-overflow: ellipsis; }
a.side-link:hover, button.side-link:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.side-link.active { color: var(--text); background: var(--iris-tint); }
.side-link.active .side-icon { color: var(--iris); }
.side-link.active::before {
    content: ""; position: absolute; left: -8px; top: 5px; bottom: 5px;
    width: 3px; border-radius: 0 2px 2px 0; background: var(--iris);
}
.side-user { cursor: default; color: var(--text); }
.side-toggle .side-icon { transition: transform .16s ease; }

.side-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
    background: none; border: 0; border-radius: var(--radius-control);
    color: var(--text-muted); cursor: pointer;
}
.side-btn:hover { color: var(--text); background: var(--raised); }
.side-close, .mobile-bar, .side-scrim { display: none; }

.public-bar {
    display: flex; align-items: center; height: 56px; padding: 0 24px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}

/* Desktop rail: labels clip to screen-reader text, headings become rules */
@media (min-width: 761px) {
    .side-collapsed .sidebar { width: var(--side-rail); }
    .side-collapsed .side-brand-text { display: none; }
    .side-collapsed .side-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
    }
    /* Same height as the label it replaces, so items keep their place */
    .side-collapsed .side-scroll .side-heading { position: relative; font-size: 0; }
    .side-collapsed .side-scroll .side-heading::after {
        content: ""; position: absolute; left: 18px; right: 18px; top: 50%;
        border-top: 1px solid var(--border);
    }
    .side-collapsed .side-toggle .side-icon { transform: scaleX(-1); }
}

/* Phone: slim top strip, sidebar slides in over a scrim */
@media (max-width: 760px) {
    .app { display: block; }
    .mobile-bar {
        display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 6px;
        background: var(--surface); border-bottom: 1px solid var(--border);
        position: sticky; top: 0; z-index: 90;
    }
    .mobile-bar .side-brand { font-size: 17px; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; height: auto;
        width: min(280px, 86vw); z-index: 210;
        transform: translateX(-100%); visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
        box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    }
    .side-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
    .side-close { display: inline-grid; margin-left: auto; }
    .side-toggle { display: none; }
    .side-link { height: 36px; }
    .side-scrim {
        display: block; position: fixed; inset: 0; z-index: 200;
        background: rgba(5, 7, 10, .6); opacity: 0; pointer-events: none;
        transition: opacity .2s ease;
    }
    .side-open .side-scrim { opacity: 1; pointer-events: auto; }
    .side-open body { overflow: hidden; }
}

.breadcrumbs {
    padding: 10px 24px 0; font-size: 13px; color: var(--text-muted);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    max-width: 1400px; margin: 0 auto;
}
.breadcrumbs:empty, .breadcrumbs.is-empty { display: none; }
.bc-sep { color: var(--text-faint); margin: 0 2px; }
.bc-link { color: var(--text-muted); }
.bc-link:hover { color: var(--iris); }
.bc-current { color: var(--text); }

.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; }

/* ---------- Page header and section tabs ---------- */

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 0; }
.page-sub { color: var(--text-muted); margin-top: 4px; max-width: 72ch; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Panels, notices ---------- */

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-panel); padding: 20px; margin-bottom: 16px;
}
.card > h2:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin-bottom: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 16px 20px 0; }

.notice {
    display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    padding: 12px 16px; border-radius: var(--radius-panel); margin-bottom: 16px;
    border: 1px solid var(--border); background: var(--surface);
}
.notice-error { border-color: rgba(242, 85, 90, .45); background: rgba(242, 85, 90, .08); color: #ffb4b6; }
.notice-warn { border-color: rgba(224, 164, 64, .45); background: rgba(224, 164, 64, .08); color: #f3cf8d; }
.notice-info { border-color: rgba(143, 157, 255, .35); background: var(--iris-tint); }

.empty { color: var(--text-muted); padding: 28px 0; text-align: center; }

/* ---------- Forms ---------- */

.form-group { margin-bottom: 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-group label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: 15px; flex: none; }
.form-group label.check { color: var(--text); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 14px; align-items: end; }
.form-grid .form-group { margin-bottom: 0; }
.form-row { display: flex; gap: 12px 14px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { margin-bottom: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.hint { font-size: 13px; color: var(--text-muted); }

.controls { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.controls button { cursor: pointer; }

/* ---------- Buttons ---------- */

.btn, .controls button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 14px; min-height: 34px; border-radius: var(--radius-control);
    border: 1px solid var(--border); background: var(--raised);
    color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s;
}
.btn:hover, .controls button:hover { border-color: #3a4252; background: #252b36; text-decoration: none; color: var(--text); }
.btn-primary, .controls button.active { background: var(--iris); border-color: var(--iris); color: var(--iris-ink); }
.btn-primary:hover, .controls button.active:hover { background: var(--iris-strong); border-color: var(--iris-strong); color: var(--iris-ink); }
.btn-danger { background: transparent; border-color: rgba(242, 85, 90, .5); color: var(--red); }
.btn-danger:hover { background: rgba(242, 85, 90, .12); border-color: var(--red); color: #ff8a8e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-active { background: var(--iris-tint); border-color: rgba(143, 157, 255, .45); color: var(--iris-strong); }
.btn-sm { padding: 3px 10px; min-height: 28px; font-size: 13px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th {
    color: var(--text-muted); font-weight: 500; font-size: 13px; white-space: nowrap;
    background: var(--surface);
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text); }
.data-table th.sortable::after { content: "↕"; margin-left: 6px; opacity: .35; font-size: 11px; }
.data-table th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: var(--iris); }
.data-table th[aria-sort="descending"]::after { content: "↓"; opacity: 1; color: var(--iris); }
.data-table tr.filter-row th { padding-top: 0; padding-bottom: 8px; }
.data-table .filter-control { width: 100%; min-width: 90px; min-height: 30px; padding: 4px 8px; font-size: 13px; font-weight: 400; }
.data-table select.filter-control { padding-right: 26px; }
.data-table tbody tr[hidden] { display: none; }
/* Finance overview: quarter pies and the quarter-over-quarter table */
.pie-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.pie-grid .card { margin-bottom: 0; }
.pie-body { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; padding-top: 4px; }
.pie-wrap { position: relative; width: 220px; height: 220px; flex: none; }
.pie-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pie-total { font-family: var(--font-display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pie-note { font-size: 12px; color: var(--text-muted); }
.pie-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: grid; gap: 8px; font-size: 14px; }
.pie-legend li { display: grid; grid-template-columns: 12px 1fr auto 3.2em; align-items: center; gap: 10px; }
.pie-val { font-variant-numeric: tabular-nums; }
.pie-pct { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.pie-legend .swatch { margin-right: 0; }
.quarter-table td:first-child { white-space: nowrap; }
.quarter-table tfoot th { color: var(--text); font-weight: 500; font-size: 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.quarter-table tfoot tr:first-child th { border-top: 1px solid var(--text-faint); }
.quarter-table tfoot tr.total th { font-weight: 600; }
.quarter-table tfoot tr:last-child th { color: var(--text-muted); border-bottom: none; }
@media (max-width: 640px) { .pie-grid { grid-template-columns: 1fr; } }

/* Relationships */
.rel-graph-wrap { width: 100%; max-width: 760px; margin: 0 auto; }
.rel-graph { width: 100%; height: auto; display: block; }
.rel-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.rel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rel-legend i { display: inline-block; }
.lg-line { width: 20px; height: 4px; border-radius: 2px; background: var(--iris); }
.lg-drift { width: 20px; border-top: 2px dashed var(--orange); }
.lg-ring { width: 12px; height: 12px; border-radius: 50%; }
.lg-spof { border: 3px solid var(--red); }
.lg-loner { border: 2px dashed var(--orange); }
.rel-flags, .rel-top { list-style: none; margin: 0; padding: 0; }
.rel-flags li { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.45; flex-wrap: wrap; }
.rel-flag { flex: none; width: 170px; font-size: 12px; font-weight: 600; }
.rel-flag-spof, .rel-flag-bottleneck { color: var(--red); }
.rel-flag-loner, .rel-flag-drifting { color: var(--orange); }
.rel-flags li > span:last-child { flex: 1; min-width: 200px; }
.rel-top li { border-top: 1px solid var(--border); }
.rel-top summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; cursor: pointer; list-style: none; }
.rel-top summary::-webkit-details-marker { display: none; }
.rel-top summary .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rel-top details p { margin: 0; padding: 0 20px 12px; }
.rel-top li.empty { padding: 16px 20px; }

/* Member page tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 20px; overflow-x: auto; }
.tab-link {
    padding: 10px 14px; color: var(--text-muted); font-weight: 500; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-link:hover { color: var(--text); text-decoration: none; }
.tab-link.active { color: var(--text); border-bottom-color: var(--iris); }
.period-form { padding: 14px 20px; }
.section-title { font-family: var(--font-display); font-size: 22px; margin: 28px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.loc-add { color: var(--green-4); }
.loc-del { color: var(--red); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.branch { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-toggle {
    background: none; border: 0; padding: 0 6px 0 0; color: var(--text-muted); cursor: pointer;
    font-size: 12px; line-height: 1; vertical-align: 1px;
}
.commit-toggle:hover { color: var(--text); }
.commit-toggle[aria-expanded="true"] .chev { display: inline-block; transform: rotate(90deg); }
.commit-files { margin-top: 10px; }
.file-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.file-table td { padding: 3px 8px 3px 0; border: 0; }
.file-table td.num { text-align: right; width: 4.5em; font-variant-numeric: tabular-nums; }
.file-table td.mono { word-break: break-all; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 13px; color: var(--text); background: var(--iris-tint); border: 1px solid rgba(143, 157, 255, .35);
}
.chip:hover { text-decoration: none; border-color: var(--iris); }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table td.empty { text-align: center; color: var(--text-muted); }
.data-table select { min-height: 30px; padding: 4px 26px 4px 8px; font-size: 13px; }
.card-flush .data-table th:first-child, .card-flush .data-table td:first-child { padding-left: 20px; }
.card-flush .data-table th:last-child, .card-flush .data-table td:last-child { padding-right: 20px; }

.key { font-weight: 600; white-space: nowrap; }
.sub { display: block; color: var(--text-muted); font-size: 13px; }

/* ---------- Stats (condensed readouts) ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-panel); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--surface); padding: 14px 18px; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-value { white-space: nowrap; font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--text-muted); }
.stat-value.good { color: var(--green-4); }
.stat-value.warn { color: var(--orange); }
.stat-value.bad { color: var(--red); }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px;
    border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 20px;
    background: var(--raised); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge-ok { background: rgba(38, 166, 65, .14); color: var(--green-4); border-color: rgba(38, 166, 65, .35); }
.badge-error { background: rgba(242, 85, 90, .12); color: #ff8a8e; border-color: rgba(242, 85, 90, .35); }
.badge-warn { background: rgba(224, 164, 64, .12); color: var(--orange); border-color: rgba(224, 164, 64, .35); }
.badge-info { background: var(--iris-tint); color: var(--iris-strong); border-color: rgba(143, 157, 255, .35); }
.badge-running { background: var(--iris-tint); color: var(--iris-strong); border-color: rgba(143, 157, 255, .35); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Activity heatmap (dashboard) ---------- */

.heatmap { overflow-x: auto; margin-top: 16px; }
.heatmap-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.heatmap-table th {
    padding: 4px 2px; font-weight: 400; color: var(--text-faint); font-size: 11px;
    position: sticky; top: 0; background: var(--bg); font-variant-numeric: tabular-nums;
}
.heatmap-table td { padding: 1px; }
.heatmap-name {
    padding: 4px 12px 4px 0 !important; font-size: 13px; white-space: nowrap;
    position: sticky; left: 0; background: var(--bg); cursor: pointer;
}
.heatmap-name:hover { color: var(--iris); }
.heatmap-cell { width: 14px; height: 20px; border-radius: 3px; display: inline-block; }
.cell-offline { background: #191d24; }
.cell-away { background: var(--gray); }
.cell-busy, .cell-dnd { background: var(--orange); }
.cell-active-1 { background: var(--green-1); }
.cell-active-2 { background: var(--green-2); }
.cell-active-3 { background: var(--green-3); }
.cell-active-4 { background: var(--green-4); }

.legend { display: flex; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.timeline {
    position: relative; height: 40px; background: var(--raised);
    border-radius: var(--radius-control); margin: 8px 0; overflow: hidden;
}
.timeline-dot {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; border-radius: 50%; z-index: 1;
}
.dot-github { background: var(--green-3); }
.dot-jira { background: var(--iris); }

/* ---------- Salary history editor (roster Edit dialog) ---------- */

.salary-editor td { padding: 6px 8px; }
.salary-editor input[type="date"] { width: 150px; }
.salary-editor input[type="number"] { width: 130px; }
.salary-editor input[type="text"] { width: 100%; min-width: 120px; }
.salary-editor tr.removing td:not(:last-child) { opacity: .45; text-decoration: line-through; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Org chart ---------- */

.org-tree, .org-tree ul { list-style: none; }
.org-tree ul { margin-left: 22px; padding-left: 18px; border-left: 1px solid var(--border); }
.org-tree li { position: relative; margin: 6px 0; }
.org-tree ul > li::before {
    content: ""; position: absolute; left: -18px; top: 22px; width: 14px; border-top: 1px solid var(--border);
}
.org-tree > ul { margin: 0; padding: 0; border-left: none; }
.org-tree > ul > li::before { display: none; }
.org-tree summary { list-style: none; cursor: pointer; }
.org-tree summary::-webkit-details-marker { display: none; }
.org-node {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 8px 14px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-panel);
    background: var(--surface); min-width: 260px;
}
details > summary .org-node::before {
    content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(-45deg); transition: transform .15s; margin: 0 2px;
}
details[open] > summary .org-node::before { transform: rotate(45deg); }
.org-node .who { display: flex; flex-direction: column; line-height: 1.3; }
.org-node .who a { color: var(--text); font-weight: 600; }
.org-node .who a:hover { color: var(--iris); }
.org-node .role { color: var(--text-muted); font-size: 13px; }
.org-node .count { margin-left: auto; }
.org-leaf .org-node { padding-left: 14px; }

/* Top-to-bottom chart (wide screens); the indented list above is for phones */
.org-chart-wrap { overflow-x: auto; padding: 24px 16px; }
.org-chart { width: max-content; margin: 0 auto; --org-line: #3a4150; }
.org-chart ul { display: flex; justify-content: center; position: relative; padding-top: 22px; margin: 0; list-style: none; }
.org-chart > ul { padding-top: 0; gap: 28px; }
.org-chart li { position: relative; padding: 22px 6px 0; display: flex; flex-direction: column; align-items: center; }
.org-chart > ul > li { padding-top: 0; }
/* Connectors: each child draws half the bar above it plus its own drop */
.org-chart ul ul > li::before, .org-chart ul ul > li::after {
    content: ""; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1px solid var(--org-line);
}
.org-chart ul ul > li::before { right: 50%; }
.org-chart ul ul > li::after { left: 50%; border-left: 1px solid var(--org-line); }
.org-chart ul ul > li:first-child::before, .org-chart ul ul > li:last-child::after { border-top: 0; }
.org-chart ul ul > li:last-child::before { border-right: 1px solid var(--org-line); border-top-right-radius: 6px; }
.org-chart ul ul > li:first-child::after { border-top-left-radius: 6px; }
.org-chart ul ul > li:only-child::before { display: none; }
.org-chart ul ul > li:only-child::after { border-top: 0; border-radius: 0; }
.org-chart ul ul > li:last-child:not(:only-child)::after { display: none; }
.org-chart li > ul::before {  /* the drop from a manager to the bar */
    content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1px solid var(--org-line);
}
/* Individual contributors in a column, joined by a spine behind the cards */
.org-chart ul.org-stack { flex-direction: column; align-items: center; gap: 10px; }
.org-chart ul.org-stack::before { bottom: 24px; height: auto; }
.org-chart ul.org-stack > li { padding: 0; }
.org-chart ul.org-stack > li::before, .org-chart ul.org-stack > li::after { display: none; }
.org-card {
    position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; text-align: left;
    width: 210px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-panel);
    background: var(--surface);
}
.org-card .who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.org-card .who a { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.org-card .who a:hover { color: var(--iris); }
.org-card .role { color: var(--text-muted); font-size: 12.5px; }
.org-card .count { color: var(--text-muted); font-size: 12px; font-family: var(--font-display); margin-top: 2px; }
@media (min-width: 761px) { .org-tree { display: none; } }
@media (max-width: 760px) { .org-chart-wrap { display: none; } }

/* Avatars: Microsoft 365 photo, or initials */
.avatar {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: var(--av, 32px); height: var(--av, 32px); border-radius: 50%; overflow: hidden;
    background: var(--raised); border: 1px solid var(--border);
    color: var(--text-muted); font-size: calc(var(--av, 32px) * .38); font-weight: 600; letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-header-who { display: flex; align-items: center; gap: 14px; }
.name-with-avatar { display: flex; align-items: center; gap: 10px; }
/* Capitalization settings: projects that aren't synced are quieter */
.proj-modes tr.proj-off td strong, .proj-modes tr.proj-off td .sub { opacity: .6; }
.proj-kind { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.proj-kind-scrum { color: var(--iris-strong); border-color: rgba(143, 157, 255, .35); }

/* Team review: column headers are sort buttons */
.team-sort { background: none; border: 0; padding: 0; color: var(--text-muted); font: inherit; cursor: pointer; white-space: nowrap; }
.team-sort span { color: var(--text-faint); font-size: 10px; }
.team-sort:hover, .team-sort.active, .team-sort.active span { color: var(--text); }
.team-sort:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 3px; }

/* Code quality */
.cq-score { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; }
.cq-grade {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 15px;
    border: 1px solid var(--border); background: var(--raised); color: var(--text);
}
.cq-grade-a { color: var(--green-4); border-color: rgba(57, 211, 83, .4); }
.cq-grade-d, .cq-grade-f { color: var(--orange); border-color: rgba(224, 164, 64, .4); }
.cq-mix { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.cq-mix span { display: block; height: 100%; }
.cq-mix-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.cq-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 20px 16px; font-size: 12px; color: var(--text-muted); }
.cq-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.cq-why summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
.cq-why p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; max-width: 70ch; }
.faint-row td { opacity: .55; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.split-grid .card { margin-bottom: 20px; }
@media (max-width: 900px) { .split-grid { grid-template-columns: 1fr; } }
.prose p { color: var(--text-muted); max-width: 80ch; margin: 10px 0 0; line-height: 1.55; }
.prose strong { color: var(--text); }

/* ---------- Utilities ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Investment rules (ordered list, editor) ---------- */

.notice[hidden] { display: none; }
.rules-table .handle-cell { width: 36px; padding-right: 0; }
.drag-handle {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 30px;
    border: 1px solid transparent; border-radius: var(--radius-control); background: transparent;
    color: var(--text-faint); font-size: 15px; letter-spacing: -3px; cursor: grab;
}
.drag-handle:hover, .drag-handle:focus-visible { color: var(--text); background: var(--raised); border-color: var(--border); }
.drag-handle:active { cursor: grabbing; }
.rules-table tr.dragging td { background: var(--iris-tint); }
.rules-table tr.dragging td:first-child { box-shadow: inset 3px 0 0 var(--iris); }
.rules-table .rule-conditions { min-width: 320px; max-width: 560px; }
.rules-table tr.rule-inactive td:not(:first-child):not(:last-child) { color: var(--text-muted); }
.joiner { font-weight: 600; }
.default-count { margin-top: 12px; color: var(--text-muted); }
.default-count a { font-weight: 600; }
.rules-table .rule-name { display: block; font-size: 12px; margin-bottom: 2px; }
.rules-table .rule-sentence { color: var(--text); }
.rules-table .rule-sentence:hover { color: var(--iris); }
.rules-table .then-arrow { color: var(--text-muted); }
.match-mode { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.match-mode label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.match-mode select { width: auto; min-height: 30px; padding: 4px 26px 4px 8px; font-size: 13px; }
.cond-table td { padding: 6px 8px; vertical-align: top; }
.cond-table td:first-child { padding-left: 0; }
.cond-table .cond-prefix { width: 44px; padding-top: 13px; text-align: right; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.cond-table tr:first-child .cond-prefix { color: var(--text); }
.rule-then-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--iris); border-radius: var(--radius-control); background: var(--iris-tint); }
.rule-then-row .then-label { font-weight: 600; color: var(--text); white-space: nowrap; }
.rule-then-row select { width: auto; min-width: 240px; max-width: 100%; }
.rule-meta { margin-top: 16px; }
.cond-table select { min-width: 130px; }
.cond-table .cond-op-cell { width: 230px; }
.cond-table .cond-value { width: 100%; min-width: 180px; }
.cond-table [hidden] { display: none; }
.cond-hint { margin-top: 6px; max-width: 230px; }
.add-condition { margin-top: 10px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.preview-body { padding: 0 20px 14px; }
.preview-more { padding: 10px 20px 14px; }

/* ---------- Auth pages ---------- */

.auth-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 28px; }
.auth-card .btn { width: 100%; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 13px; margin: 18px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .container { padding: 16px 16px 40px; }
    .breadcrumbs { padding: 10px 16px 0; }
}
@media (max-width: 768px) {
    .controls { align-items: stretch; }
    h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
.rel-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.rel-row .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rel-open { font-size: 13px; white-space: nowrap; margin-left: 4px; }

/* ---------- Stability ------------------------------------------------- */
/* The window selector sits above the tabs because it scopes every sentence
   on every tab, so it belongs to the section and not to one page. */

.win-select { display: flex; gap: 6px; }

.subtabs {
    display: flex; gap: 2px; margin: 0 0 18px;
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.subtab {
    padding: 8px 14px; color: var(--text-muted); font-size: 13px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--text); text-decoration: none; }
.subtab.active { color: var(--text); border-bottom-color: var(--iris); }
.subtab-end { margin-left: auto; }

.stats-tight .stat { padding: 12px 14px; }

/* A window nobody could see renders as a question mark, never a zero.
   "0 unplanned outages" while completely blind is the exact failure this
   product exists to prevent. */
.stat-blind { color: var(--orange); }

.trend { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-worse { color: var(--red); }
.trend-better { color: var(--green-4); }

.budget {
    height: 7px; background: var(--raised); border-radius: 4px;
    position: relative; overflow: hidden; min-width: 90px;
}
.budget > i { position: absolute; inset: 0 auto 0 0; background: var(--iris); }

td.rationale { max-width: 460px; color: var(--text-muted); font-size: 12.5px; }

/* Incident calendar. The day number is positioned absolutely so a tall bar
   cannot paint over it, and the bar is an SVG rect rather than a sized span:
   a span inside a button is not reliably blockified and clamps to a few px. */
.cal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 4px; margin-bottom: 14px;
}
.cal-cell {
    position: relative; height: 56px; border-radius: var(--radius-control);
    background: var(--raised); border: 1px solid var(--border); overflow: hidden;
}
.cal-day {
    position: absolute; top: 3px; left: 5px; font-size: 10px;
    color: var(--text-faint); z-index: 2;
}
.cal-bar { position: absolute; inset: 0; width: 100%; height: 100%; }
.cal-bar rect { fill: var(--gray); }
.cal-bad .cal-bar rect { fill: var(--red); }
.cal-planned .cal-bar rect { fill: var(--iris); }
.cal-some .cal-bar rect { fill: var(--orange); }
.cal-flag { position: absolute; bottom: 2px; right: 4px; color: var(--orange); z-index: 2; }
.cal-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.cal-key .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.sw-bad { background: var(--red); } .sw-planned { background: var(--iris); }
.sw-some { background: var(--orange); } .sw-none { background: var(--gray); }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; margin: 10px 0 4px; }
.spark > i { flex: 1; min-height: 1px; background: var(--iris); border-radius: 2px 2px 0 0; }

.stab-review td { vertical-align: top; }
.stab-review-grid { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stab-review-grid select, .stab-review-grid input { min-width: 120px; }
.stab-review-grid input[type="text"] { min-width: 200px; }
.row-saved { animation: stability-saved 1.6s ease-out; }
.row-child { opacity: .72; }
@keyframes stability-saved { from { background: var(--iris-tint); } to { background: transparent; } }

.cfg { border-top: 1px solid var(--border); padding: 10px 0; }
.cfg > summary { cursor: pointer; padding: 4px 0; }
.sigform { border-left: 2px solid var(--border); padding-left: 12px; margin: 10px 0; }
.form-grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form-wide { grid-column: 1 / -1; }
.row-actions form { display: flex; gap: 6px; }

pre.token {
    background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control);
    padding: 10px; margin-top: 8px; overflow-x: auto; font-size: 12px; user-select: all;
}

/* Confirmation after a settings change. A bare redirect back to a page that
   looks unchanged is indistinguishable from nothing having happened, which is
   how a silent no-op reads as a broken form. */
.notice-ok {
    background: rgba(38, 166, 65, .12);
    border: 1px solid var(--green-3);
}

/* ---------- Overview (the landing page) ---------- */

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1400px; margin: 0 auto; padding: 10px 24px 0; }
.top-bar.is-empty { display: none; }
.top-bar .breadcrumbs { padding: 0; margin: 0; max-width: none; }
.top-bar .breadcrumbs.is-empty { display: block; visibility: hidden; }
.ov-add-btn { margin-left: auto; color: var(--text-muted); }
.ov-add-btn .side-icon { width: 14px; height: 14px; }
.ov-add-btn:hover { color: var(--text); }

.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ov-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel);
    min-width: 0; display: flex; flex-direction: column;
}
.ov-wide { grid-column: span 2; }
.ov-full { grid-column: 1 / -1; }
.ov-card.dragging { opacity: .55; border-color: var(--iris); box-shadow: 0 0 0 1px var(--iris); }
.ov-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 0 6px; }
.ov-head h2 { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-head h2 a { color: var(--text); }
.ov-head h2 a:hover { color: var(--iris); }
.ov-tools { display: flex; gap: 2px; opacity: .55; transition: opacity .12s; }
.ov-card:hover .ov-tools, .ov-card:focus-within .ov-tools { opacity: 1; }
@media (hover: none) { .ov-tools { opacity: 1; } }
.ov-body { padding: 10px 16px 14px; min-height: 96px; overflow-x: auto; }
.ov-empty { text-align: center; padding: 40px 20px; }
.ov-empty p { max-width: 560px; margin: 8px auto 18px; }

.ov-loading { display: flex; gap: 6px; padding: 30px 0; justify-content: center; }
.ov-loading span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: ov-pulse 1s infinite ease-in-out; }
.ov-loading span:nth-child(2) { animation-delay: .15s; }
.ov-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes ov-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ov-loading span { animation: none; opacity: .6; } }

.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.ov-stat { display: flex; flex-direction: column; min-width: 0; }
.ov-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-stat-value.ov-money { font-size: 20px; }
.ov-stat-value small { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.ov-stat-value.warn { color: var(--orange); }
.ov-stat-value.bad { color: var(--red); }
.ov-stat-label { font-size: 12px; color: var(--text-muted); }
.ov-stat .ov-dot { margin-bottom: 4px; }
.ov-note, .ov-problem { color: var(--text-muted); padding: 10px 0; }
.ov-problem { border-left: 2px solid var(--orange); padding: 6px 0 6px 10px; }
.ov-foot { font-size: 12px; color: var(--text-faint); margin-top: 10px; }
.ov-bad { color: var(--red); }
.ov-add { color: var(--green-4); }
.ov-del { color: var(--red); }

.ov-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.ov-dot-available { background: var(--green-4); }
.ov-dot-busy { background: var(--orange); }
.ov-dot-away { background: var(--text-faint); }
.ov-people { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ov-people a { position: relative; display: inline-flex; }
.ov-dot-badge { position: absolute; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px var(--surface); }

.ov-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ov-list li { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap; }
.ov-list li > .badge:not(:first-child) { margin-left: auto; }
.ov-list .sub { flex-basis: 100%; }
.ov-ellipsis { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-table th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; padding: 0 8px 6px 0; border-bottom: 1px solid var(--border); }
.ov-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.ov-table tr:last-child td { border-bottom: none; }
.ov-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-table td .ov-ellipsis { display: inline-block; max-width: 28ch; vertical-align: bottom; }

.ov-bars { list-style: none; display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; gap: 6px 10px; font-size: 13px; align-items: center; }
.ov-bars-money { grid-template-columns: minmax(0, 12em) minmax(0, 1fr) auto; }
.ov-bars li { display: contents; }
.ov-bars li > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.ov-bar i { display: block; height: 100%; }
.ov-bar-gh { background: var(--green-3); }
.ov-bar-jira { background: var(--iris); }
.ov-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: 0; }
.ov-key:first-child { margin-left: 0; }
.ov-key-gh { background: var(--green-3); }
.ov-key-jira { background: var(--iris); }

.ov-spark { display: flex; align-items: flex-end; gap: 3px; height: 36px; margin-bottom: 10px; }
.ov-spark i { flex: 1; min-height: 2px; background: var(--green-3); border-radius: 2px 2px 0 0; }

.ov-sprint-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ov-progress { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--raised); margin-bottom: 12px; }
.ov-progress i { display: block; height: 100%; }
.ov-p-done { background: var(--green-3); }
.ov-p-doing { background: var(--iris); opacity: .7; }

.ov-who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ov-who-name { color: var(--text); font-weight: 600; }

.ov-dialog {
    width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-panel); padding: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.ov-dialog::backdrop { background: rgba(5, 7, 10, .65); }
.ov-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ov-form-head h2 { font-size: 17px; }
.ov-form fieldset { border: none; }
.ov-desc { margin-bottom: 12px; }
.ov-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ov-fields > .form-group:has(select), .ov-fields > .ov-check, .ov-fields > .form-group:has(input[type=text]), .ov-fields > .form-group:has(.ov-sizes) { grid-column: 1 / -1; }
.ov-check { margin: 4px 0 14px; }
.ov-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.ov-sizes { display: flex; gap: 6px; flex-wrap: wrap; }
.ov-size { cursor: pointer; }
.ov-size input { position: absolute; opacity: 0; pointer-events: none; }
.ov-size span { display: inline-block; padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); font-size: 13px; }
.ov-size input:checked + span { background: var(--iris-tint); border-color: rgba(143, 157, 255, .55); color: var(--iris-strong); }
.ov-size input:focus-visible + span { outline: 2px solid var(--iris); outline-offset: 2px; }
.ov-errors, .ov-done { margin: 12px 0 0; }

@media (max-width: 1100px) {
    .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ov-wide, .ov-full { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .ov-grid { grid-template-columns: minmax(0, 1fr); }
    .top-bar { padding: 10px 16px 0; }
    .ov-fields { grid-template-columns: 1fr; }
    .ov-bars { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; }
}
.ov-list .rel-flag { width: auto; flex: none; }
.ov-columns { grid-column: 1 / -1; border: none; margin-bottom: 14px; }
.ov-column-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 5px; }
.ov-column-picks .check { font-size: 13px; }
.ov-when { font-size: 12px; color: var(--text-muted); display: block; }
