/* Стиль ИРИТ-РТФ (токены из «Атласа проектного практикума»): Montserrat, синий + красный, карточки r16, капсулы, светлая/тёмная темы */
:root{
  --bg:#F6F6F6; --surface:#FFFFFF; --sunken:#EEF1F7; --ink:#0D0D0D; --muted:#66686E; --line:#22222226;
  --accent:#1E4391; --accent-ink:#FFFFFF; --red:#EF302B; --turq:#74F9FD; --lblue:#408CC8;
  --s0:#1E4391; --s1:#EF302B; --s2:#408CC8; --s3:#12A4AE; --s4:#F29A2E; --s5:#7B4FC4; --s6:#66686E; --s7:#2E9E5B;
  --hi:#1E8E5A; --mid:#E8A317; --lo:#EF302B;
  --hero-a:#1E4391; --hero-b:#2664B1;
  --display:"Montserrat","Helvetica Neue",Arial,sans-serif; --body:"Montserrat","Helvetica Neue",Arial,sans-serif;
  --board:#FBFCFE; --grid:#C9D2E6;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0A1226; --surface:#111D3B; --sunken:#182852; --ink:#F1F4FA; --muted:#A3ACC3; --line:#FFFFFF24;
    --accent:#6FA6E8; --accent-ink:#0A1226; --red:#FF5C57; --lblue:#6FA6E8;
    --s0:#6FA6E8; --s1:#FF5C57; --s2:#74F9FD; --s3:#3FD0B6; --s4:#F6B35A; --s5:#B08CF0; --s6:#A3ACC3; --s7:#6FD08F;
    --hi:#5FD18E; --mid:#F2C14E; --lo:#FF6B66; --hero-a:#10275E; --hero-b:#1E4391;
    --board:#0D1833; --grid:#26376A;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0A1226; --surface:#111D3B; --sunken:#182852; --ink:#F1F4FA; --muted:#A3ACC3; --line:#FFFFFF24;
  --accent:#6FA6E8; --accent-ink:#0A1226; --red:#FF5C57; --lblue:#6FA6E8;
  --s0:#6FA6E8; --s1:#FF5C57; --s2:#74F9FD; --s3:#3FD0B6; --s4:#F6B35A; --s5:#B08CF0; --s6:#A3ACC3; --s7:#6FD08F;
  --hi:#5FD18E; --mid:#F2C14E; --lo:#FF6B66; --hero-a:#10275E; --hero-b:#1E4391;
  --board:#0D1833; --grid:#26376A;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.5;font-weight:500;padding:16px 16px 56px;font-variant-numeric:tabular-nums}
.wrap{max-width:1200px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:28px}
h1,h2,h3{font-family:var(--display);font-weight:800;text-wrap:balance;margin:0;letter-spacing:-.01em}
h1{font-size:clamp(26px,4.2vw,44px);line-height:1.15}
h2{font-size:clamp(19px,2.2vw,26px);line-height:1.2;color:var(--accent)}
h3{font-size:16px;color:var(--ink)}
p{margin:0;max-width:75ch}
a{color:var(--accent)}
.muted{color:var(--muted)} .sub{font-size:12px;color:var(--muted)}
.num{font-weight:700}
section{display:flex;flex-direction:column;gap:14px}
.wrap>*,.panel,section{min-width:0}
.sec-head{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:10px}

/* шапка-«герой» */
header.hero{position:relative;overflow:hidden;border-radius:24px;padding:clamp(22px,4vw,44px);color:#fff;display:flex;flex-direction:column;gap:16px;
  background:radial-gradient(circle at calc(100% - 120px) calc(100% + 140px),#74F9FD 2%,#1E93FF 18%,transparent 42%),radial-gradient(circle at 12% -30%,#3F8FD4 0,transparent 55%),linear-gradient(135deg,var(--hero-a) 0%,var(--hero-b) 70%,var(--hero-a) 100%)}
header.hero .brand{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-weight:700;font-size:13px;letter-spacing:.04em;text-transform:uppercase}
header.hero .brand b{display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:100px;background:var(--red);color:#fff;font-size:12px;letter-spacing:.06em}
header.hero .brand .sp{flex:1}
header.hero h1{color:#fff;max-width:26ch}
header.hero .lead{color:#E6EEFF;font-size:16px;max-width:64ch}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips a,.chips button{font:inherit;text-decoration:none;border:1.5px solid rgba(255,255,255,.7);border-radius:100px;padding:6px 14px;font-size:13px;font-weight:600;color:#fff;background:transparent;cursor:pointer;transition:background .2s}
.chips a:hover,.chips button:hover{background:rgba(255,255,255,.16)}
.chips .on{background:rgba(255,255,255,.22)}
.theme{font:inherit;font-size:12px;font-weight:700;border:1.5px solid rgba(255,255,255,.7);color:#fff;background:transparent;border-radius:100px;padding:4px 12px;cursor:pointer}

/* панели и карточки */
.panel{background:var(--surface);border-radius:16px;padding:22px;display:flex;flex-direction:column;gap:14px}
.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.grid2{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr));align-items:start}
.card{background:var(--surface);border-radius:16px;padding:18px 20px;display:flex;flex-direction:column;gap:8px;text-decoration:none;color:inherit}
.card::before{content:"";width:28px;height:4px;border-radius:2px;background:var(--red)}
.card b{font-size:16px;font-weight:800;color:var(--accent)}
.card p{font-size:14px;color:var(--muted)}
a.card:hover{outline:2px solid var(--accent)}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.kpi{background:var(--sunken);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.kpi .v{font-size:24px;font-weight:800;color:var(--accent);line-height:1.1}
.kpi .d{font-size:12px;color:var(--muted)}

/* кнопки, формы */
.btn{font:inherit;font-size:14px;font-weight:700;border:0;border-radius:100px;padding:10px 20px;background:var(--red);color:#fff;cursor:pointer;transition:filter .2s;text-decoration:none;display:inline-block;line-height:1.2}
.btn:hover{filter:brightness(1.08)} .btn:disabled{opacity:.5;cursor:not-allowed}
.btn.sec{background:transparent;color:var(--accent);border:1.5px solid var(--accent)}
.btn.sm{padding:6px 14px;font-size:13px}
.btn.ghost{background:var(--sunken);color:var(--ink)}
.linkbtn{font:inherit;font-size:13px;font-weight:700;color:var(--accent);background:none;border:0;padding:2px 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.linkbtn:hover{color:var(--red)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.form{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));align-items:end}
.field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);font-weight:600}
.field input,.field select,.field textarea{font:inherit;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px 10px;width:100%;min-width:0}
.field textarea{min-height:110px;resize:vertical}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.tabs{display:flex;flex-wrap:wrap;gap:6px}
.tab,.seg button{font:inherit;font-size:13px;font-weight:600;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);padding:7px 14px;border-radius:100px;cursor:pointer;transition:background .2s,color .2s}
a.tab{text-decoration:none;display:inline-block}
.tab:hover{border-color:var(--accent)}
.tab[aria-selected="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:999px;overflow:hidden}
.seg button{border:0;border-radius:0}
.seg button[aria-pressed="true"]{background:var(--red);color:#fff}

/* таблицы */
.tbl-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{padding:8px 11px;text-align:left;white-space:nowrap}
td.wrap-text,th.wrap-text{white-space:normal}
th{font-weight:700;color:var(--accent);font-size:12px;background:var(--sunken);position:sticky;top:0}
td.r,th.r{text-align:right}
tbody tr+tr td{border-top:1px solid var(--line)}
tbody tr:hover td{background:color-mix(in srgb,var(--accent) 5%,transparent)}
.place{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;border-radius:50%;background:var(--sunken);font-weight:800;font-size:12px}
.place.p1{background:var(--red);color:#fff} .place.p2{background:var(--accent);color:var(--accent-ink)} .place.p3{background:var(--lblue);color:#fff}

/* статусы */
.badge{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:2px 9px;border-radius:999px;background:var(--sunken);color:var(--ink);white-space:nowrap}
.badge::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted)}
.badge.ok::before,.badge.done::before{background:var(--hi)} .badge.bad::before,.badge.failed::before{background:var(--lo)}
.badge.running::before{background:var(--mid)} .badge.queued::before{background:var(--lblue)}
.note{font-size:13px;color:var(--muted);border-left:3px solid var(--mid);padding-left:12px;max-width:80ch}
.err{color:var(--lo);font-weight:600;font-size:13px}
.okc{color:var(--hi);font-weight:700}
.progress{height:8px;border-radius:99px;background:var(--sunken);overflow:hidden}
.progress i{display:block;height:100%;background:var(--red);transition:width .4s}

/* шаги студента */
.steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;counter-reset:s;margin:0;padding:0;list-style:none}
.steps li{counter-increment:s;background:var(--surface);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:3px;font-size:13px;border:2px solid transparent}
.steps li::before{content:counter(s);width:24px;height:24px;border-radius:50%;background:var(--sunken);display:grid;place-items:center;font-weight:800;font-size:12px}
.steps li b{font-size:14px}
.steps li.done{border-color:var(--hi)} .steps li.done::before{content:"✓";background:var(--hi);color:#fff}
.steps li.now{border-color:var(--red)} .steps li.now::before{background:var(--red);color:#fff}

/* графики и доска */
.chart svg{width:100%;height:auto;display:block}
.chart text{fill:var(--muted);font-size:11px;font-family:var(--body)}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:12px;height:3px;border-radius:2px;display:inline-block}
.board{background:var(--board);border-radius:12px;border:1px solid var(--line);touch-action:manipulation}
.board svg{display:block;width:100%;height:auto}
.proj .kpi .v{font-size:40px}
.proj table{font-size:20px} .proj th{font-size:15px} .proj td,.proj th{padding:12px 16px}
.proj h1{font-size:clamp(30px,5vw,56px)}
.md h1{font-size:30px} .md h2{margin-top:18px} .md h3{margin-top:10px} .md p{margin:8px 0} .md ul,.md ol{margin:6px 0;padding-left:22px}
.md code{background:var(--sunken);padding:1px 6px;border-radius:5px;font-size:13px}
.md pre{background:var(--sunken);padding:12px 14px;border-radius:12px;overflow-x:auto} .md pre code{background:none;padding:0}
.md table{margin:10px 0} .md blockquote{margin:8px 0;border-left:3px solid var(--line);padding-left:12px;color:var(--muted)}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:100px;font-size:14px;font-weight:600;z-index:50;max-width:90vw}
footer{font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:14px}
@media (max-width:560px){.panel{padding:14px} th,td{padding:7px 8px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* сравнение «до / после» и слепое голосование */
.cmp{display:flex;flex-direction:column;gap:8px;max-width:760px}
.cmp-stage{position:relative;line-height:0;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:var(--sunken)}
.cmp-stage img{display:block;width:100%;height:auto;image-rendering:auto;user-select:none}
.cmp-stage img+img{position:absolute;inset:0}
.cmp-line{position:absolute;top:0;bottom:0;width:2px;background:var(--red);transform:translateX(-1px);pointer-events:none}
.cmp input[type=range]{width:100%;accent-color:var(--accent)}
.cmp-labels{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}
.vote-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.vote-grid figure{margin:0;display:flex;flex-direction:column;gap:8px}
.vote-grid img,.vote-orig img{width:100%;height:auto;display:block;border-radius:12px;border:1px solid var(--line);background:var(--sunken)}
.vote-orig{max-width:520px}
.vote-btns{display:flex;flex-wrap:wrap;gap:10px}
.vote-btns .btn{flex:1 1 140px;min-height:48px}
.vote-btns .tie{background:var(--sunken);color:var(--ink);border:1px solid var(--line)}
.vote-zoom{display:flex;gap:10px;align-items:center;font-size:12px;color:var(--muted)}
@media (max-width:640px){.vote-grid{grid-template-columns:1fr}}
@media (max-width:640px){.vote-orig{max-width:260px}}
