/* Справочник edu.usms.uz. Каркас, палитра и шрифты — как у API-документации
   (assets/api-docs/docs.css): слева разделы, справа инструкция. */

:root{
  color-scheme:light dark;
  --brand:#0C8A4B;
  --brand-strong:#0A7440;
  --ink:#12212F;
  --dim:#6B7A88;
  --line:#DCE3EA;
  --line-soft:#EDF1F5;
  --surface:#FFFFFF;
  --surface-2:#F6F8FA;
  --mint:#EAF6F0;
  --mint-strong:rgba(12,138,75,.12);
  --shell:66px;
  --r:10px;
  --r-lg:14px;
  --sans:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --display:'Space Grotesk',var(--sans);
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Consolas,monospace;
  font-family:var(--sans);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    --brand:#2E9E6B;--brand-strong:#3EB47C;--ink:#E7EDE9;--dim:#98A9A0;
    --line:#26332C;--line-soft:#1E2A24;--surface:#101A16;--surface-2:#18231E;
    --mint:rgba(46,158,107,.14);--mint-strong:rgba(46,158,107,.22);
  }
}
:root[data-theme=dark]{
  --brand:#2E9E6B;--brand-strong:#3EB47C;--ink:#E7EDE9;--dim:#98A9A0;
  --line:#26332C;--line-soft:#1E2A24;--surface:#101A16;--surface-2:#18231E;
  --mint:rgba(46,158,107,.14);--mint-strong:rgba(46,158,107,.22);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--surface);color:var(--ink);font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
::selection{background:var(--mint-strong)}
a{color:var(--brand);text-underline-offset:4px}
button,select{font:inherit}
button{cursor:pointer}
a:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--brand);outline-offset:3px;border-radius:4px}
.skip{position:absolute;top:-100px;left:16px;z-index:9;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:0 0 var(--r) var(--r);padding:12px 18px;font-weight:600;text-decoration:none}
.skip:focus{top:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

/* ---------- шапка ---------- */

.top{
  position:sticky;top:0;z-index:5;height:var(--shell);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:0 clamp(16px,2.4vw,28px);
  background:var(--surface);border-bottom:1px solid var(--line-soft);
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink)}
.brand img{height:30px;width:30px;display:block}
.brand span{
  font-family:var(--mono);font-size:9.5px;font-weight:600;text-transform:uppercase;letter-spacing:1.2px;
  color:var(--brand);border-left:1px solid var(--line);padding-left:12px;
}
.controls{display:flex;align-items:center;gap:12px}
select{
  height:38px;padding:0 10px;border:1px solid var(--line);border-radius:var(--r);
  background:var(--surface);color:var(--ink);font-size:14px;font-weight:500;
}
select:hover{border-color:var(--brand)}
.account{
  display:inline-flex;align-items:center;height:38px;padding:0 16px;
  border:1px solid var(--line);border-radius:var(--r);
  font-size:14px;font-weight:600;text-decoration:none;color:var(--ink);transition:border-color .15s,color .15s;
}
.account:hover{border-color:var(--brand);color:var(--brand)}
#menu{display:none;width:40px;height:38px;font-size:17px;line-height:1;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--r)}

/* ---------- каркас и меню ---------- */

.layout{display:grid;grid-template-columns:288px minmax(0,1fr);max-width:1400px;margin:0 auto}
aside{
  position:sticky;top:var(--shell);height:calc(100vh - var(--shell));overflow:auto;
  padding:26px 16px 32px;border-right:1px solid var(--line-soft);
}
.nav-caption{
  margin:0 0 10px;padding:0 10px;font-family:var(--mono);font-size:10px;font-weight:600;
  letter-spacing:1.1px;text-transform:uppercase;color:var(--dim);
}
nav a{
  display:block;padding:8px 10px;border-radius:8px;margin-bottom:2px;
  text-decoration:none;color:var(--dim);font-size:14px;font-weight:500;line-height:1.4;
  transition:background .12s,color .12s;
}
nav a:hover{background:var(--surface-2);color:var(--ink)}
nav a[aria-current=page]{background:var(--mint);color:var(--brand-strong);font-weight:600}
.nav-folder{margin-bottom:2px}
.nav-folder summary{
  display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:8px;cursor:pointer;list-style:none;
  font-size:14px;font-weight:600;color:var(--ink);transition:background .12s;
}
.nav-folder summary::-webkit-details-marker{display:none}
.nav-folder summary:hover{background:var(--surface-2)}
.nav-folder summary:before{
  content:'';flex:none;width:7px;height:7px;
  border-right:1.6px solid var(--dim);border-bottom:1.6px solid var(--dim);
  transform:rotate(-45deg);transition:transform .15s;
}
.nav-folder[open]>summary:before{transform:rotate(45deg)}
.nav-folder>a{margin:2px 0 2px 14px;padding-left:12px;border-left:1px solid var(--line-soft);border-radius:0 8px 8px 0}
.nav-folder>a[aria-current=page]{border-left-color:var(--brand)}
.support{margin-top:26px;padding:18px 10px 0;border-top:1px solid var(--line-soft);display:grid;gap:6px;font-size:13.5px}
.support span{font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:1.1px;text-transform:uppercase;color:var(--dim)}
.support a{text-decoration:none;font-weight:500}
.support a:hover{text-decoration:underline}

/* ---------- инструкция ---------- */

