:root {
    --bg: #eef2f8;
    --bg-soft: #f5f8fc;
    --surface: #ffffff;
    --surface-2: #f3f7fb;
    --border: #dce4ef;
    --border-strong: #b7c6da;
    --text: #0b1220;
    --text-soft: #41506a;
    --text-muted: #5f6f88;
    --accent: #0062cc;
    --accent-hover: #0070e6;
    --accent-soft: #e8f3ff;
    --accent-bright: #007eff;
    --danger: #c22f2f;
    --danger-soft: #fcecec;
    --warn: #8f5a10;
    --warn-soft: #fdf1d9;
    --ok: #15803d;
    --ok-soft: #def3e6;
    --urgent: #ffe14d;
    --urgent-border: #e0b400;
    --urgent-text: #191302;
    --linked: #0062cc;
    --row-hover: rgba(0, 126, 255, .06);
    --row-done: rgba(34, 197, 94, .16);
    --row-done-hover: rgba(34, 197, 94, .26);
    --row-done-solid: #b7ecc9;
    --overlay: rgba(8, 14, 26, .62);
    --overlay-strong: rgba(5, 9, 18, .8);
    --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05), 0 1px 1px rgba(11, 18, 32, .03);
    --shadow: 0 2px 6px rgba(11, 18, 32, .06), 0 8px 24px rgba(11, 18, 32, .08);
    --shadow-lg: 0 4px 12px rgba(11, 18, 32, .1), 0 16px 40px rgba(11, 18, 32, .16);
    --radius-sm: 7px;
    --radius: 11px;
    --radius-lg: 16px;
    --sidebar-w: 248px;
    --gap: 12px;
    --pad: 14px;
    --fs-base: 14px;
    --fs-sm: 12.5px;
    --fs-lg: 16px;
    --fs-h1: 20px;
    --fs-h2: 16px;
    --ff: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --task-grid-default: #b7c6da;
    --viz-s1: #007eff;
    --viz-s2: #f59e0b;
    --viz-good: #1a9e5c;
    --viz-crit: #d93a3a;
    --viz-neutral: #64748b;
    --viz-grid: #e3eaf3;
    --nav-bg: #0b1220;
    --nav-grad: linear-gradient(180deg, #0b1220 0%, #0f1c33 55%, #142a4d 100%);
    --nav-text: #c6d3e6;
    --nav-text-strong: #f2f6fc;
    --nav-muted: #8095b1;
    --nav-hover-bg: rgba(255, 255, 255, .07);
    --nav-active-bg: rgba(0, 126, 255, .18);
    --nav-active-text: #7db9ff;
    --nav-border: rgba(255, 255, 255, .09);
    --nav-accent: #339cff;
    --nav-avatar-bg: rgba(0, 126, 255, .22);
    --nav-avatar-text: #9dc9ff;
    --brand-grad: linear-gradient(135deg, #007eff, #0055b3);
    --auth-bg: linear-gradient(155deg, #0b1220 0%, #10223f 45%, #1a3c6e 100%);
    color-scheme: light;
}

[data-theme="violet"] {
    color-scheme: dark;
    --bg: #0d0913;
    --bg-soft: #130d1c;
    --surface: #181023;
    --surface-2: #201631;
    --border: #31234a;
    --border-strong: #4a3670;
    --text: #f0ecf8;
    --text-soft: #bcaed6;
    --text-muted: #9382b0;
    --accent: #b183f7;
    --accent-hover: #c49efc;
    --accent-soft: #2b1d44;
    --accent-bright: #b183f7;
    --danger: #f58080;
    --danger-soft: #3c1e22;
    --warn: #f2c14e;
    --warn-soft: #3d2f12;
    --ok: #46d6a0;
    --ok-soft: #123829;
    --urgent: #f2cf3e;
    --urgent-border: #b89310;
    --urgent-text: #191302;
    --linked: #cbb3fd;
    --row-hover: rgba(177, 131, 247, .08);
    --row-done: rgba(70, 214, 160, .14);
    --row-done-hover: rgba(70, 214, 160, .24);
    --row-done-solid: #1d5c44;
    --overlay: rgba(5, 2, 10, .72);
    --overlay-strong: rgba(4, 1, 8, .88);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 2px 8px rgba(0, 0, 0, .45), 0 10px 28px rgba(0, 0, 0, .5);
    --shadow-lg: 0 4px 14px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .6);
    --task-grid-default: #4a3670;
    --viz-s1: #b183f7;
    --viz-s2: #f0994e;
    --viz-good: #46d6a0;
    --viz-crit: #f58080;
    --viz-neutral: #9382b0;
    --viz-grid: #2b2040;
    --nav-bg: #100a18;
    --nav-grad: linear-gradient(180deg, #100a18 0%, #170e24 100%);
    --nav-text: #c9bcdd;
    --nav-text-strong: #f4effc;
    --nav-muted: #8d7ba9;
    --nav-hover-bg: rgba(255, 255, 255, .06);
    --nav-active-bg: rgba(177, 131, 247, .2);
    --nav-active-text: #d3b6ff;
    --nav-border: rgba(255, 255, 255, .07);
    --nav-accent: #c49efc;
    --nav-avatar-bg: rgba(177, 131, 247, .24);
    --nav-avatar-text: #d9c2ff;
    --brand-grad: linear-gradient(135deg, #b183f7, #7a3ee8);
    --auth-bg: radial-gradient(1200px 700px at 70% -10%, #2b1d44 0%, #170e24 55%, #0d0913 100%);
}

[data-theme="graphite"] {
    color-scheme: dark;
    --bg: #141619;
    --bg-soft: #191c20;
    --surface: #1e2126;
    --surface-2: #262a30;
    --border: #33383f;
    --border-strong: #4a505a;
    --text: #e9ebee;
    --text-soft: #b0b7c0;
    --text-muted: #8a929e;
    --accent: #93b8e2;
    --accent-hover: #adc9ec;
    --accent-soft: #253340;
    --accent-bright: #93b8e2;
    --danger: #f17c78;
    --danger-soft: #3a2321;
    --warn: #e7ad4a;
    --warn-soft: #37290f;
    --ok: #57c9a0;
    --ok-soft: #153529;
    --urgent: #e9d452;
    --urgent-border: #b09e1c;
    --urgent-text: #191302;
    --linked: #a3c5f1;
    --row-hover: rgba(147, 184, 226, .07);
    --row-done: rgba(87, 201, 160, .13);
    --row-done-hover: rgba(87, 201, 160, .22);
    --row-done-solid: #1d5b45;
    --overlay: rgba(0, 0, 0, .62);
    --overlay-strong: rgba(0, 0, 0, .82);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 4px 14px rgba(0, 0, 0, .45), 0 18px 48px rgba(0, 0, 0, .55);
    --task-grid-default: #4a505a;
    --viz-s1: #93b8e2;
    --viz-s2: #dd9a55;
    --viz-good: #57c9a0;
    --viz-crit: #f17c78;
    --viz-neutral: #8a929e;
    --viz-grid: #2d3138;
    --nav-bg: #101215;
    --nav-grad: linear-gradient(180deg, #101215 0%, #15181c 100%);
    --nav-text: #b7bec8;
    --nav-text-strong: #eef1f4;
    --nav-muted: #7d8592;
    --nav-hover-bg: rgba(255, 255, 255, .06);
    --nav-active-bg: rgba(147, 184, 226, .16);
    --nav-active-text: #bcd6f4;
    --nav-border: rgba(255, 255, 255, .07);
    --nav-accent: #adc9ec;
    --nav-avatar-bg: rgba(147, 184, 226, .2);
    --nav-avatar-text: #c4dbf6;
    --brand-grad: linear-gradient(135deg, #93b8e2, #4d7db3);
    --auth-bg: linear-gradient(160deg, #101215 0%, #191c20 60%, #23282f 100%);
}

[data-theme="mono"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --border: #d8d8dd;
    --border-strong: #98989f;
    --text: #09090b;
    --text-soft: #3c3c43;
    --text-muted: #63636b;
    --accent: #18181b;
    --accent-hover: #000000;
    --accent-soft: #ececee;
    --accent-bright: #18181b;
    --danger: #b42121;
    --danger-soft: #fbe9e9;
    --warn: #805607;
    --warn-soft: #faf0da;
    --ok: #166534;
    --ok-soft: #e6f4ea;
    --urgent: #ffe14d;
    --urgent-border: #c9a205;
    --urgent-text: #191302;
    --linked: #18181b;
    --row-hover: rgba(0, 0, 0, .04);
    --row-done: rgba(0, 0, 0, .055);
    --row-done-hover: rgba(0, 0, 0, .09);
    --row-done-solid: #d4d4d8;
    --overlay: rgba(0, 0, 0, .52);
    --overlay-strong: rgba(0, 0, 0, .78);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .08);
    --shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .12), 0 16px 40px rgba(0, 0, 0, .18);
    --task-grid-default: #98989f;
    --viz-s1: #18181b;
    --viz-s2: #6e6e76;
    --viz-good: #166534;
    --viz-crit: #b42121;
    --viz-neutral: #a5a5ad;
    --viz-grid: #e5e5ea;
    --nav-bg: #ffffff;
    --nav-grad: none;
    --nav-text: #3c3c43;
    --nav-text-strong: #09090b;
    --nav-muted: #63636b;
    --nav-hover-bg: #f4f4f5;
    --nav-active-bg: #18181b;
    --nav-active-text: #ffffff;
    --nav-border: #d8d8dd;
    --nav-accent: #18181b;
    --nav-avatar-bg: #18181b;
    --nav-avatar-text: #ffffff;
    --brand-grad: linear-gradient(135deg, #2e2e33, #09090b);
    --auth-bg: #fafafa;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-width: 280px;
    font-family: var(--ff);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }
[data-theme="violet"] ::selection, [data-theme="graphite"] ::selection { color: #10121a; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1 { margin: 0 0 4px; font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.015em; }
h2 { margin: 0 0 10px; font-size: var(--fs-h2); font-weight: 650; letter-spacing: -.008em; }
h3 { margin: 0 0 8px; font-size: var(--fs-base); font-weight: 650; }
p { margin: 0 0 10px; }

.layout { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    color: var(--nav-text);
    background: var(--nav-bg);
    background-image: var(--nav-grad);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow-sm);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px var(--pad);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--nav-text-strong);
    white-space: nowrap;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.sidebar-toggle {
    padding: 6px 12px;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 570;
    color: var(--nav-text);
    background: var(--nav-hover-bg);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.sidebar-toggle:hover { color: var(--nav-text-strong); border-color: var(--nav-muted); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }

.sidebar-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px 10px;
}
.sidebar.is-open .sidebar-nav { display: flex; }
.sidebar.is-open .sidebar-foot { display: flex; }

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--nav-text);
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background .13s ease, color .13s ease;
}
.sidebar-nav a .nav-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav a:hover { background: var(--nav-hover-bg); color: var(--nav-text-strong); text-decoration: none; }
.sidebar-nav a:hover .ico { color: var(--nav-accent); }
.sidebar-nav a:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -2px; }
.sidebar-nav a.is-active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--nav-accent);
}
.sidebar-nav a.is-active .ico { color: var(--nav-active-text); }

.nav-group {
    padding: 14px 12px 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--nav-muted);
}

