/* Piratia bug tracker — tokens from design/TOKENS.md. No external resources. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Fira Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/fira-sans-condensed-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fira Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/fira-sans-condensed-600-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #FFFFFF;
  --bg-soft: #F7F6F2;
  --bg-group: #F2F0EA;
  --line: #E6E2D8;
  --line-strong: #D3CEC2;
  --line-faint: #EFECE4;
  --ink: #14191D;
  --ink-2: #3A434A;
  --ink-3: #5E676E;
  --ink-mute: #6E777D;
  --accent: #E0B040;
  --accent-soft: rgba(224, 176, 64, .16);
  --accent-line: rgba(224, 176, 64, .6);
  --accent-ink: #8A620A;
  --ok: #1A7F37;
  --teal: #1E8C88;
  --teal-ink: #17716E;
  --fail: #E5484D;
  --fail-ink: #CF2F2F;
  --unsure: #8250DF;
  --info: #2F6FD6;
  --warn: #C4581A;
  --pink: #BF3989;
  --dark: #0E1418;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Fira Sans Condensed", "Avenir Next Condensed", "Arial Narrow", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 13px/1.35 var(--sans); color: var(--ink-2); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); font-size: 12px; }
.spacer { flex: 1; }
.js .js-hide { display: none; }
kbd { font: 600 10px/1 var(--mono); padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink-3); }
.label { font: 600 11px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: baseline; gap: 6px; }
.label-hint { font: 400 11px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--bg); color: var(--ink); font: 600 12px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--dark); }
.btn-primary:hover { background: #D6A436; }
.btn-primary kbd { background: rgba(14, 20, 24, .12); border-color: transparent; color: var(--dark); }
.btn-ghost { background: transparent; }
.btn-small { height: 24px; padding: 0 8px; font-size: 11px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid transparent; border-radius: var(--r);
  background: transparent; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; text-decoration: none; }
.icon-btn:hover { background: var(--line-faint); color: var(--ink); text-decoration: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--info); font: 500 11px var(--sans); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* chips, badges, avatars */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 16px; padding: 0 4px; border-radius: 1px;
  font: 700 10px/1 var(--mono); letter-spacing: .02em; background: rgba(94, 103, 110, .12); color: var(--ink-3); white-space: nowrap; }