main{min-width:0;outline:none;padding:40px clamp(20px,4vw,64px) 50px}
main>*{max-width:760px}
.eyebrow{
  display:inline-block;margin:0 0 16px;font-family:var(--mono);font-size:11px;font-weight:600;
  letter-spacing:.9px;text-transform:uppercase;color:var(--brand);background:var(--mint);padding:5px 12px;border-radius:20px;
}
h1{font-family:var(--display);font-weight:700;font-size:clamp(28px,3vw,38px);line-height:1.18;letter-spacing:-.5px;margin:0 0 18px;text-wrap:balance}
.lead{font-size:18px;line-height:1.6;color:var(--dim);margin:0 0 28px}
.empty{color:var(--dim)}
.note{margin:0 0 22px;padding:12px 16px;background:var(--mint);border-left:3px solid var(--brand);border-radius:0 var(--r) var(--r) 0;font-size:14.5px}

.body{font-size:16.5px;line-height:1.72;overflow-wrap:anywhere}
.body>*:first-child{margin-top:0}
.body p{margin:0 0 15px}
.body h4{font-family:var(--display);font-size:22px;font-weight:600;letter-spacing:-.3px;line-height:1.3;margin:34px 0 12px}
.body h5{font-family:var(--display);font-size:17px;font-weight:600;margin:24px 0 8px}
.body ul,.body ol{margin:0 0 16px;padding-left:24px}
.body li{margin:5px 0}
.body blockquote{margin:0 0 16px;padding:13px 17px;background:var(--mint);border-left:3px solid var(--brand);border-radius:0 var(--r) var(--r) 0}
.body code{font-family:var(--mono);font-size:.9em;color:var(--brand-strong);background:var(--surface-2);padding:1px 5px;border-radius:5px}
.body .rt-fig{margin:22px 0}
.body .rt-fig img{display:block;max-width:100%;height:auto;border:1px solid var(--line);border-radius:12px}
.body .rt-fig figcaption{font-size:13.5px;color:var(--dim);margin-top:7px}
.body .rt-fig-none{display:none}
.upd{margin:30px 0 0;font-size:13px;color:var(--dim)}

.pager{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:34px}
.pager a{
  display:block;padding:14px 16px;border:1px solid var(--line);border-radius:var(--r-lg);
  text-decoration:none;color:var(--ink);font-weight:600;font-size:15px;line-height:1.4;transition:border-color .15s,background .15s;
}
.pager a:hover{border-color:var(--brand);background:var(--surface-2)}
.pager small{display:block;margin-bottom:4px;font-family:var(--mono);font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:var(--dim)}
.pager .next{text-align:right;grid-column:2}

.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;max-width:none}
.card{padding:18px 20px;border:1px solid var(--line);border-radius:var(--r-lg)}
.card h2{font-family:var(--display);font-size:17px;font-weight:600;margin:0 0 10px}
.card ul{margin:0;padding:0;list-style:none;display:grid;gap:6px}
.card a{text-decoration:none;font-size:14.5px;font-weight:500}
.card a:hover{text-decoration:underline}

.foot{margin-top:56px;padding-top:20px;border-top:1px solid var(--line-soft);font-size:14px;color:var(--dim);display:grid;gap:4px}
.foot b{color:var(--ink)}

/* ---------- адаптив ---------- */

@media (max-width:1180px){
  .layout{grid-template-columns:250px minmax(0,1fr)}
  main{padding:32px 28px 44px}
}
@media (max-width:760px){
  .top{padding:0 14px;gap:8px}
  .brand span{display:none}
  .controls{gap:8px}
  select{max-width:128px;font-size:13.5px;height:40px}
  .account{font-size:13px;padding:0 12px;height:40px}
  #menu{display:block;width:44px;height:44px}
  .layout{display:block}
  aside{
    display:none;position:fixed;left:0;top:var(--shell);bottom:0;width:min(300px,88vw);height:auto;z-index:4;
    background:var(--surface);border-right:1px solid var(--line);box-shadow:18px 0 40px rgba(18,33,47,.16);
  }
  aside.open{display:block}
  main{padding:26px 16px 36px}
  .lead{font-size:16.5px}
  .body{font-size:16px}
  .pager{grid-template-columns:1fr}
  .pager .next{grid-column:1}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{transition:none!important}
}

/* ---------- переключатель темы (assets/api-docs/theme.js) ---------- */

.theme-btn{
  display:inline-grid;place-items:center;flex:none;width:38px;height:38px;padding:0;
  border:1px solid var(--line);border-radius:var(--r);background:var(--surface);color:var(--ink);
  transition:border-color .15s,color .15s;
}
.theme-btn:hover{border-color:var(--brand);color:var(--brand)}
.theme-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-btn svg path:only-child{fill:currentColor;stroke:none}
@media (max-width:760px){.theme-btn{width:40px;height:40px}}
.account{white-space:nowrap}
@media (max-width:480px){
  .top{padding:0 10px;gap:6px}
  .controls{gap:6px}
  select{max-width:112px;padding:0 6px}
  .theme-btn,#menu{width:38px;height:40px}
  .account{padding:0 10px;font-size:12.5px}
}

/* «Нужна помощь?» в меню: иконки вместо подписей */
.support-icons{display:flex;gap:8px;margin-top:4px}
.support-icons a{
  display:grid;place-items:center;width:40px;height:40px;border-radius:50%;
  border:1px solid var(--line);color:var(--brand);background:var(--surface);
  transition:border-color .15s,background .15s,color .15s;
}
.support-icons a:hover{border-color:var(--brand);background:var(--mint);text-decoration:none}
.support-icons svg{width:19px;height:19px;fill:currentColor}
.support-icons svg.stroke{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