.sidebar-foot {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px var(--pad);
    border-top: 1px solid var(--nav-border);
}

.user-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--nav-text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-count {
    min-width: 20px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: #fff;
    background: #d93a3a;
    border-radius: 999px;
}
.badge-count:empty { display: none !important; }

.content {
    flex: 1 1 auto;
    width: 100%;
    padding: var(--pad);
    min-width: 0;
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--gap);
}
.page-head .subtitle { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
    padding: var(--pad);
    margin-bottom: var(--gap);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.card-head h2 { margin: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: var(--gap);
}

.stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat .stat-value { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .stat-label { font-size: var(--fs-sm); color: var(--text-muted); }
.stat.is-danger .stat-value { color: var(--danger); }
.stat.is-warn .stat-value { color: var(--warn); }
.stat.is-ok .stat-value { color: var(--ok); }
.stat.is-accent .stat-value { color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 14px;
    font: inherit;
    font-size: var(--fs-base);
    font-weight: 570;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-muted); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: default; }

.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

[data-theme="violet"] .btn-primary,
[data-theme="graphite"] .btn-primary { color: #10121a; }

.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { filter: brightness(1.08); }

[data-theme="violet"] .btn-danger,
[data-theme="graphite"] .btn-danger { color: #1a0d0d; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

.btn-sm { min-height: 30px; padding: 4px 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }

.btn-link {
    padding: 0;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--accent);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}
.btn-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; margin-bottom: 12px; font-size: var(--fs-sm); color: var(--text-soft); }
label > span.label-text { display: block; margin-bottom: 4px; font-weight: 570; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="search"], input[type="tel"],
select, textarea {
    display: block;
    width: 100%;
    min-height: 38px;
    margin-top: 4px;
    padding: 8px 10px;
    font: inherit;
    font-size: var(--fs-base);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
select[multiple] { min-height: 120px; }
select option, select optgroup { background: var(--surface); color: var(--text); }

label.checkbox, label.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text);
    cursor: pointer;
}
label.checkbox input[type="checkbox"], label.inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.hint { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-muted); }

