/* Общие стили сайта Credo. Токены — как у «Олимпиадника» и /materials; тема классом .dark на <html> */
:root{color-scheme:light;
  --bg:#ffffff;--bar:rgba(255,255,255,.82);--paper:#eef4f8;--fg:#1b2328;--muted:#5b6770;--line:#d9e4eb;
  --primary:#0098DB;--primary-hover:#0086c2;--primary-ink:#ffffff;--primary-soft:rgba(224,243,251,.75);--link:#0077ad;--accent:#0098DB;--accent-small:#0077ad;
  --table-head:#f3f7fa}
html.dark{color-scheme:dark;
  --bg:#131518;--bar:rgba(19,21,24,.82);--paper:#1a1d21;--fg:#e8ecef;--muted:#a2acb4;--line:#2a2f35;
  --primary-soft:rgba(0,152,219,.14);--link:#5cc3f0;--accent:#33b0e6;--accent-small:#5cc3f0;
  --table-head:#1c2024}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:'Montserrat',Arial,sans-serif;color:var(--fg);background:var(--bg);line-height:1.45;-webkit-font-smoothing:antialiased;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
img{display:block;max-width:100%}
a{color:inherit}
.wrap{max-width:1120px;margin:0 auto;padding:0 20px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}

/* шапка */
.top{position:sticky;top:0;z-index:50;border-bottom:1px solid var(--line);background:var(--bar);-webkit-backdrop-filter:saturate(1.4) blur(12px);backdrop-filter:saturate(1.4) blur(12px)}
.top .wrap{display:flex;align-items:center;justify-content:space-between;height:60px}
.home{display:inline-flex;align-items:center}
.logo{height:26px;width:auto}
.logo-d,html.dark .logo-l{display:none}
html.dark .logo-d{display:block}
.theme{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;color:var(--muted);cursor:pointer;border-radius:12px}
.theme:hover{color:var(--fg);background:var(--paper)}
.theme .sun,html.dark .theme .moon{display:none}
html.dark .theme .sun{display:block}

/* документ */
.doc{max-width:780px;margin:0 auto;padding:36px 20px 72px;font-size:16px;line-height:1.7;overflow-wrap:break-word}
.crumbs{font-size:13px;font-weight:600;color:var(--muted);margin-bottom:18px}
.crumbs a{color:var(--muted);text-decoration:none}
.crumbs a:hover{color:var(--accent)}
.doc h1{font-size:30px;line-height:1.15;font-weight:800;letter-spacing:-.015em;margin:0 0 6px;text-wrap:balance}
.doc h1+h2{margin-top:0;font-size:18px;font-weight:600;color:var(--muted)}
.doc h2{font-size:20px;line-height:1.3;font-weight:800;margin:40px 0 12px;scroll-margin-top:80px;text-wrap:balance}
.doc h3{font-size:17px;font-weight:700;margin:26px 0 8px}
.doc p{margin:0 0 12px}
.doc ul,.doc ol{margin:0 0 14px;padding-left:22px}
.doc li{margin:0 0 6px}
.doc li::marker{color:var(--accent)}
.doc hr{border:0;border-top:1px solid var(--line);margin:28px 0}
.doc a{color:var(--link);text-underline-offset:2px}
.doc strong{font-weight:700}
.doc blockquote{margin:0 0 14px;padding:12px 16px;background:var(--paper);border-left:3px solid var(--accent);border-radius:0 10px 10px 0}
.doc .table{overflow-x:auto;margin:0 0 18px;border:1px solid var(--line);border-radius:12px}
.doc table{border-collapse:collapse;width:100%;font-size:14px;line-height:1.5}
.doc th,.doc td{border-bottom:1px solid var(--line);padding:9px 12px;text-align:left;vertical-align:top}
.doc tr:last-child td{border-bottom:0}
.doc th{background:var(--table-head);font-weight:700}
.doc thead tr:has(th:empty:only-child),.doc thead:has(th:empty){display:none}
.doc td:first-child{font-weight:600;color:var(--muted);width:38%}

/* первый абзац «Редакция от…» — плашкой */
.doc .edition{background:var(--primary-soft);border-radius:14px;padding:14px 18px;margin:18px 0 8px;font-size:14.5px;line-height:1.6}
.doc .edition strong{font-weight:700}

/* оглавление длинных документов */
.toc{margin:20px 0 8px;border:1.5px solid var(--line);border-radius:16px}
.toc summary{cursor:pointer;padding:14px 18px;font-weight:800;font-size:15px;list-style:none;display:flex;justify-content:space-between;align-items:center}
.toc summary::-webkit-details-marker{display:none}
.toc summary::after{content:'';width:9px;height:9px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);margin:-4px 4px 0 0;transition:transform .15s}
.toc[open] summary::after{transform:rotate(-135deg);margin-top:4px}
.toc ol{list-style:none;margin:0;padding:0 18px 14px;columns:1;font-size:14.5px}
.toc li{margin:0;break-inside:avoid}
.toc a{display:block;padding:5px 0;color:var(--fg);text-decoration:none;font-weight:600}
.toc a:hover{color:var(--accent)}

/* сведения об организации */
.info section{border-top:1px solid var(--line);padding-top:4px}
.info section h2{margin-top:28px}

/* подвал */
.foot{color:var(--muted);background:var(--paper);border-top:1px solid var(--line);padding:44px 0 40px;font-size:14px}
.foot-grid{display:grid;gap:28px;grid-template-columns:1fr 1fr}
.foot-brand{grid-column:1/-1}
.foot b{display:block;color:var(--fg);font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;margin-bottom:12px}
.foot b.sub{margin-top:22px}
.foot a{display:block;color:var(--muted);text-decoration:none;margin:7px 0;font-weight:600}
.foot a:hover{color:var(--accent)}
.foot .logo{margin-bottom:16px}
.foot p{margin:0 0 10px;line-height:1.6;font-weight:500}
.foot .lic a{display:inline;margin:0;color:var(--fg);text-decoration:underline;text-underline-offset:2px}

@media (min-width:860px){
  .wrap{padding:0 40px}
  .doc{padding:48px 20px 96px;font-size:16.5px}
  .doc h1{font-size:38px}
  .toc ol{columns:2;column-gap:28px}
  .foot-grid{grid-template-columns:1.4fr 1fr 1fr 1fr 1fr}
  .foot-brand{grid-column:auto}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