.chip-CLI { background: rgba(47, 111, 214, .12); color: #2560BF; }
.chip-SRV { background: rgba(26, 127, 55, .12); color: var(--ok); }
.chip-PRT { background: rgba(130, 80, 223, .12); color: #7140CF; }
.chip-WEB { background: rgba(196, 88, 26, .12); color: #B14E16; }
.chip-AST { background: rgba(191, 57, 137, .12); color: #AE3079; }
.chip-OPS { background: rgba(94, 103, 110, .14); color: var(--ink-3); }
.chip-wide { height: 18px; padding: 0 6px; font-weight: 600; font-size: 10px; margin: 0 4px 4px 0; }
.stand-badge { display: inline-block; padding: 1px 4px; border: 1px solid var(--line-strong); border-radius: 1px; background: var(--bg);
  font: 600 10px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: var(--r); font: 500 11px/1 var(--mono); white-space: nowrap; }
.pill-frames { background: rgba(94, 103, 110, .1); color: var(--ink-2); }
.pill-none { border: 1px dashed var(--line-strong); color: var(--ink-mute); }
.pill-comments { color: var(--ink-3); padding: 0 2px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px;
  font: 700 9px/1 var(--sans); color: #fff; background: var(--ink-3); flex: none; }
.avatar-lg { width: 28px; height: 28px; border-radius: 7px; font-size: 11px; }
.avatar-empty { border: 1px dashed var(--line-strong); background: transparent; }
.tone-0 { background: var(--teal-ink); } .tone-1 { background: var(--accent); color: var(--dark); } .tone-2 { background: var(--warn); }
.tone-3 { background: var(--info); } .tone-4 { background: var(--unsure); } .tone-5 { background: var(--pink); }
.stand-dot { width: 7px; height: 7px; border-radius: 1px; background: var(--ink-mute); flex: none; }
.stand-alpha { background: var(--teal); } .stand-beta { background: var(--accent); } .stand-local { background: var(--ink-mute); }

/* status marks */
.st { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink-mute); flex: none; position: relative; }
.st-created { border-color: var(--ink-mute); }
.st-investigated { border-color: var(--unsure); background: radial-gradient(circle, var(--unsure) 0 2px, transparent 2.5px); }
.st-ready { border-color: var(--info); background: radial-gradient(circle, var(--info) 0 2px, transparent 2.5px); }
.st-in_progress { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.st-results { border-color: var(--teal); background: radial-gradient(circle, var(--teal) 0 2.5px, transparent 3px); }
.st-accepted { border-color: var(--ok); background: var(--ok); }
.status-chip { display: inline-block; padding: 3px 7px; border-radius: var(--r); font: 600 11px/1.2 var(--cond); letter-spacing: .06em; text-transform: uppercase;
  background: var(--line-faint); color: var(--ink-2); }
.status-investigated { background: rgba(130, 80, 223, .12); color: #6B3FC4; }
.status-ready { background: rgba(47, 111, 214, .12); color: #2560BF; }
.status-in_progress { background: var(--accent-soft); color: var(--accent-ink); }
.status-results { background: rgba(30, 140, 136, .12); color: var(--teal-ink); }
.status-accepted { background: rgba(26, 127, 55, .12); color: var(--ok); }

/* shell: sidebar | list | detail */
body.app { overflow: hidden; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100vh; }
.shell.has-detail { grid-template-columns: 232px minmax(0, 1fr) 420px; }

.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--bg-soft); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; flex: none; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 14px; height: 14px; border: 2px solid var(--accent); transform: rotate(45deg); border-radius: 2px; margin: 0 3px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font: 600 16px/1.1 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.brand-sub { font: 400 11px/1.3 var(--sans); color: var(--ink-3); }
.search { position: relative; margin: 0 12px 8px; flex: none; }
.search input { width: 100%; height: 32px; padding: 0 28px 0 28px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); font-size: 12px; }
.search input::placeholder { color: var(--ink-mute); }
.search-icon { position: absolute; left: 9px; top: 10px; width: 10px; height: 10px; border: 1.5px solid var(--ink-3); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; left: 8px; top: 8px; width: 4px; height: 1.5px; background: var(--ink-3); transform: rotate(45deg); }
.search kbd { position: absolute; right: 7px; top: 8px; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
.side-section { margin-top: 14px; }
.side-section .label { padding: 0 8px 6px; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r);
  color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav-item:hover { background: var(--line-faint); text-decoration: none; }
.nav-item.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-hint { font: 400 10px var(--mono); color: var(--ink-3); }
.nav-count { font: 400 11px var(--mono); color: var(--ink-3); }
.nav-badge { min-width: 18px; height: 16px; padding: 0 4px; border-radius: var(--r); background: var(--accent); color: var(--dark); font: 700 10px/16px var(--mono); text-align: center; }
.nav-comp { height: 26px; }
.view-icon { width: 12px; height: 10px; border: 1.5px solid var(--ink-3); border-radius: 1px; flex: none; }
.view-inbox { border-top-width: 1.5px; border-radius: 1px 1px 3px 3px; }
.view-all { border-width: 1.5px 0; height: 9px; background: linear-gradient(var(--ink-3), var(--ink-3)) center / 100% 1.5px no-repeat; }
.nav-item.is-active .view-icon { border-color: var(--accent-ink); }
.view-board { border-style: solid; background: linear-gradient(90deg, transparent 45%, var(--ink-3) 45% 60%, transparent 60%); }
.user-card { display: flex; align-items: center; gap: 10px; margin: 8px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); flex: none; }
.user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { font-size: 11px; color: var(--ink-mute); }
.logout { margin: 0; }

/* main list */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.page-title { font: 600 17px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.title-count { font: 400 13px var(--mono); letter-spacing: 0; color: var(--ink-3); margin-left: 6px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.topbar-actions .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--r);
  font: 600 12px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.tab:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.tab.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.tab-count { font: 400 11px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.main { container-type: inline-size; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@container (min-width: 1100px) { .filters { margin-left: auto; } }
.filter { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); font-size: 12px; }
.filter-name { color: var(--ink-3); }
.filter select { appearance: none; -webkit-appearance: none; border: 0; font-size: 12px; color: var(--ink); padding: 0 16px 0 2px; max-width: 170px; cursor: pointer; height: 24px;
  background: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) right 7px center / 4px 4px no-repeat, linear-gradient(-45deg, transparent 50%, var(--ink-3) 50%) right 4px center / 4px 4px no-repeat; }
.filter.is-set { border-color: var(--teal); background: rgba(30, 140, 136, .1); }
.filter.is-set .filter-name { color: var(--teal-ink); }
.filter-check { padding-right: 8px; cursor: pointer; }
.filter-check input { margin: 0; accent-color: var(--teal); }

.strip { display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); flex: none;
  font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.strip-title { font: 600 12px var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.strip-bar { width: 180px; height: 6px; flex: none; }
.seg-bg { fill: #E8E3D6; }
.seg-accepted { fill: var(--teal); } .seg-results { fill: var(--accent); } .seg-progress { fill: var(--info); } .seg-open { fill: var(--line-strong); }
.strip-stat b { font-family: var(--mono); font-weight: 700; }
.num-accepted { color: var(--teal-ink); } .num-results { color: var(--accent-ink); } .num-progress { color: var(--info); } .num-open { color: var(--ink-2); }
.strip-right { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.strip-right a { font-weight: 600; }

.list { flex: 1; min-height: 0; overflow-y: auto; }
.colhead, .row { display: grid; grid-template-columns: 80px 76px minmax(0, 1fr) 60px 96px 30px 52px; align-items: center; column-gap: 8px; padding: 0 16px 0 20px; }
.colhead { position: sticky; top: 0; z-index: 2; height: 28px; background: var(--bg); border-bottom: 1px solid var(--line);
  font: 600 11px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.col-right { text-align: right; }
.group { border-bottom: 1px solid var(--line); }
.group-head { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 20px 0 12px; background: var(--bg-group); cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; }
.group-head::-webkit-details-marker { display: none; }
.chevron { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--ink-3); transform: rotate(-90deg); transition: transform .1s; }
.group[open] .chevron { transform: none; }
.group-name { font: 600 12px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.group-count { font: 400 11px var(--mono); color: var(--ink-3); }
.group-hint { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.row { min-height: 38px; padding-top: 5px; padding-bottom: 5px; border-top: 1px solid var(--line-faint); color: var(--ink-2); text-decoration: none; border-left: 3px solid transparent; padding-left: 17px; }
.row:hover { background: #FBFAF6; text-decoration: none; }
.row.is-selected { background: var(--accent-soft); border-left-color: var(--accent); }
.row.is-selected .cell-id { color: var(--accent-ink); font-weight: 600; }
.cell-id { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.cell-comps { display: flex; flex-wrap: wrap; gap: 3px; }
.cell-title { padding-right: 6px; font-weight: 500; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cell-evidence { display: flex; gap: 4px; align-items: center; }
.cell-time { text-align: right; font: 400 11px var(--mono); color: var(--ink-mute); white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); display: grid; gap: 6px; }
.statusbar { display: flex; align-items: center; gap: 16px; height: 30px; padding: 0 16px 0 20px; border-top: 1px solid var(--line); background: var(--bg-soft); flex: none;
  font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.status-left { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status-left .mono { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.online-dot { width: 7px; height: 7px; border-radius: 1px; background: var(--teal); flex: none; }
.hotkeys { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hotkeys kbd { margin-left: 6px; }

/* detail panel */
.detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; background: var(--bg-soft); border-left: 1px solid var(--line); }
.detail-head { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.ref { font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 24px; }
.detail-title { font: 600 17px/1.3 var(--sans); color: var(--ink); overflow-wrap: anywhere; margin-bottom: 14px; }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; list-style: none; margin: 0 0 14px; padding: 0; }
.step { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.step-bar { height: 3px; background: var(--line-strong); border-radius: 1px; }
.step-label { font: 600 10px/1.15 var(--cond); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); min-height: 2.3em; hyphens: manual; }
.step-done .step-bar { background: var(--teal); } .step-done .step-label { color: var(--teal-ink); }
.step-current .step-bar { background: var(--accent); } .step-current .step-label { color: var(--accent-ink); }
.props { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 10px; margin: 0 0 14px; font-size: 12px; align-items: baseline; }
.props dt { color: var(--ink-3); }
.props dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.props dd.mono { font-size: 11px; }
.alert { margin: 0 0 12px; padding: 8px 10px; border: 1px solid rgba(229, 72, 77, .5); border-radius: var(--r); background: rgba(229, 72, 77, .08); color: var(--fail-ink); font-size: 12px; }
.notice { margin: 0 0 12px; padding: 8px 10px; border: 1px solid rgba(30, 140, 136, .5); border-radius: var(--r); background: rgba(30, 140, 136, .08); color: var(--teal-ink); font-size: 12px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-title { font: 600 11px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.card-title-accent { color: var(--accent-ink); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: 13px; }
.code { margin: 0; padding: 8px 10px; background: #F2F1ED; border-radius: var(--r); font: 400 11px/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.moves .move-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.btn-move { text-transform: none; letter-spacing: 0; font: 500 12px/1 var(--sans); }
.btn-move:not(.btn-back) { border-color: var(--teal); color: var(--teal-ink); }
.btn-back { color: var(--ink-2); }
.moves textarea, .composer textarea, .fields textarea, .fields input[type=text], .fields select, .login-card input[type=text], .login-card input[type=password] {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); padding: 6px 8px; font-size: 13px; color: var(--ink); }
.moves textarea { resize: none; min-height: 36px; font-size: 12px; }
.needs-comment textarea[name=comment] { border-color: var(--fail); }
.dtabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin: 4px 0 12px; }
.dtab { border: 0; background: none; padding: 8px 0 7px; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer;
  font: 600 11px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dtab sup { font: 400 10px var(--mono); letter-spacing: 0; }
.dtab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.js .tabpanel[hidden] { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--bg-group); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-caption { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 2px 5px; background: rgba(255, 255, 255, .94); border-radius: 1px;
  font: 500 10px/1.3 var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comments { margin: 14px 0 8px; display: grid; gap: 8px; }
.comment { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 10px; display: grid; gap: 6px; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-head time, .event time { font: 400 11px var(--mono); color: var(--ink-mute); }
.tag-agent { font: 600 9px/1 var(--mono); padding: 2px 4px; border-radius: 1px; background: rgba(47, 111, 214, .12); color: #2560BF; text-transform: uppercase; }
.edit-link { margin-top: 8px; font-size: 12px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { display: flex; gap: 10px; align-items: center; min-width: 0; }
.file-thumb { width: 64px; height: 40px; flex: none; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--bg-group); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-text { display: flex; flex-direction: column; min-width: 0; }
.file-text a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-meta { font-size: 11px; color: var(--ink-3); }
.activity { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-faint); font-size: 12px; align-items: baseline; }
.event-author { font-weight: 600; color: var(--ink); }
.event-text { color: var(--ink-2); overflow-wrap: anywhere; }
.composer { flex: none; border-top: 1px solid var(--line); box-shadow: 0 -8px 10px -8px rgba(20, 25, 29, .12); background: var(--bg-soft); padding: 8px 12px 10px; }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { resize: none; min-height: 32px; max-height: 160px; font-size: 12px; }
.composer.is-drop, .ticket-form.is-drop .dropzone { outline: 2px dashed var(--accent); outline-offset: -4px; }
.file-btn { position: relative; overflow: hidden; width: 32px; height: 32px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 16px; flex: none; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-send { width: 32px; height: 32px; padding: 0; justify-content: center; font-size: 15px; flex: none; }
.previews { display: flex; flex-wrap: wrap; gap: 6px; }
.previews:not(:empty) { margin-bottom: 8px; }
.preview { position: relative; width: 72px; height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 1px; background: rgba(14, 20, 24, .7); color: #fff; font-size: 11px; line-height: 16px; cursor: pointer; }
.previews-large .preview { width: 160px; height: 100px; }

/* full ticket page */
.main-full { background: var(--bg-soft); }
.detail-full { width: 100%; max-width: 920px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.detail-full .detail-body { padding: 20px 24px 28px; }
.detail-full .detail-title { font-size: 20px; }

/* forms */
.form-scroll { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg-soft); }
.ticket-form { max-width: 860px; margin: 0 auto; padding: 20px 24px 32px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font: 600 11px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 0; }
.fields textarea { resize: vertical; }
.fields textarea.mono { font: 400 12px/1.5 var(--mono); }
.fields input[type=text], .fields select { height: 32px; }
.fields select { appearance: none; -webkit-appearance: none; padding-right: 24px; cursor: pointer;
  background: var(--bg) linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) right 13px center / 5px 5px no-repeat; }
.fields select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-3) 50%);
  background-position: right 12px center, right 8px center; background-size: 4px 4px; background-repeat: no-repeat; }
.ticket-form > .field { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.comp-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.comp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.comp-check input { accent-color: var(--accent-ink); margin: 0; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; padding: 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--bg); text-align: center; cursor: pointer; margin-bottom: 8px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-text { color: var(--ink-2); font-size: 13px; }
.dropzone-hint { color: var(--ink-mute); font-size: 11px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.edit-card .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* login */
body.login-page { background: var(--bg-soft); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 24px 24px; display: grid; gap: 12px; }
.login-card .brand { padding: 0; }
.login-title { font: 600 18px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.login-lead, .login-foot { font-size: 12px; color: var(--ink-3); }
.login-card input[type=text], .login-card input[type=password] { height: 34px; }
.stand-pick { display: flex; gap: 6px; border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.stand-pick legend { margin-bottom: 6px; }
.stand-option { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; font-weight: 500; color: var(--ink); }
.stand-option input { position: absolute; opacity: 0; pointer-events: none; }
.stand-option:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-line); }
.stand-option:has(input:focus-visible) { outline: 2px solid var(--info); outline-offset: 1px; }
.login-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.login-actions .btn { height: 34px; padding: 0 16px; }

/* responsive: panel becomes a page below 1100 px, sidebar collapses below 760 px */
@media (max-width: 1100px) {
  .shell.has-detail { grid-template-columns: 232px minmax(0, 1fr); }
  .shell.has-detail .detail { position: fixed; inset: 0 0 0 232px; z-index: 10; }
}
@media (max-width: 760px) {
  body.app { overflow: auto; }
  .shell, .shell.has-detail { display: block; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .side-scroll, .user-card { display: none; }
  .main, .detail { height: auto; min-height: 100vh; }
  .shell.has-detail .detail { inset: 0; overflow-y: auto; }
  .colhead { display: none; }
  .row { grid-template-columns: 70px minmax(0, 1fr) 48px; }
  .row .cell-comps, .row .cell-stand, .row .cell-evidence, .row .cell-owner { display: none; }
  .fields, .edit-card .fields { grid-template-columns: minmax(0, 1fr); }
  .hotkeys { display: none; }
}
.offscreen { position: fixed; left: -9999px; top: 0; }