.field-validation-error, .validation-summary-errors {
    display: block;
    margin-top: 4px;
    font-size: var(--fs-sm);
    font-weight: 550;
    color: var(--danger);
}
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.input-validation-error { border-color: var(--danger) !important; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.alert {
    padding: 10px 12px;
    margin-bottom: var(--gap);
    font-size: var(--fs-base);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}
.alert-success { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
.alert-error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.alert-info { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.alert-urgent { color: var(--urgent-text); background: var(--urgent); border-color: var(--urgent-border); font-weight: 650; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
table.data th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: var(--surface-2);
    box-shadow: inset 0 -1px 0 var(--border-strong);
    white-space: nowrap;
}
table.data tbody tr { transition: background .1s ease; }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data tr.is-deleted td { opacity: .5; text-decoration: line-through; }

.cell-urgent { background: var(--urgent) !important; color: var(--urgent-text) !important; font-weight: 650; }
h1 .cell-urgent { padding: 1px 9px; border-radius: 8px; font-weight: inherit; }
.cell-danger { color: var(--danger) !important; font-weight: 650; }

.linked, th.linked { color: var(--linked) !important; }
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 10px;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; font-style: normal; border: 1px solid rgba(0, 0, 0, .12); }

.badge {
    display: inline-block;
    padding: 2px 9px;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.6;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-ok { color: var(--ok); background: var(--ok-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-accent { color: var(--accent); background: var(--accent-soft); }
.badge-urgent { color: var(--urgent-text); background: var(--urgent); }
.badge-muted { color: var(--text-muted); background: var(--surface-2); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 650;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--text-muted); }

.filters { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.filters label { margin-bottom: 10px; }
.filters-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: var(--gap);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.task-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }

.task-card {
    display: block;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color .14s ease, box-shadow .14s ease;
}
.task-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.task-card.is-urgent { border-left-color: var(--urgent-border); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 60%); }
.task-card.is-overdue { border-left-color: var(--danger); }
.task-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.task-card-code { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.task-card-title { margin: 0 0 6px; font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.task-card-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 10px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
}
.task-card-meta b { font-weight: 600; color: var(--text); }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }

.kv { display: grid; grid-template-columns: 1fr; gap: 0; font-variant-numeric: tabular-nums; }
.kv > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--text-muted); }
.kv dd, .kv .v { margin: 0; font-weight: 570; text-align: right; word-break: break-word; }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item {
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}
.timeline-item + .timeline-item { margin-top: 2px; }
.timeline-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.timeline-head b { color: var(--text); }
.timeline-body { white-space: pre-wrap; word-break: break-word; }
.comment-form { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
}
.file-item + .file-item { margin-top: 2px; }
.upload-form { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { color: var(--text-muted); }

.dropzone {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.dropzone.is-over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 100vh;
    padding: 16px 12px;
    background: var(--bg);
    background-image: var(--auth-bg);
    background-attachment: fixed;
}
.auth-shell > .alert { width: 100%; max-width: 400px; margin-bottom: 0; box-shadow: var(--shadow-lg); }
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin-bottom: 16px; }
.auth-card-wide { max-width: 560px; }
.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    font-size: var(--fs-sm);
}

