/* «Конвейер роликов» — style B (flat dark on BattlePass graphite): elevation by lightness alone,
   the blue only on data and on «Вышло», the primary action inverted. A light variant follows the system theme.
   Grid at 1440: sidebar 224 + canvas 1216; canvas padding 29 → content 1158. One gap: 16. */
:root {
  --ground: #16191d; --surface: #1e2227; --raised: #272c33; --hover: #2c3239;
  --rule: #262b31; --control: #3a4149;
  --text: #f2f4f6; --muted: #b4b9bf; --faint: #959ba2;
  --accent: #3aa6ff; --accent-ink: #06121e; --accent-tint: #1d3247;
  --wait: #e8a33a; --handed: #2fc4ad; --negative: #f06a6a;
  --primary: #ffffff; --primary-ink: #111418;
  --font: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gap: 16px; --pad: 29px; --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --ground: #f4f6f8; --surface: #ffffff; --raised: #eef1f4; --hover: #e7ebef;
  --rule: #e6eaee; --control: #cdd4db;
  --text: #14181c; --muted: #4f5862; --faint: #5f6873;
  --accent: #0078d6; --accent-ink: #ffffff; --accent-tint: #e3f0fb;
  --wait: #b86e00; --handed: #0b8a7a; --negative: #c4242a;
  --primary: #14181c; --primary-ink: #ffffff;
  color-scheme: light } }
:root[data-theme="light"] {
  --ground: #f4f6f8; --surface: #ffffff; --raised: #eef1f4; --hover: #e7ebef;
  --rule: #e6eaee; --control: #cdd4db;
  --text: #14181c; --muted: #4f5862; --faint: #5f6873;
  --accent: #0078d6; --accent-ink: #ffffff; --accent-tint: #e3f0fb;
  --wait: #b86e00; --handed: #0b8a7a; --negative: #c4242a;
  --primary: #14181c; --primary-ink: #ffffff;
  color-scheme: light }

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--ground); color: var(--text); font: 400 14px/20px var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased }
a { color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

/* shell: sidebar + top bar on one ground, divided by 1px rules */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh }
.side { border-right: 1px solid var(--rule); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto }
.mark { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 600; font-size: 15px; text-decoration: none }
.mark i { width: 28px; height: 28px; border-radius: 7px; background: var(--text); color: var(--ground); display: grid; place-items: center; font: 700 12px var(--font); font-style: normal; flex: none }
.nav { display: grid; gap: 2px }
.nav a, .nav button { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100% }
.nav a:hover, .nav button:hover { color: var(--text) }
.nav [aria-current="page"], .nav [aria-pressed="true"] { color: var(--text); font-weight: 500 }
.nav b { font-weight: 500; font-size: 12px; color: var(--faint) }
.grp { margin: 22px 10px 6px; font-size: 12px; color: var(--faint) }
.side .foot { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: var(--faint) }

.top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 var(--pad); border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--ground); z-index: 5 }
.top .sp { flex: 1 }
.stamp { color: var(--faint); font-size: 12px; white-space: nowrap }
.seg { display: flex; gap: 2px; background: var(--surface); border-radius: 8px; padding: 3px; overflow-x: auto; max-width: 100%; scrollbar-width: none }
.seg button { padding: 5px 10px; border-radius: 6px; color: var(--muted); font: 400 13px var(--font); background: none; border: 0; cursor: pointer; white-space: nowrap }
.seg button:hover { color: var(--text) }
.seg button[aria-pressed="true"] { background: var(--control); color: var(--text); font-weight: 500 }
.btn { height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--primary); color: var(--primary-ink); font: 500 14px var(--font); cursor: pointer; white-space: nowrap }
.btn:hover { opacity: .88 } .btn:active { transform: translateY(1px) }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--control) }
.link { background: none; border: 0; color: var(--text); font: 400 13px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0 }

main { padding: 26px var(--pad) 48px; display: grid; gap: 22px; min-width: 0 }
h1 { font: 600 24px/30px var(--font); margin: 0; letter-spacing: -.01em }
.lead { color: var(--muted); margin: 4px 0 0 }

/* panels: lightness step, no border, no shadow */
.panel { background: var(--surface); border-radius: var(--radius); min-width: 0 }
.ph { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px 6px; flex-wrap: wrap }
.ph h2 { margin: 0; font: 600 16px var(--font) }
.ph .n { color: var(--faint); font-size: 13px }
.ph .sp { flex: 1 }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; transform: translateY(-1px) }

table { width: 100%; border-collapse: collapse }
th { text-align: left; font: 400 12px var(--font); color: var(--faint); padding: 4px 18px 8px; white-space: nowrap }
td { padding: 6px 18px; height: 48px; border-top: 1px solid var(--rule); vertical-align: middle }
th.num, td.num { text-align: right }
td.t { width: 44% }
td.t .ttl { font-weight: 500 }
td.t small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; margin-top: 1px }
td.m { color: var(--muted); white-space: nowrap }
.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--raised); color: var(--muted); white-space: nowrap; flex: none }
.empty { padding: 14px 18px 18px; color: var(--faint) }
.more { padding: 10px 18px 14px; border-top: 1px solid var(--rule) }

select, input, textarea { font: 400 14px var(--font); color: var(--text); background: var(--ground); border: 1px solid var(--control); border-radius: 6px; padding: 0 10px; height: 34px; width: 100% }
textarea { padding: 8px 10px; height: auto; min-height: 60px; resize: vertical }
td select { height: 30px; font-size: 13px; width: auto; max-width: 220px; background: transparent }
td select.pick { color: var(--muted); max-width: 260px }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0 }

/* tooltips and floating things are the only shadows */
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--ground); font-size: 12px; line-height: 16px; padding: 6px 8px; border-radius: 6px; max-width: 260px; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 4px 16px rgba(0,0,0,.25) }

@media (max-width: 900px) {
  :root { --pad: 16px }
  .shell { grid-template-columns: 1fr }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--rule); overflow-x: auto }
  .side .mark { padding: 0 10px 0 0 } .side .mark span { display: none }
  .side .nav { display: flex } .side .grp, .side .projects, .side .foot { display: none }
  .top { height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 10px; position: static }
  .top .stamp { display: none }
  h1 { font-size: 22px }
  td.hide, th.hide { display: none }
  td.t { width: auto }
  td { padding: 8px 14px } th { padding: 4px 14px 8px }
}
@media (prefers-reduced-motion: no-preference) { .btn, .nav a, .seg button { transition: color .15s, background-color .15s, opacity .15s } }

.shell > * { min-width: 0 }
