/* Cabinet styles (app.webspeed.pro). Tokens are a copy of sites/app.webspeed.pro/src/styles/tokens.css
   (subset of the apex Birch theme) — keep the palette in sync if the apex theme changes. */

/* ── Display font ─── Self-hosted latin-subset variable Space Grotesk (~17 KB). */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-subset.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SG Fallback';
  src: local('Segoe UI'), local('Arial'), local('Helvetica Neue');
  ascent-override: 98.4%;
  descent-override: 29.2%;
  line-gap-override: 0%;
  size-adjust: 106%;
}

:root {
  --bg: #f4f3ee;
  --bg-soft: #ecebe3;
  --bg-card: #ffffff;
  --border: #e3e2d9;
  --border-strong: #d3d2c7;
  --text: #141414;
  --text-soft: #4a4a44;
  --text-faint: #84847a;
  --brand: #1e50ff;
  --brand-ink: #1e50ff;
  --brand-soft: #e6ecff;
  --accent-2: #ffe14d;
  --accent-2-ink: #0c0c0e;
  --good: #12b76a;
  --bad: #f04438;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "SG Fallback", var(--font);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(13, 21, 38, 0.06);
  --shadow: 0 1px 2px rgba(13, 21, 38, 0.05), 0 10px 28px -6px rgba(13, 21, 38, 0.09);
  --shadow-lg: 0 2px 6px rgba(13, 21, 38, 0.05), 0 26px 56px -14px rgba(13, 21, 38, 0.20);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --bg-soft: #111113;
    --bg-card: #161619;
    --border: #26262b;
    --border-strong: #34343b;
    --text: #f4f4f1;
    --text-soft: #b7b7b1;
    --text-faint: #86867d;
    --brand: #1e50ff;
    --brand-ink: #7aa0ff;
    --brand-soft: #1a2340;
    --accent-2: #ffe14d;
    --accent-2-ink: #0c0c0e;
    --good: #3ad07a;
    --bad: #ff6a5e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 30px 60px -16px rgba(0, 0, 0, 0.6);
  }
}

/* ── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.028em;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 5px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Cabinet layout ─── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; flex-wrap: wrap; }
.who { color: var(--text-faint); overflow-wrap: anywhere; }
.inline { display: inline; }
.main { max-width: 1040px; margin: 0 auto; padding: 40px 16px 64px; }
.page h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 24px; }
.page h2 { font-size: 1.25rem; margin: 32px 0 12px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.card h1 { font-size: 1.6rem; margin-bottom: 12px; }
.card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.narrow { max-width: 460px; margin: 6vh auto 0; }
.note { color: var(--text-soft); font-size: .9rem; margin-top: 14px; }
.funnel { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 24px; color: var(--text-soft); }
.funnel b { color: var(--text); }
.lead { color: var(--text-soft); margin-bottom: 20px; }
.empty { text-align: left; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 600; font-size: .92rem; }
input[type=email], input[type=text], input[type=url] { font: inherit; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); width: 100%; }
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.btn { font: inherit; font-weight: 600; display: inline-block; text-align: center; padding: 12px 18px; border-radius: var(--radius-sm); border: 0; background: var(--brand); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; }
.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { color: var(--text-faint); font-weight: 600; }
.page > .card + .card, .page > .card + form.card, .sites + .card { margin-top: 16px; }
.sites { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; flex-wrap: wrap; }
.site-host { font-weight: 600; font-size: 1.05rem; color: var(--text); overflow-wrap: anywhere; }
.badge { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--text-soft); white-space: nowrap; }
.badge--verified { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--text); }
.badge--taken { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--text); }
.row { display: flex; gap: 10px; margin-top: 8px; }
.row input { flex: 1; min-width: 0; }
.ok { color: var(--text); background: color-mix(in srgb, var(--good) 14%, transparent); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.dns { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 4px; }
.dns dt { color: var(--text-faint); font-size: .9rem; }
.dns dd { margin: 0; min-width: 0; }
.dns code { word-break: break-all; }
.page .card h2 { margin-top: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.card form { margin-top: 16px; }
.btn--ghost { background: var(--brand-soft); color: var(--brand-ink); }
.back { margin: 0 0 8px; }
.remove { margin-top: 24px; }
.link.danger { color: var(--bad); }
.mlist { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 8px; }
.mlist li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mscore { font-variant-numeric: tabular-nums; font-weight: 600; }
.mscore small { color: var(--text-faint); font-weight: 400; }
.bar { width: 100%; height: 10px; accent-color: var(--brand); }
.scores { border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.scores th, .scores td { padding: 10px 18px 10px 0; text-align: left; border-bottom: 1px solid var(--border); }
.scores thead th { color: var(--text-faint); font-weight: 600; font-size: .9rem; }
.scores td { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.scores td.fast { color: var(--brand-ink); }
.pg { border-top: 1px solid var(--border); padding: 16px 0 6px; }
.pg-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.pg-url { font-weight: 600; overflow-wrap: anywhere; margin-right: auto; }
.link.muted { color: var(--text-faint); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 6px 0 10px; }
.chart { margin: 0; }
.chart figcaption { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: .9rem; margin-bottom: 4px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-orig { stroke: var(--text-faint); }
.chart .ln-fast { stroke: var(--brand-ink); }
.chart .band { stroke: none; }
.chart .dot-orig { fill: var(--text-faint); }
.chart .thr { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 4 4; }
.crux { border-top: 1px solid var(--border); padding: 16px 0 6px; }
.crux h3 { font-size: 1rem; margin: 0 0 4px; }
.chart .tick { fill: var(--text-faint); font-size: 10px; dominant-baseline: middle; font-variant-numeric: tabular-nums; }
.chart .dot-fast { fill: var(--brand-ink); }
.chart .band-orig { fill: var(--text-faint); opacity: .15; }
.chart .band-fast { fill: var(--brand-ink); opacity: .15; }
.k::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.k-orig::before { background: var(--text-faint); }
.k-fast::before { background: var(--brand-ink); }
.k { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.axis { display: flex; justify-content: space-between; color: var(--text-faint); font-size: .8rem; margin: 2px 0 0; }
.add-page { margin-top: 14px; }
@media (max-width: 560px) { .row { flex-direction: column; } .site-row { padding: 16px; } .who { display: none; } .top { flex-wrap: wrap; } }
@media (max-width: 560px) { .card { padding: 22px; } .top { padding: 12px 16px; } }

/* ── Сайдбар (15.11) ── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg-card); border-right: 1px solid var(--border); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 0 8px; }
.side-nav { flex: 1; }
.side-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 18px 8px 6px; }
.side-h:first-child { margin-top: 0; }
.side-sites, .side-sub { list-style: none; margin: 0; padding: 0; }
.side-site, .side-add, .side-sub a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--text); font-size: .95rem; overflow-wrap: anywhere; }
.side-site:hover, .side-add:hover, .side-sub a:hover { background: var(--bg-soft); text-decoration: none; }
.side-site.is-open { font-weight: 600; }
.side-sub { margin: 2px 0 6px 18px; border-left: 1px solid var(--border); }
.side-sub a { color: var(--text-soft); padding: 5px 10px; font-size: .9rem; }
.side-sub a[aria-current], .side-site[aria-current], .side-add[aria-current] { background: var(--brand-soft); color: var(--brand-ink); }
.side-add { color: var(--brand); }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); }
.sdot--verified { background: var(--good); }
.side-foot { border-top: 1px solid var(--border); padding: 14px 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.shell .main { margin: 0; max-width: 1000px; width: 100%; padding: 36px 32px 64px; }
.eyebrow { color: var(--text-faint); font-size: .9rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.card + .card { margin-top: 16px; }
.card > .crux:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; gap: 10px; }
  .side { position: relative; }
  .side-foot { position: absolute; top: 14px; right: 16px; border: 0; padding: 0; }
  .side-foot .who { display: none; }
  /* На телефоне сайдбар — две строки над страницей, а не экран меню: сайты чипами, разделы
     открытого сайта — лентой вкладок. */
  .side .logo { padding: 0; }
  .side-h { display: none; }
  .side-sites { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-sites > li { display: contents; }
  .side-site, .side-add { padding: 5px 10px; font-size: .9rem; border: 1px solid var(--border); border-radius: 999px; }
  .side-sub { order: 99; flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; margin: 6px 0 0; border-left: 0; }
  .side-sub a { white-space: nowrap; border-radius: 999px; }
  .shell .main { padding: 24px 16px 48px; }
}
.own-h { font-size: 1rem; margin: 26px 0 6px; padding-top: 18px; border-top: 1px solid var(--border); }
.own-h:first-of-type { margin-top: 8px; padding-top: 0; border-top: 0; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.toggle span { display: flex; flex-direction: column; gap: 3px; }
.toggle small { color: var(--text-soft); font-size: .9rem; }
.toggle .cost { color: var(--text-faint); }
.toggles-foot { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.code { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; font-size: .85rem; margin: 6px 0 0; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