.toast-host {
    position: fixed;
    right: 8px;
    bottom: 8px;
    z-index: 140;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 16px);
}
.toast {
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: toast-in .2s ease-out;
    transition: opacity .25s ease;
}
.toast.is-danger { border-left-color: var(--danger); }
.toast.is-warn { border-left-color: var(--warn); }
.toast-title { font-size: var(--fs-sm); font-weight: 650; margin-bottom: 2px; }
.toast-text { font-size: var(--fs-sm); color: var(--text-soft); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.sidebar-head-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .13s ease, color .13s ease, border-color .13s ease;
}
.icon-btn:hover { color: var(--accent); background: var(--surface-2); border-color: var(--border); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn.is-on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }

.sidebar .icon-btn { color: var(--nav-muted); }
.sidebar .icon-btn:hover { color: var(--nav-text-strong); background: var(--nav-hover-bg); border-color: var(--nav-border); }
.sidebar .icon-btn:focus-visible { outline-color: var(--nav-accent); }
.sidebar .icon-btn.is-on { color: var(--nav-active-text); background: var(--nav-active-bg); border-color: transparent; }

.icon-btn .ico { width: 17px; height: 17px; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    background-image: var(--brand-grad);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
    flex: 0 0 auto;
}
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-item { position: relative; }
.nav-short { display: none; }

.user-card { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--nav-avatar-text);
    background: var(--nav-avatar-bg);
    border-radius: 50%;
    flex: 0 0 auto;
}

.logout-form { flex: 0 0 auto; }
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 570;
    color: var(--nav-text);
    background: var(--nav-hover-bg);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color .13s ease, border-color .13s ease, background .13s ease;
}
.logout-btn:hover { color: #ff9d9d; border-color: rgba(255, 120, 120, .55); background: rgba(220, 60, 60, .14); }
.logout-btn:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }

