@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/static/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: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/static/fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/static/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+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/static/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Токены. Одна тема на всё приложение, переключается атрибутом data-theme на <html>. */
:root, :root[data-theme="atrion"] {
  --bg: #0A0A0D; --surface: #141317; --surface-2: #1E1C21; --surface-3: #26242A;
  --ink: #E6E7EA; --ink-2: #9C9FA6; --line: #26242A; --line-2: #36333B;
  --accent: #D13A4E; --accent-ink: #EA6A7C; --btn: #79283D; --btn-hover: #8C3047; --btn-active: #652133; --on-btn: #FFFFFF;
  --ok: #E6E7EA; --ok-bg: #26242A; --ok-fill: #BFC3CB;
  --wip: #BFC3CB; --wip-bg: #1E1C21; --wip-fill: #5E6168;
  --bad: #EA6A7C; --bad-bg: #2A1219; --bad-fill: #D13A4E;
  --mark: #BFC3CB; --mark-lit: #D13A4E; --glow: rgba(121, 40, 61, .35);
  --focus: #EA6A7C;
}
:root[data-theme="orda"] {
  --bg: #0B0B0D; --surface: #161412; --surface-2: #221E1A; --surface-3: #2A2621;
  --ink: #EDE6D8; --ink-2: #A89F90; --line: #2A2621; --line-2: #3A342C;
  --accent: #C9A96E; --accent-ink: #C9A96E; --btn: #C9A96E; --btn-hover: #D6B87E; --btn-active: #B8975C; --on-btn: #0B0B0D;
  --ok: #7FB08A; --ok-bg: #18241B; --ok-fill: #5E8A69;
  --wip: #C9A96E; --wip-bg: #2A2218; --wip-fill: #C9A96E;
  --bad: #F06A74; --bad-bg: #2A1416; --bad-fill: #E63946;
  --mark: #C9A96E; --mark-lit: #C9A96E; --glow: rgba(201, 169, 110, .16);
  --focus: #C9A96E;
}
:root {
  --r-lg: 16px; --r-md: 12px; --r-sm: 8px; --r-pill: 99px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --t-fast: 140ms; --t-mid: 220ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --ff: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --tabs-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--ff); font-size: 14px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: lining-nums tabular-nums; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* каркас */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--tabs-h) + var(--s6)); display: flex; flex-direction: column; gap: var(--s3); }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; }
.top h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 6px 0; }
.back:hover { color: var(--ink); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; z-index: 10; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; position: relative; transition: color var(--t-fast); }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab svg.i { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 2px; width: 236px; flex: none; position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--line); padding: var(--s5) var(--s3); }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2) var(--s5); }
  .nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-2);
    text-decoration: none; font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
  .nav:hover { background: var(--surface-2); color: var(--ink); }
  .nav[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
  .side .who { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); }
  .page { padding: var(--s6) var(--s8) var(--s8); max-width: 980px; }
  .grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s4); align-items: start; }
}

/* блоки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.card.lead { border-left: 3px solid var(--accent); }
.card.alert { border-left: 3px solid var(--bad-fill); }
.card.flush { padding: 2px var(--s4); }
a.card { display: block; text-decoration: none; transition: border-color var(--t-fast), background var(--t-fast); }
a.card:hover { border-color: var(--line-2); background: var(--surface-2); }
.sec { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-top: var(--s2); }
.ct { font-size: 15px; font-weight: 700; line-height: 1.3; }
.cs { font-size: 12.5px; color: var(--ink-2); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: var(--s5); background: radial-gradient(120% 140% at 100% 120%, var(--glow), transparent 60%), var(--surface); border: 1px solid var(--line); }
.hero .big { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero .k { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.hero .deco { position: absolute; right: -8px; bottom: -14px; width: 150px; height: 150px; color: var(--surface-3); opacity: .9; pointer-events: none; }
.hero > *:not(.deco) { position: relative; }

.li { display: flex; align-items: center; gap: var(--s3); padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; }
.li:first-child { border-top: 0; }
a.li:hover .t b { text-decoration: underline; text-underline-offset: 3px; }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-weight: 600; }
.li .t small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--surface-3); color: var(--ink); flex: none; }
.av.s { width: 28px; height: 28px; font-size: 10.5px; }
.av.l { width: 64px; height: 64px; font-size: 22px; border: 2px solid var(--accent); }
.av.acc { background: var(--mark); color: var(--bg); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-work, .st-review { background: var(--wip-bg); color: var(--wip); }
.st-new, .st-returned, .st-bad { background: var(--bad-bg); color: var(--bad); }
.st-muted { background: var(--surface-2); color: var(--ink-2); }

.prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; display: flex; }
.prog i { display: block; height: 100%; }
.prog .o { background: var(--ok-fill); } .prog .w { background: var(--wip-fill); } .prog .b { background: var(--bad-fill); }
.ten { display: inline-flex; gap: 3px; align-items: flex-end; }
.ten i { display: block; width: 6px; height: 14px; border-radius: 1px; background: var(--surface-3); }
:root[data-theme="orda"] .ten i { width: 9px; height: 9px; border-radius: 2px; }
.ten i.o { background: var(--ok-fill); } .ten i.w { background: var(--wip-fill); } .ten i.b { background: var(--bad-fill); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }

.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.stat3 > div { text-align: center; padding: var(--s3) var(--s1); }
.stat3 > div + div { border-left: 1px solid var(--line); }
.stat3 b { display: block; font-size: 22px; font-weight: 700; }
.stat3 small { font-size: 11.5px; color: var(--ink-2); }

/* кнопки: обычное, наведение, фокус, нажатие, выключено, загрузка */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 0; border-radius: var(--r-md);
  background: var(--btn); color: var(--on-btn); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast); white-space: nowrap; }
