/* AllRight Tools — дизайн-система (input/ALLRIGHT_TOOLS_BRAND_STYLE.md) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.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-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #2451E8;
  --blue-hover: #193FC4;
  --blue-tint: #EEF3FF;
  --teal: #18CBB9;
  --teal-dark: #087F78;
  --ink: #172033;
  --muted: #5D687B;
  --border: #E1E7F0;
  --canvas: #F7F9FC;
  --surface: #FFFFFF;
  --danger: #C62828;
  --danger-tint: #FDECEC;
  --warn: #8A5A00;
  --warn-tint: #FFF6E0;
  --ok-tint: #E7F8F6;
  --code-bg: #FBFCFE;
  --focus: 0 0 0 3px rgba(36, 81, 232, .35);
  --r-card: 16px;
  --r-ctl: 12px;
  --r-badge: 8px;
  --shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 4px 12px rgba(23, 32, 51, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #5B7FFF;
    --blue-hover: #7D99FF;
    --blue-tint: #1B2547;
    --teal: #18CBB9;
    --teal-dark: #5FE0D2;
    --ink: #E8ECF4;
    --muted: #A3ADBF;
    --border: #2A3348;
    --canvas: #0F1522;
    --surface: #151C2B;
    --danger: #FF8A80;
    --danger-tint: #3A1C1C;
    --warn: #FFCF70;
    --warn-tint: #3A2F12;
    --ok-tint: #12302D;
    --code-bg: #111827;
    color-scheme: dark;
  }
}
  :root[data-theme="dark"] {
    --blue: #5B7FFF;
    --blue-hover: #7D99FF;
    --blue-tint: #1B2547;
    --teal: #18CBB9;
    --teal-dark: #5FE0D2;
    --ink: #E8ECF4;
    --muted: #A3ADBF;
    --border: #2A3348;
    --canvas: #0F1522;
    --surface: #151C2B;
    --danger: #FF8A80;
    --danger-tint: #3A1C1C;
    --warn: #FFCF70;
    --warn-tint: #3A2F12;
    --ok-tint: #12302D;
    --code-bg: #111827;
    color-scheme: dark;
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.55 var(--font);
  color: var(--ink);
  background: var(--surface);
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: 44px; line-height: 1.14; font-weight: 700; }
h2 { font-size: 30px; line-height: 1.23; font-weight: 680; }
h3 { font-size: 19px; line-height: 1.35; font-weight: 600; }
p { margin: 0 0 12px; }
code, kbd, pre, textarea.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: 18px; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { width: 28px; height: 28px; }
.header-search { flex: 1; max-width: 520px; position: relative; }
.nav-cats { position: relative; }
.nav-cats > button {
  font: 600 15px var(--font); color: var(--ink); background: none; border: 0; padding: 10px 12px; border-radius: var(--r-ctl); cursor: pointer;
}
.nav-cats > button:hover { background: var(--canvas); }
.nav-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 8px; list-style: none; margin: 0;
}
.nav-cats.open .nav-menu { display: block; }
.nav-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.nav-menu a:hover { background: var(--blue-tint); text-decoration: none; }

/* ---------- search ---------- */
.search-input {
  width: 100%; height: 44px; padding: 0 14px 0 42px; font: 400 15px var(--font); color: var(--ink);
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235D687B' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
  border: 1px solid var(--border); border-radius: var(--r-ctl);
}
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); background-color: var(--surface); }
.search-input.lg { height: 56px; font-size: 17px; border-radius: 14px; }
.search-results {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; z-index: 30; max-height: 70vh; overflow: auto;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--blue-tint); text-decoration: none; }
.search-results .r-name { font-weight: 600; }
.search-results .r-desc { display: block; font-size: 14px; color: var(--muted); }
.search-results mark { background: none; color: var(--blue); font-weight: 700; }
.search-results .r-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  font: 600 15px/1 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-ctl); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #C9D3E3; background: var(--canvas); text-decoration: none; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--canvas); }
.btn.done { color: var(--teal-dark); border-color: var(--teal); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- breadcrumbs & page head ---------- */
.breadcrumbs { font-size: 14px; color: var(--muted); padding: 20px 0 8px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.page-head { padding: 4px 0 20px; }
.page-head h1 { margin-bottom: 8px; }
.page-head .lead { font-size: 18px; color: var(--muted); max-width: 72ch; margin: 0; }

/* ---------- tool workspace ---------- */
.tool { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.tool-grid.single { grid-template-columns: 1fr; }
.pane { display: flex; flex-direction: column; min-width: 0; padding: 16px; }
.pane + .pane { border-left: 1px solid var(--border); }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; min-height: 36px; }
.pane-title { font-weight: 600; font-size: 15px; }
.pane-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.io {
  width: 100%; min-height: 320px; flex: 1; resize: vertical; padding: 12px 14px; font: 400 14px/1.6 var(--mono); color: var(--ink);
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-ctl); tab-size: 4; white-space: pre; overflow-wrap: normal; overflow: auto;
}
.io.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.io.prose { font-family: var(--font); font-size: 15px; white-space: pre-wrap; }
.io:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.io[readonly] { background: var(--canvas); }
.io.dragover { border-color: var(--teal); background: var(--ok-tint); }
.options { border-top: 1px solid var(--border); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.options .group { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.options label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.options .field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.options input[type="text"], .options input[type="number"], .options select {
  height: 36px; padding: 0 10px; font: 400 14px var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; min-width: 0;
}
.options input[type="number"] { width: 84px; }
.options input[type="text"] { width: 140px; }
.options input:focus, .options select:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.options input[type="checkbox"], .options input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented label { padding: 7px 12px; gap: 0; border-left: 1px solid var(--border); }
.segmented label:first-child { border-left: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.segmented label:has(input:focus-visible) { box-shadow: inset var(--focus); }
.tool-foot { border-top: 1px solid var(--border); padding: 10px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.stats b { color: var(--ink); font-weight: 600; }
.privacy-note::before { content: "🔒 "; }
.notice { margin: 0 16px 12px; padding: 10px 14px; border-radius: var(--r-ctl); font-size: 14px; display: none; }
.notice.show { display: block; }
.notice.error { background: var(--danger-tint); color: var(--danger); }
.notice.warn { background: var(--warn-tint); color: var(--warn); }
.notice.info { background: var(--blue-tint); color: var(--ink); }
.notice button { margin-left: 8px; }

/* ---------- content below tool ---------- */
.content { max-width: 820px; padding: 40px 0 8px; }
.content section { margin-bottom: 40px; }
.content h2 { font-size: 25px; }
.content ol, .content ul { padding-left: 22px; }
.content li { margin-bottom: 6px; }
.example { border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; margin-bottom: 12px; }
.example h3 { font-size: 16px; margin-bottom: 8px; }
.example pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; overflow: auto; margin: 0 0 10px; white-space: pre-wrap; }
.example .ex-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--ink); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%;
}
.card:hover { border-color: #C9D3E3; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transform: translateY(-1px); }
.card .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.card .ico svg { width: 22px; height: 22px; }
.card h3 { font-size: 17px; margin: 0 0 4px; }
.card p { font-size: 14px; color: var(--muted); margin: 0; }
.related { padding: 8px 0 40px; }
.related h2 { font-size: 25px; }

/* ---------- home ---------- */
.hero { padding: 64px 0 40px; background: linear-gradient(180deg, var(--blue-tint), transparent); }
.hero h1 { max-width: 16ch; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 60ch; margin-bottom: 24px; }
.hero .header-search { max-width: 640px; }
.section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 25px; margin: 0; }
.sister { display: flex; flex-wrap: wrap; gap: 12px; }
.sister a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-ctl); color: var(--ink); font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--canvas); margin-top: 48px; padding: 40px 0 32px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h3 { font-size: 14px; text-transform: none; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink); }
.site-footer .copy { margin-top: 24px; color: var(--muted); }