[data-theme="mono"] .logout-btn:hover { color: #b42121; border-color: #b42121; background: #fbe9e9; }

.collapse-head { cursor: pointer; user-select: none; }
.collapse-head:hover h2 { color: var(--accent); }
.collapse-head .caret {
    font-size: var(--fs-sm);
    font-weight: 570;
    color: var(--text-muted);
    white-space: nowrap;
}
.collapsible.is-collapsed .collapse-body { display: none; }
.collapsible.is-collapsed .card-head { margin-bottom: 0; }

.stat-grid-compact .stat { padding: 7px 10px; border-radius: var(--radius-sm); }
.stat-grid-compact .stat .stat-value { font-size: 17px; }
.stat-grid-compact .stat .stat-label { font-size: 11.5px; }

.cell-project {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filters-primary { margin-bottom: 6px; }
.filters-primary .field { margin-bottom: 10px; }

.suggest-with-button input { padding-right: 42px; }
.suggest-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 36px;
    height: calc(100% - 2px);
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
}
.suggest-btn:hover { color: var(--accent); background: var(--surface-2); }

.suggest { position: relative; }
.suggest-list {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.suggest-list.is-open { display: flex; }
.suggest-item {
    padding: 9px 12px;
    font: inherit;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--text);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }

[data-theme="violet"] .suggest-item:hover, [data-theme="violet"] .suggest-item:focus-visible,
[data-theme="graphite"] .suggest-item:hover, [data-theme="graphite"] .suggest-item:focus-visible { color: var(--accent-hover); }

.template-bar { padding-bottom: 4px; }
.template-bar .field { margin-bottom: 6px; max-width: 460px; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--overlay);
}
.modal.is-open { display: flex; }
.modal-card {
    width: 100%;
    max-width: 460px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.empty {
    padding: 30px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

::placeholder { color: var(--text-muted); opacity: .85; }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}
select[multiple] { background-image: none; padding-right: 4px; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; }

.field { display: flex; flex-direction: column; margin-bottom: 14px; min-width: 0; }
.field > label,
.field > .static-label {
    margin-bottom: 5px;
    font-size: var(--fs-sm);
    font-weight: 570;
    color: var(--text-soft);
}
.field > input,
.field > select,
.field > textarea { margin-top: 0; }
.field > .hint { margin-top: 5px; }
.field-narrow { max-width: 160px; }

.static-value {
    padding: 9px 10px;
    font-size: var(--fs-base);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    word-break: break-word;
}

select[multiple] {
    padding: 4px;
    min-height: 132px;
}
select[multiple] option { padding: 5px 7px; border-radius: 4px; }

.urgent-toggle {
    margin-top: 4px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 12px var(--pad);
    margin: 0 calc(-1 * var(--pad));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 16px -12px rgba(0, 0, 0, .35);
}

.btn-danger-ghost { color: var(--danger); border-color: var(--border-strong); background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }

.dict-list { display: flex; flex-direction: column; gap: 10px; }

.dict-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.dict-row .field { margin-bottom: 10px; }
.dict-row .field-narrow { max-width: none; }

.dict-id {
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dict-check { margin: 0 0 10px; }

.dict-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.dict-meta { font-size: var(--fs-sm); color: var(--text-muted); margin-right: auto; }

.dict-new { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.dict-new h3 { color: var(--text-muted); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; }

input[type="file"] {
    width: 100%;
    padding: 10px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
input[type="file"]:hover { border-color: var(--accent); color: var(--text); }

@media (min-width: 315px) {
    :root { --pad: 16px; --gap: 14px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-card { padding: 24px 20px; }
}

@media (min-width: 515px) {
    :root { --fs-base: 14.5px; --fs-h1: 22px; --pad: 18px; }
    .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-2 { grid-column: span 2; }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .task-card-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kv > div { justify-content: flex-start; }
    .kv dt, .kv .k { flex: 0 0 42%; }
    .kv dd, .kv .v { flex: 1 1 auto; text-align: left; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .auth-card { padding: 28px 26px; }
    .toast-host { right: 16px; bottom: 16px; max-width: 360px; }
}

@media (min-width: 700px) {
    .dict-row {
        grid-template-columns: 54px minmax(0, 2fr) minmax(0, 2fr) 110px 110px auto;
        align-items: end;
        gap: 0 14px;
    }
    .dict-row .dict-id { padding-bottom: 18px; }
    .dict-row .dict-check { margin-bottom: 18px; }
    .dict-row .dict-actions { margin-bottom: 12px; justify-content: flex-end; }
    .dict-row-status { grid-template-columns: 40px minmax(0, 2fr) 120px 110px 110px auto; }
    .dict-row-dept { grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 90px; }
    .dict-row-dept .dict-check { grid-column: span 3; margin-bottom: 6px; }
    .dict-row-dept .dict-actions { grid-column: span 3; justify-content: flex-end; margin-bottom: 8px; }
    .dict-meta { margin-right: 10px; }
}

@media (min-width: 915px) {
    :root { --fs-h1: 24px; --pad: 20px; --gap: 16px; }

    .layout { flex-direction: row; }

    .sidebar {
        position: sticky;
        top: 0;
        flex: 0 0 var(--sidebar-w);
        width: var(--sidebar-w);
        height: 100vh;
        border-right: 1px solid var(--nav-border);
        border-bottom: 0;
        overflow-y: auto;
        scrollbar-color: var(--nav-muted) transparent;
    }
    .sidebar-toggle { display: none; }
    .icon-btn { display: inline-flex; }
    .sidebar-nav { display: flex; }
    .sidebar-foot { display: flex; margin-top: auto; }
    .sidebar-head { padding: 16px var(--pad) 12px; }

    .sidebar.is-collapsed { flex: 0 0 76px; width: 76px; }
    .sidebar.is-collapsed .brand-text,
    .sidebar.is-collapsed .nav-group,
    .sidebar.is-collapsed .nav-text,
    .sidebar.is-collapsed .user-name { display: none; }
    .sidebar.is-collapsed .nav-short {
        display: block;
        font-size: 10px;
        line-height: 1.2;
        letter-spacing: -.01em;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .sidebar.is-collapsed .sidebar-head { justify-content: center; padding: 16px 6px 10px; }
    .sidebar.is-collapsed .sidebar-head-actions { flex-direction: column; gap: 2px; }
    .sidebar.is-collapsed .sidebar-nav { padding: 0 8px 10px; }
    .sidebar.is-collapsed .sidebar-nav a {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 9px 2px;
        text-align: center;
    }
    .sidebar.is-collapsed .ico { width: 20px; height: 20px; }
    .sidebar.is-collapsed .badge-count {
        position: absolute;
        top: 4px;
        right: 10px;
        min-width: 16px;
        padding: 0 4px;
        font-size: 10px;
    }
    .sidebar.is-collapsed .sidebar-foot { flex-direction: column; gap: 8px; padding: 10px 6px; }
    .sidebar.is-collapsed .theme-picker { justify-content: center; }
    .sidebar.is-collapsed .theme-picker-label { display: none; }
    .sidebar.is-collapsed .theme-picker-options { flex-wrap: wrap; justify-content: center; width: 60px; row-gap: 4px; }
    .sidebar.is-collapsed .user-card { justify-content: center; }
    .sidebar.is-collapsed .logout-btn { padding: 7px; }
    .sidebar.is-collapsed .logout-btn .nav-text { display: none; }

    .content { padding: 20px 24px; }

    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
    .task-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    :root { --sidebar-w: 264px; --fs-base: 15px; --fs-sm: 13px; --fs-h1: 26px; --fs-h2: 17px; }

    .content { padding: 26px 32px; }
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
    .task-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    table.data { font-size: 13.5px; }
    table.data th, table.data td { padding: 9px 12px; }
}

@media (min-width: 1600px) {
    :root { --sidebar-w: 280px; --fs-base: 15.5px; }
    .content { padding: 30px 40px; }
    .task-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (min-width: 1920px) {
    :root { --fs-base: 16px; --fs-sm: 13.5px; --fs-h1: 28px; --sidebar-w: 300px; }
    .content { padding: 34px 48px; }
    .content > * { max-width: 1720px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 2560px) {
    :root { --fs-base: 17px; --fs-sm: 14.5px; --fs-h1: 32px; --fs-h2: 20px; --sidebar-w: 330px; --radius: 12px; --radius-lg: 20px; }
    .content { padding: 40px 60px; }
    .content > * { max-width: 2200px; }
    .task-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 3840px) {
    :root { --fs-base: 20px; --fs-sm: 17px; --fs-h1: 40px; --fs-h2: 25px; --sidebar-w: 420px; --pad: 28px; --gap: 24px; }
    .content { padding: 56px 80px; }
    .content > * { max-width: 3200px; }
    .task-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .btn { min-height: 48px; padding: 10px 20px; }
    input[type="text"], input[type="email"], input[type="password"], input[type="number"],
    input[type="date"], input[type="datetime-local"], input[type="search"], input[type="tel"],
    select, textarea { min-height: 48px; }
}

@media (max-width: 514px) {
    table.responsive thead { display: none; }
    table.responsive tbody tr {
        display: block;
        margin-bottom: 8px;
        padding: 8px;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
    }
    table.responsive tbody td {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 4px 0;
        border: 0;
        text-align: right;
    }
    table.responsive tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--text-muted);
        text-align: left;
        flex: 0 0 45%;
    }
    table.responsive tbody td:empty { display: none; }
}

@media print {
    :root, :root[data-theme="violet"], :root[data-theme="graphite"], :root[data-theme="mono"] {
        --bg: #ffffff;
        --bg-soft: #ffffff;
        --surface: #ffffff;
        --surface-2: #f4f4f4;
        --text: #000000;
        --text-soft: #333333;
        --text-muted: #555555;
        --border: #bbbbbb;
        --border-strong: #888888;
        --accent: #003d80;
        --linked: #003d80;
        --row-done: #e8f2ea;
        --row-done-hover: #e8f2ea;
        --urgent: #ffe14d;
    }
    .sidebar, .page-actions, .filters, .pager, .toast-host, .sticky-actions,
    [data-collapse="taskFilters"] { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #999; }
    .legend i, .cell-urgent, table.data tr.row-done td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

table.data tr.row-done td { background: var(--row-done); }
table.data tbody tr.row-done:hover td { background: var(--row-done-hover); }
table.data tr.row-done td.cell-urgent { background: var(--urgent) !important; }

.stats-card .collapse-body { padding-top: 2px; }
.stats-card.is-collapsed .card-head { margin-bottom: 0; }

.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.rich-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.rich-btn {
    min-width: 32px;
    min-height: 30px;
    padding: 3px 9px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .13s ease, color .13s ease;
}
.rich-btn:hover { border-color: var(--accent); color: var(--accent); }
.rich-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rich-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border-strong); }

.rich-editor {
    min-height: 140px;
    max-height: 480px;
    overflow-y: auto;
    padding: 10px 12px;
    font: inherit;
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    word-break: break-word;
}
.rich-editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.rich-editor img, .rich-view img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.rich-view { white-space: normal; }
.rich-view p, .rich-view div { margin: 0 0 6px; }

.media-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    flex-direction: column;
    background: var(--overlay-strong);
}
.media-modal.is-open { display: flex; }
body.media-modal-open { overflow: hidden; }

.media-modal-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.media-stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.media-stage img {
    max-width: 96%;
    max-height: 96%;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform .12s ease-out;
    cursor: zoom-in;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
}
.media-stage video {
    max-width: 96%;
    max-height: 96%;
    background: #000;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
}

.media-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    max-height: 34vh;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
    transition: max-height .2s ease-out;
}
.media-panel.is-expanded { max-height: 78vh; }

.media-panel-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 2px;
    background: transparent;
    border: 0;
    cursor: ns-resize;
    width: 100%;
}
.media-panel-grip {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: var(--border-strong);
}
.media-panel-handle:hover .media-panel-grip { background: var(--accent); }

.media-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px var(--pad) 8px;
    border-bottom: 1px solid var(--border);
}
.media-file-name { font-weight: 650; word-break: break-all; }
.media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.media-zoom-hint { font-size: var(--fs-sm); color: var(--text-muted); }

.media-panel-body {
    overflow-y: auto;
    padding: 10px var(--pad) 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.media-task-line { font-size: var(--fs-base); }
.media-block-title {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pipeline-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: var(--gap);
}
.pipeline-tab {
    padding: 7px 18px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    transition: border-color .13s ease, color .13s ease, background .13s ease;
}
.pipeline-tab:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.pipeline-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pipeline-tab.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }

[data-theme="violet"] .pipeline-tab.is-active,
[data-theme="graphite"] .pipeline-tab.is-active { color: #10121a; }

.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 1fr);
    gap: 10px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.kanban-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
}

.kanban-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 11px;
    color: #fff;
    font-weight: 650;
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .38);
}
.kanban-col-head.is-light { color: #10121a; text-shadow: none; }
.kanban-col-head.is-light .kanban-col-count { background: rgba(255, 255, 255, .45); }
.kanban-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-col-count {
    min-width: 22px;
    text-align: center;
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
    background: rgba(0, 0, 0, .22);
    border-radius: 999px;
}
.kanban-col-sum {
    padding: 6px 4px 2px;
    text-align: center;
    font-size: var(--fs-base);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.kanban-quick-btn {
    margin: 6px 0;
    padding: 7px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color .13s ease, border-color .13s ease;
}
.kanban-quick-btn:hover { color: var(--accent); border-color: var(--accent); }

.kanban-quick-form {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
.kanban-quick-form.is-open { display: flex; }
.kanban-quick-form input { margin-top: 0; min-height: 34px; }
.kanban-quick-actions { display: flex; gap: 6px; }

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.kanban-cards.is-over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; }

.crm-card {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: border-color .13s ease, box-shadow .13s ease;
}
.crm-card.is-dragging { opacity: .45; }
.crm-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.crm-card-title { font-weight: 650; margin-bottom: 2px; word-break: break-word; }
.crm-card-title a { color: var(--text); }
.crm-card-title a:hover { color: var(--accent); }
.crm-card-repeat { font-size: 11px; color: var(--text-muted); }
.crm-card-amount { font-size: var(--fs-base); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); margin: 2px 0; }
.crm-card-client { font-size: var(--fs-sm); color: var(--linked); }
.crm-card-meta { font-size: var(--fs-sm); color: var(--text-muted); }
.crm-card-essence {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
    color: var(--text-soft);
    word-break: break-word;
}
.crm-card-essence-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.crm-card-foot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.crm-activity-done { opacity: .6; }
.crm-activity-done .timeline-head b { text-decoration: line-through; }
.crm-activity-overdue { border-left-color: var(--danger); }

@media (max-width: 914px) {
    .kanban { grid-auto-columns: 260px; }
    .media-panel { max-height: 46vh; }
}

.btn-win { color: #fff; background: var(--ok); border-color: var(--ok); }
.btn-win:hover { filter: brightness(1.08); }

[data-theme="violet"] .btn-win,
[data-theme="graphite"] .btn-win { color: #0c1712; }

.crm-outcome-btns { display: inline-flex; gap: 4px; margin-left: auto; }
.crm-outcome-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
}
.crm-outcome-btn.is-win:hover { color: #fff; background: var(--ok); border-color: var(--ok); }
.crm-outcome-btn.is-lose:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

[data-theme="violet"] .crm-outcome-btn.is-win:hover,
[data-theme="graphite"] .crm-outcome-btn.is-win:hover { color: #0c1712; }
[data-theme="violet"] .crm-outcome-btn.is-lose:hover,
[data-theme="graphite"] .crm-outcome-btn.is-lose:hover { color: #1a0d0d; }

.stat-sub { display: block; font-size: 11px; font-weight: 570; color: var(--text-muted); letter-spacing: 0; }
.viz-danger-text { color: var(--danger); font-weight: 700; }
.viz-updated { color: var(--text-soft); font-weight: 600; }

.viz-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.viz-card { margin-bottom: 0; }
.viz-note {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.viz-funnel { display: flex; flex-direction: column; gap: 6px; }
.viz-funnel-row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) 1fr minmax(120px, auto);
    align-items: center;
    gap: 8px;
}
.viz-funnel-label {
    font-size: var(--fs-sm);
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viz-funnel-track { height: 22px; background: var(--surface-2); border: 1px solid var(--viz-grid); border-radius: 5px; overflow: hidden; }
.viz-funnel-bar { height: 100%; border-radius: 0 4px 4px 0; transition: width .25s ease-out; min-width: 0; }
.viz-funnel-value { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.viz-funnel-amount { font-weight: 570; color: var(--text-muted); }

.viz-donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.viz-donut { width: 150px; height: 150px; flex: 0 0 auto; }
.viz-seg-neutral { stroke: var(--viz-neutral); }
.viz-seg-good { stroke: var(--viz-good); }
.viz-seg-crit { stroke: var(--viz-crit); }
.viz-seg-empty { stroke: var(--surface-2); }
.viz-seg-neutral-dot { background: var(--viz-neutral); }
.viz-seg-good-dot { background: var(--viz-good); }
.viz-seg-crit-dot { background: var(--viz-crit); }
.viz-donut-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; fill: var(--text); }
.viz-donut-cap { font-size: 11px; fill: var(--text-muted); }

.viz-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.viz-legend-row { flex-direction: row; flex-wrap: wrap; gap: 12px; }
.viz-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
    white-space: nowrap;
}
.viz-legend-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.viz-legend-amount { color: var(--text-muted); }
.viz-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.viz-dot-s1 { background: var(--viz-s1); }
.viz-dot-s2 { background: var(--viz-s2); }

.viz-bars-wrap { width: 100%; overflow: hidden; }
.viz-bars { width: 100%; height: auto; display: block; }
.viz-bar-s1 { fill: var(--viz-s1); }
.viz-bar-s2 { fill: var(--viz-s2); }
.viz-gridline { stroke: var(--viz-grid); stroke-width: 1; }
.viz-baseline { stroke: var(--border-strong); stroke-width: 1; }
.viz-axis-text { font-size: 11px; fill: var(--text-muted); }

.viz-tooltip {
    display: none;
    position: absolute;
    z-index: 130;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    white-space: nowrap;
}

@media (min-width: 915px) {
    .viz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .viz-card-wide { grid-column: span 2; }
}

table.data thead th { text-align: center; }
table.data thead th.num { text-align: center; }

table.task-table thead th {
    background: var(--task-head-bg, var(--surface-2));
    color: var(--task-head-color, var(--text-soft));
}

.status-word { font-weight: 650; white-space: nowrap; color: var(--st, inherit); }

[data-theme="violet"] .status-word { color: color-mix(in srgb, var(--st, #f0ecf8) 42%, #eef2f6); }
[data-theme="graphite"] .status-word { color: color-mix(in srgb, var(--st, #e9ebee) 42%, #eef2f6); }

table.task-table.grid-borders th,
table.task-table.grid-borders td {
    border: var(--task-grid-width, 1px) solid var(--task-grid-color, var(--task-grid-default));
}
table.task-table.grid-borders { border-collapse: collapse; }

@media (min-width: 515px) {
    table.task-table { table-layout: auto; }
    table.task-table.cells-clip { table-layout: fixed; }
    table.task-table.cells-clip td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    table.task-table.cells-wrap td { word-break: break-word; }
    table.task-table th { position: relative; }
    table.task-table thead th { overflow: hidden; text-overflow: ellipsis; }
}

.col-resizer {
    position: absolute;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    cursor: col-resize;
    z-index: 2;
}
.col-resizer:hover { background: var(--accent-soft); }
table.task-table th:last-child .col-resizer { right: 0; }
body.col-resizing { cursor: col-resize; user-select: none; }

@media (max-width: 514px) {
    .col-resizer { display: none; }
    table.task-table.grid-borders td { border: 0; }
}

.attach-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    transition: border-color .14s ease;
}
.attach-zone:hover { border-color: var(--accent); }
.attach-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.attach-pick:hover { border-color: var(--accent); }
.attach-hint { font-size: var(--fs-sm); color: var(--text-muted); flex: 1 1 200px; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.attach-chips.is-empty { display: none; }
.attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}
.attach-chip-thumb {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 auto;
}
.attach-chip-name {
    font-size: var(--fs-sm);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attach-chip-remove {
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
}
.attach-chip-remove:hover { color: #fff; background: var(--danger); }

[data-theme="violet"] .attach-chip-remove:hover,
[data-theme="graphite"] .attach-chip-remove:hover { color: #1a0d0d; }

.comment-files { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.comment-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.comment-file-thumb {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}
.comment-file-thumb:hover { border-color: var(--accent); }
.comment-file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }

.crm-rem-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 5px;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: default;
    z-index: 3;
}
.crm-rem-badge.is-overdue { color: var(--danger); border-color: var(--danger); }
.crm-rem-ico { width: 14px; height: 14px; }
.crm-rem-count { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-card { position: relative; }
.crm-card .crm-card-title { padding-right: 52px; }

.crm-rem-tip {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 70;
    width: 44ch;
    max-width: 78vw;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.crm-rem-badge:hover .crm-rem-tip { display: block; }
.crm-rem-tip-item {
    padding: 4px 0;
    font-size: var(--fs-sm);
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    border-bottom: 1px solid var(--border);
}
.crm-rem-tip-item:last-child { border-bottom: 0; }
.crm-rem-tip-when { font-weight: 700; color: var(--text-soft); margin-right: 4px; }

.crm-rem-overdue { text-decoration: underline; text-decoration-color: var(--danger); text-decoration-thickness: 2px; }
.crm-rem-strike { text-decoration: line-through; color: var(--text-muted); }
.crm-rem-deleted { opacity: .6; }
.crm-rem-edit { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }

.colcfg-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.colcfg-move { display: flex; gap: 4px; flex: 0 0 auto; }
.colcfg-move .btn { min-height: 28px; padding: 2px 8px; }
.colcfg-visible-wrap { margin-bottom: 0; flex: 0 0 auto; }
.colcfg-title-wrap { margin-bottom: 0; flex: 1 1 260px; }
.colcfg-title-wrap input { margin-top: 0; }

.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.color-row input[type="color"] {
    width: 52px;
    height: 38px;
    padding: 2px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.color-row .inline { margin-bottom: 0; }

.admin-danger-zone { border-color: var(--danger); }
.danger-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.danger-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.danger-action .btn { flex: 0 0 auto; }
.danger-action .hint { flex: 1 1 260px; margin-top: 0; }

.collapse-head h2 { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em; }
.collapse-head .caret { font-size: 11.5px; }
.collapsible.is-collapsed { padding: 6px 10px; }
.collapsible.is-collapsed .card-head { margin-bottom: 0; gap: 6px; }
.collapsible.is-collapsed .collapse-head h2 { font-size: 12px; }

button.stat {
    width: 100%;
    margin: 0;
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
button.stat:hover { border-color: var(--accent); box-shadow: var(--shadow); }
button.stat:active { transform: translateY(1px); }
button.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-full {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: none;
    background: var(--overlay);
}
.modal-full.is-open { display: flex; }
body.modal-full-open { overflow: hidden; }
.modal-full-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--bg);
}
.modal-full-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px var(--pad);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.modal-full-head h2 { margin: 0; font-size: var(--fs-h2); }
.modal-full-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.modal-full-close:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.modal-full-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-full-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px var(--pad) 24px;
}
.scope-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
}

.comment-add-btn { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.comment-add-plus { font-size: 15px; font-weight: 700; line-height: 1; }
.comment-add-btn.is-hidden, .comment-form.is-hidden { display: none; }

.timeline-item.is-status { border-left-color: var(--border-strong); }
.timeline-item.is-comment { border-left-color: var(--accent); }

input.is-muted { opacity: .55; }

.theme-picker { display: inline-flex; align-items: center; gap: 6px; }

.theme-picker-label {
    font-size: var(--fs-sm);
    color: var(--nav-muted);
    white-space: nowrap;
}

.theme-picker-options { display: inline-flex; gap: 4px; }

.theme-dot {
    position: relative;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid rgba(140, 155, 180, .55);
    border-radius: 50%;
    cursor: pointer;
    background: var(--surface);
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.theme-dot:hover { transform: scale(1.08); border-color: var(--nav-accent); }

.theme-dot:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }

.theme-dot.is-active {
    border-color: var(--nav-accent);
    box-shadow: 0 0 0 3px var(--nav-active-bg);
}

.theme-dot-blue     { background: linear-gradient(135deg, #ffffff 0 50%, #0062cc 50% 100%); }
.theme-dot-violet   { background: linear-gradient(135deg, #12081f 0 50%, #b183f7 50% 100%); }
.theme-dot-graphite { background: linear-gradient(135deg, #16181c 0 50%, #93b8e2 50% 100%); }
.theme-dot-mono     { background: linear-gradient(135deg, #ffffff 0 50%, #18181b 50% 100%); }

[data-theme="mono"] .theme-dot { border-color: #b0b0b8; }

.theme-picker-select {
    padding: 6px 10px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

@media (max-width: 914px) {
    .theme-picker-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-dot { transition: none; }
    .theme-dot:hover { transform: none; }
}