.btn:hover { background: var(--btn-hover); }
.btn:active { background: var(--btn-active); transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost:active { background: var(--surface-3); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-bg); }
.btn.danger:hover { background: var(--bad-bg); }
.btn[aria-busy="true"] { color: transparent; position: relative; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-btn); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.ghost[aria-busy="true"]::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.fab { position: fixed; right: var(--s5); bottom: calc(var(--tabs-h) + var(--s5) + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 50%;
  padding: 0; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); z-index: 9; }
@media (min-width: 900px) { .fab { bottom: var(--s8); right: var(--s8); } }

.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; }
.seg a, .seg button { flex: 1; text-align: center; font-size: 13px; font-weight: 600; padding: 8px 0; border-radius: var(--r-sm); color: var(--ink-2);
  text-decoration: none; background: none; border: 0; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }

/* формы: обычное, фокус, ошибка, выключено */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:hover { border-color: var(--ink-2); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--glow); }
.input[aria-invalid="true"] { border-color: var(--bad-fill); }
.input:disabled { opacity: .5; }
textarea.input { min-height: 96px; resize: vertical; }
.err { font-size: 12.5px; color: var(--bad); min-height: 1em; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 13px; background: var(--surface-3); transition: background var(--t-fast); pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t-mid) var(--ease); }
.toggle input:checked + span { background: var(--ok-fill); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle input:disabled + span { opacity: .5; }

.note { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.empty { text-align: center; color: var(--ink-2); padding: var(--s8) var(--s4); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 20px); transform: translateX(-50%); background: var(--surface-3); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-md); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); z-index: 50;
  animation: up var(--t-mid) var(--ease); max-width: calc(100% - 32px); }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%;
  animation: sk 1.2s ease-in-out infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }

.tree { position: relative; }
.node { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.node:first-child { border-top: 0; }
.node .t { flex: 1; min-width: 0; }
.node .t b { display: block; font-weight: 600; }
.node .t small { font-size: 12px; color: var(--ink-2); }
.node.bad .t b { color: var(--bad); }
.d1 { padding-left: 18px; } .d2 { padding-left: 36px; } .d3 { padding-left: 54px; }
.chain { display: flex; align-items: flex-start; gap: 4px; overflow-x: auto; }
.chain .lk { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; text-align: center; }
.chain .lk b { font-size: 12px; font-weight: 600; }
.chain .lk small { font-size: 10.5px; color: var(--ink-2); }
.chain .ar { color: var(--ink-2); margin-top: 6px; }

/* вход */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--s6) var(--s4);
  background: radial-gradient(90% 60% at 50% 110%, var(--glow), transparent 70%), var(--bg); }
.login .box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--s4); }
.login .logo { display: flex; flex-direction: column; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.login .tag { font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.logo-mark { color: var(--mark); }
.wm { color: var(--ink); }
/* правила без предка: символы внутри <use> селекторы с предком не видят */
.lit { fill: var(--mark-lit); }
.acc { stroke: var(--mark-lit); }
.pdlink { font-size: 12px; color: var(--ink-2); text-align: center; }

/* документы */
.doc { max-width: 760px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s8); line-height: 1.6; }
.doc h1 { font-size: 26px; line-height: 1.2; margin: var(--s4) 0 var(--s2); }
.doc h2 { font-size: 17px; margin: var(--s6) 0 var(--s2); }
.doc p, .doc li { color: var(--ink); margin-bottom: var(--s2); }
.doc ul { padding-left: 20px; margin-bottom: var(--s3); }
.doc .meta { color: var(--ink-2); font-size: 13px; }
.doc nav { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px; margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); }
.doc nav a { color: var(--ink-2); }
.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: var(--s3); }
.doc th, .doc td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink-2); font-weight: 600; }
.cookie { position: fixed; left: var(--s4); right: var(--s4); bottom: var(--s4); max-width: 560px; margin: 0 auto; z-index: 60;
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: var(--s3) var(--s4);
  display: flex; gap: var(--s3); align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 13px; }
.cookie p { flex: 1; color: var(--ink); }
.cookie a { color: var(--ink-2); }

/* сцена монолитов на входе и согласии */
.login.scene { background: linear-gradient(180deg, rgba(10, 10, 13, .55) 0%, rgba(10, 10, 13, .82) 55%, #0A0A0D 92%), url('/static/scene.svg') center 30% / cover no-repeat, var(--bg); }
.login .legal { font-size: 12px; color: var(--ink-2); text-align: center; line-height: 1.5; }
.login .legal a { color: var(--ink); }
/* кольцо прогресса и достижения */
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 108px; height: 108px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11px; color: var(--ink-2); line-height: 1.2; }
.badge .bx { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); }
.badge.got .bx { color: var(--mark); border-color: var(--mark); box-shadow: 0 0 0 3px var(--glow); }
.badge.got { color: var(--ink); }
/* таблица подразделений */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.bad td { background: var(--bad-bg); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl a { text-decoration: none; font-weight: 600; }
.tbl a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 899px) { .tbl .hide-m { display: none; } }
.aicard { border-left: 3px solid var(--accent); }
.aicard .ai-k { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.bullets { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bullets div { padding-left: 14px; position: relative; }
.bullets div::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }
a.card.row { display: flex; }
/* не дать странице «протягиваться» вниз: в мессенджере это сворачивает мини-приложение */
html, body { overscroll-behavior-y: none; }
.a2hs ol { padding-left: 20px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.a2hs .kbd { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-weight: 600; }