/* ---------- prose pages ---------- */
div.prose { max-width: 72ch; padding-bottom: 32px; }
div.prose h2 { font-size: 25px; margin-top: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  h1 { font-size: 32px; line-height: 1.18; }
  h2, .content h2, .section-head h2, .related h2 { font-size: 25px; line-height: 1.25; }
  h3 { font-size: 18px; }
  .site-header .container { gap: 12px; height: 60px; }
  .brand span { display: none; }
  .header-search { max-width: none; }
  .hero { padding: 40px 0 24px; }
  .io { min-height: 220px; }
  .btn { height: 44px; }
  .btn.sm { height: 40px; }
  .options { padding: 12px; }
  .options input[type="text"] { width: 120px; }
  .example .ex-cols { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .site-footer, .related, .pane-actions, .options { display: none; } }

/* --- fixes: сжатие колонок и перенос на узких экранах --- */
.tool-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tool-grid.single { grid-template-columns: minmax(0, 1fr); }
.pane-head { flex-wrap: wrap; }
.header-search { min-width: 0; }
.nav-cats { margin-left: auto; flex: none; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
@media (max-width: 900px) { .tool-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
  .nav-cats > button { padding: 10px 8px; }
  .pane { padding: 12px; }
  .pane-actions .btn.ghost { padding: 0 10px; }
  .options .field { flex-wrap: wrap; }
}

/* ---------- design pass 2 ---------- */
.nav-cats > button { display: inline-flex; align-items: center; gap: 4px; }
.nav-cats .chev { transition: transform .15s; }
.nav-cats.open .chev { transform: rotate(180deg); }
.nav-menu { min-width: 360px; }
.nav-menu a { display: flex; gap: 12px; align-items: flex-start; }
.nav-menu b { display: block; font-weight: 600; }
.nav-menu small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 400; }
.nm-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.nm-ico svg { width: 18px; height: 18px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.quick { margin: 14px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
/* карточки-примеры: обычный поток со «ступенчатым» сдвигом — длинные подписи локалей переносятся без наложения */
.hero-art { display: flex; flex-direction: column; gap: 14px; }
.task {
  position: relative; display: flex; align-items: center; gap: 12px; width: min(330px, calc(100% - 60px)); padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.task b { display: block; font-size: 15px; font-weight: 600; }
.task small { display: block; color: var(--muted); font-size: 13px; }
.task-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.task-ico svg { width: 20px; height: 20px; }
.task .check { margin-left: auto; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.task.t1 { margin-left: 0; }
.task.t2 { margin-left: 60px; }
.task.t3 { margin-left: 20px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.cat-card { border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px; background: var(--surface); display: flex; flex-direction: column; }
.cat-head { display: flex; gap: 12px; align-items: center; color: var(--ink); margin-bottom: 10px; }
.cat-head:hover { text-decoration: none; color: var(--blue); }
.cat-head h3 { margin: 0; font-size: 18px; }
.cat-head .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.cat-head .ico svg { width: 22px; height: 22px; }
.cat-card p { margin-bottom: 10px; }
.cat-card ul { list-style: none; margin: 0 0 8px; padding: 0; }
.cat-card li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 15px; }
.cat-card li:first-child { border-top: 0; }
.cat-all { margin-top: auto; }
.sister a { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px; min-width: 260px; }
.sister a:hover { text-decoration: none; border-color: #C9D3E3; }
.badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: var(--r-badge); background: var(--blue-tint); color: var(--blue); font-size: 13px; font-weight: 600; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { display: none; }
}
@media (max-width: 768px) {
  .nav-menu { position: fixed; left: 16px; right: 16px; top: 64px; min-width: 0; max-height: 75vh; overflow: auto; }
}

/* ---------- footer v2 ---------- */
.footer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 24px; }
.footer-top p { margin: 0; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 20px; }
.footer-cols h3 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.footer-cols h3 a { color: var(--ink); }
.footer-cols li { margin-bottom: 7px; }
.footer-cols a { color: var(--muted); }
.footer-cols a:hover { color: var(--blue); }
.footer-cols .footer-all { color: var(--blue); font-weight: 500; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-bottom a { color: var(--muted); }
.lang-switch { display: flex; flex-wrap: wrap; gap: 6px 14px; width: 100%; }
.lang-switch a[aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 768px) { .footer-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- shared tool patterns (запросы workers) ---------- */
#tool [hidden] { display: none !important; }
/* Options, свёрнутые на mobile: <details class="opt-more" open><summary>Options</summary>...</details> */
details.opt-more > summary { display: none; }
@media (max-width: 768px) {
  details.opt-more > summary { display: list-item; cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
}
/* Mobile: порядок ввод → настройки → результат (SITEWIDE §3) без изменения разметки */
@media (max-width: 900px) {
  .tool { display: flex; flex-direction: column; }
  .tool > * { order: 6; }
  .tool > .tool-grid { display: contents; }
  .tool > .tool-grid > .pane:first-child { order: 1; }
  .tool > .options, .tool > [data-options] { order: 2; border-top: 1px solid var(--border); }
  .tool > .tool-grid > .pane:nth-child(2) { order: 3; border-top: 1px solid var(--border); }
  .tool > .tool-grid > :nth-child(n+3) { order: 4; }
  .tool > .notice { order: 4; }
  .tool > .tool-foot { order: 9; }
}
.example .ex-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } @media (max-width: 768px) { .example .ex-cols { grid-template-columns: minmax(0, 1fr); } }
.example pre { overflow-wrap: anywhere; }
.example .ex-cols > div { min-width: 0; }
.segmented { position: relative; }

/* ---------- mega menu (12 категорий) ---------- */
@media (min-width: 769px) {
  .nav-menu { display: none; grid-template-columns: 1fr 1fr; gap: 2px 8px; min-width: 700px; max-height: calc(100vh - 90px); overflow: auto; }
  .nav-cats.open .nav-menu { display: grid; }
  .nav-menu small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- переключатель темы ---------- */
.theme-toggle { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--ink); border-radius: var(--r-ctl); cursor: pointer; margin-left: auto; }
.theme-toggle:hover { background: var(--canvas); }
.theme-toggle svg { width: 20px; height: 20px; display: none; }
/* иконка показывает, НА что переключит: в светлой — луна, в тёмной — солнце */
:root:not([data-theme-effective="dark"]) .ti-dark, :root[data-theme-effective="dark"] .ti-light { display: block; }
.theme-toggle + .nav-cats { margin-left: 0; }
.logo-dark { display: none; }
:root[data-theme-effective="dark"] .logo-dark { display: inline; }
:root[data-theme-effective="dark"] .logo-light { display: none; }
