/* ============================================================
   AW Trading — mockups, third edition ("shadcn direction")
   Neutral zinc palette, hairline borders, light + dark themes.
   Fonts: Geist / Geist Mono (Google Fonts) with system fallbacks.
   ============================================================ */

:root {
  --bg: #ffffff;
  --fg: #09090b;
  --card: #ffffff;
  --card-fg: #09090b;
  --muted: #f4f4f5;
  --muted-fg: #71717a;
  --subtle-fg: #a1a1aa;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --primary: #18181b;
  --primary-fg: #fafafa;
  --accent: #f4f4f5;
  --accent-fg: #18181b;
  --ring: #a1a1aa;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --star: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.08);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --header-h: 57px;
}

[data-theme="dark"] {
  --bg: #09090b;
  --fg: #fafafa;
  --card: #0f0f11;
  --card-fg: #fafafa;
  --muted: #18181b;
  --muted-fg: #a1a1aa;
  --subtle-fg: #71717a;
  --border: #27272a;
  --input: #27272a;
  --primary: #fafafa;
  --primary-fg: #18181b;
  --accent: #27272a;
  --accent-fg: #fafafa;
  --ring: #52525b;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --star: #fbbf24;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--fg); color: var(--bg); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px; height: var(--header-h);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.logo-suffix { color: var(--muted-fg); font-weight: 400; }

/* Language switcher */
.lang { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; font-family: var(--font-mono); }
.lang a { padding: 4px 7px; border-radius: 6px; color: var(--subtle-fg); transition: color .15s, background .15s; }
.lang a:hover { color: var(--fg); }
.lang a.on { color: var(--fg); background: var(--accent); }

.hdr-divider { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }

.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--muted-fg); transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--fg); }
.main-nav a.active { color: var(--fg); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted-fg);
  transition: color .15s, background .15s;
}
.theme-toggle:hover { color: var(--fg); background: var(--accent); }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.menu-btn { display: none; width: 34px; height: 34px; border-radius: var(--radius-sm); place-items: center; color: var(--muted-fg); }
.menu-btn:hover { color: var(--fg); background: var(--accent); }

.mobile-nav { display: none; border-bottom: 1px solid var(--border); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 24px; font-size: 15px; color: var(--muted-fg); border-top: 1px solid var(--border); }
.mobile-nav a:first-child { border-top: 0; }
.mobile-nav a:hover { color: var(--fg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: .88; }
.btn-outline { border-color: var(--border); background: var(--bg); }
.btn-outline:hover { background: var(--accent); }
.btn-ghost { color: var(--muted-fg); }
.btn-ghost:hover { color: var(--fg); background: var(--accent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Badges / chips ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1;
  border: 1px solid transparent;
}
.badge-default { background: var(--primary); color: var(--primary-fg); }
.badge-secondary { background: var(--muted); color: var(--fg); }
.badge-outline { border-color: var(--border); color: var(--muted-fg); }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.kbd {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--muted); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
  white-space: nowrap;
}

code.param {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 1.5px 6px; white-space: nowrap;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-pad { padding: 22px; }
a.card { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--ring); box-shadow: var(--shadow-md); }

/* ---------- Hero ---------- */

.hero { padding: 88px 0 64px; text-align: center; position: relative; }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
}
.announce {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px 5px 7px; font-size: 13px; color: var(--muted-fg);
  background: var(--bg);
  transition: border-color .15s, color .15s;
  margin-bottom: 28px;
}
.announce:hover { border-color: var(--ring); color: var(--fg); }
.announce .badge { height: 20px; font-size: 11px; }

h1.display {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06; letter-spacing: -0.035em; font-weight: 700;
  max-width: 800px; margin: 0 auto;
}
h1.display .dim { color: var(--muted-fg); }
.hero-sub {
  max-width: 620px; margin: 22px auto 0;
  font-size: 17px; color: var(--muted-fg); line-height: 1.65;
}
.hero-cta { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Stats strip */
.stats {
  margin: 72px auto 0; max-width: 900px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); overflow: hidden;
}
.stat { padding: 22px 16px; text-align: center; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-mono); }
.stat span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted-fg); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg);
  margin-bottom: 12px;
}
h2.section-title { font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -0.025em; line-height: 1.15; font-weight: 700; }
.section-sub { margin-top: 12px; color: var(--muted-fg); font-size: 15.5px; }

/* ---------- Product cards ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.product-card { display: flex; flex-direction: column; }
.product-card .card-pad { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.product-thumb {
  aspect-ratio: 16 / 8; background: var(--muted);
  border-bottom: 1px solid var(--border);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.product-thumb svg { width: 100%; height: 100%; }
.product-card h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.product-card p { font-size: 14px; color: var(--muted-fg); flex: 1; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.price { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.price small { color: var(--muted-fg); font-weight: 400; font-size: 12px; }

.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-fg); }
.rating .stars { color: var(--star); letter-spacing: 1px; font-size: 12px; }
.rating b { color: var(--fg); font-weight: 600; }

/* ---------- Category tiles ---------- */

.cat-tile { padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.cat-tile .cat-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--muted); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--fg);
}
.cat-tile h3 { font-size: 16px; font-weight: 600; }
.cat-tile p { font-size: 13.5px; color: var(--muted-fg); }
.cat-tile .link { font-size: 13.5px; font-weight: 500; margin-top: auto; }

/* ---------- Docs-first band ---------- */

.band {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card);
  display: grid; grid-template-columns: 1.1fr 0.9fr; overflow: hidden;
}
.band-copy { padding: 44px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.band-copy h2 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
.band-copy p { color: var(--muted-fg); }
.band-visual {
  border-left: 1px solid var(--border); background: var(--muted);
  padding: 36px 0 0 36px; overflow: hidden; display: flex; align-items: flex-end;
}
.band-visual .mini-doc {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px 0 0 0; border-right: 0; border-bottom: 0;
  box-shadow: var(--shadow-md);
  width: 100%; height: 100%; min-height: 240px; padding: 24px 0 0 24px;
}
.skeleton { border-radius: 4px; background: var(--muted); height: 10px; margin-bottom: 10px; }

/* ---------- Free strip ---------- */

.free-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.free-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card);
  padding: 8px 16px; font-size: 13.5px; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.free-chip:hover { border-color: var(--ring); }
.free-chip .tag { font-size: 11px; color: var(--muted-fg); font-family: var(--font-mono); }

/* ---------- CTA band ---------- */

.cta-band { text-align: center; padding: 80px 24px; }
.cta-band h2 { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.03em; }
.cta-band p { margin: 14px auto 0; max-width: 480px; color: var(--muted-fg); }
.cta-band .hero-cta { margin-top: 28px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { margin-top: 12px; font-size: 13.5px; color: var(--muted-fg); max-width: 280px; }
.footer-col h4 { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.footer-col a { display: block; padding: 4px 0; font-size: 13.5px; color: var(--muted-fg); }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted-fg);
}

/* ============================================================
   Docs / manuals hub
   ============================================================ */

.docs-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--border); }
.docs-hero h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.03em; }
.docs-hero p { margin-top: 12px; color: var(--muted-fg); max-width: 560px; }

.search-box {
  margin-top: 28px; max-width: 560px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--card); padding: 0 14px; height: 46px;
  color: var(--muted-fg); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:hover { border-color: var(--ring); }
.search-box input { flex: 1; border: 0; background: none; outline: none; color: var(--fg); font: inherit; }
.search-box .kbd { margin-left: auto; }

.doc-set { margin-bottom: 8px; }
.doc-set-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.doc-set-head h2 { font-size: 20px; letter-spacing: -0.015em; }
.doc-set-head .sub { font-size: 13.5px; color: var(--muted-fg); }

.doc-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.doc-card .doc-kind {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-fg);
  display: flex; align-items: center; justify-content: space-between;
}
.doc-card h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.doc-card p { font-size: 13.5px; color: var(--muted-fg); flex: 1; }
.doc-card .doc-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--subtle-fg); margin-top: 4px; }

.doc-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  transition: border-color .15s;
}
.doc-row:hover { border-color: var(--ring); }
.doc-row .doc-ic {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--radius-sm);
  background: var(--muted); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted-fg);
}
.doc-row b { font-size: 14.5px; font-weight: 600; display: block; }
.doc-row span.desc { font-size: 13px; color: var(--muted-fg); display: block; }
.doc-row .spacer { margin-left: auto; }
.doc-rows { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   Homepage — start-here paths, shelves, free pairs
   ============================================================ */

.path { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.path .path-k {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted-fg);
}
.path h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.path p { font-size: 13.5px; color: var(--muted-fg); flex: 1; }
.path .path-a { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; margin-top: 6px; }
.path .path-a svg { transition: transform .15s; }
.path:hover .path-a svg { transform: translateX(3px); }

.home-finder {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  gap: 56px; align-items: start;
}

.shelf { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.shelf-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.shelf-top .cnt { font-family: var(--font-mono); font-size: 11.5px; color: var(--subtle-fg); }
.shelf h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.shelf .desc { font-size: 13px; color: var(--muted-fg); }
.shelf-list { margin-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.shelf-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--border);
  color: color-mix(in srgb, var(--fg) 80%, var(--muted-fg));
}
.shelf-list a:last-child { border-bottom: 0; }
.shelf-list a:hover { color: var(--fg); }
.shelf-list em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--subtle-fg); white-space: nowrap; }
.shelf-list em.is-free { color: var(--ok); }

.more-row { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.more-row .hint { font-size: 13px; color: var(--muted-fg); }

.pairs { display: flex; flex-direction: column; gap: 10px; }
.pair {
  display: grid; grid-template-columns: 1fr auto 1.2fr auto; gap: 20px; align-items: center;
  padding: 16px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
}
.pair h3 { font-size: 14.5px; font-weight: 600; }
.pair p { font-size: 12.5px; color: var(--muted-fg); margin-top: 2px; }
.pair .pair-x { color: var(--subtle-fg); display: grid; place-items: center; }

@media (max-width: 1000px) {
  .home-finder { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr; gap: 10px; }
  .pair .pair-x { transform: rotate(90deg); justify-self: start; }
}

/* ============================================================
   Manuals finder — sticky search pane left, grouped list right
   ============================================================ */

.finder {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 56px; align-items: start; padding: 48px 0 72px;
}
.finder-side {
  position: sticky; top: calc(var(--header-h) + 28px);
  display: flex; flex-direction: column; gap: 18px;
}
.finder-side h1 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -0.03em; line-height: 1.1; }
.finder-side .sub { font-size: 14px; color: var(--muted-fg); }
.finder-count { font-size: 12.5px; color: var(--subtle-fg); font-family: var(--font-mono); margin-top: -8px; }
.home-finder .finder-count { margin-top: 10px; }

.seg-block { display: flex; flex-direction: column; gap: 6px; }
.seg-block > span { font-size: 12px; color: var(--muted-fg); font-weight: 500; }
.seg {
  display: inline-flex; padding: 4px; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--muted); width: fit-content;
}
.seg button {
  padding: 5px 13px; border-radius: 6px; font-size: 13px;
  color: var(--muted-fg); font-weight: 500;
  border: 1px solid transparent;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] {
  background: var(--bg); color: var(--fg);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.side-note { font-size: 13px; color: var(--muted-fg); border-top: 1px solid var(--border); padding-top: 16px; }
.side-note a { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--subtle-fg); }
.side-note a:hover { text-decoration-color: var(--fg); }

.m-group { margin-bottom: 44px; }
.m-group > h2 { font-size: 18px; letter-spacing: -0.015em; }
.m-group > .g-sub { font-size: 13.5px; color: var(--muted-fg); margin: 4px 0 16px; }
.m-plat { font-family: var(--font-mono); font-size: 11.5px; color: var(--subtle-fg); white-space: nowrap; }
.m-open { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted-fg); white-space: nowrap; }
.doc-row:hover .m-open { color: var(--fg); }
.m-empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--muted-fg); font-size: 14px;
}
.m-empty b { color: var(--fg); display: block; margin-bottom: 4px; }
.hide { display: none !important; }

/* Forms */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea {
  border: 1px solid var(--input); background: var(--bg);
  border-radius: var(--radius-sm); padding: 9px 12px;
  font: inherit; font-size: 14px; color: var(--fg); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--subtle-fg); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

/* ============================================================
   Single manual — two-pane layout (Contents card + article)
   ============================================================ */

.manual-layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  gap: 56px; align-items: start;
  padding: 48px 0 96px;
}

.toc-card {
  position: sticky; top: calc(var(--header-h) + 28px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 20px;
}
.toc-card .toc-title {
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.toc-list { list-style: none; position: relative; }
.toc-list::before {
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.toc-progress {
  position: absolute; left: 5px; top: 10px;
  width: 2px; height: 0; background: var(--fg); border-radius: 2px;
  transition: height .2s ease;
  z-index: 1;
}
.toc-list a {
  position: relative; display: flex; align-items: baseline; gap: 14px;
  padding: 6px 0; font-size: 13px; color: var(--muted-fg); line-height: 1.45;
  transition: color .15s;
}
.toc-list a:hover { color: var(--fg); }
.toc-list a .toc-dot {
  flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--border);
  position: relative; z-index: 2; top: 1px;
  transition: border-color .15s, background .15s;
}
.toc-list a.passed .toc-dot { border-color: var(--fg); }
.toc-list a.active { color: var(--fg); font-weight: 600; }
.toc-list a.active .toc-dot { border-color: var(--fg); background: var(--fg); }

.toc-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.toc-foot a { font-size: 12.5px; color: var(--muted-fg); display: flex; align-items: center; gap: 8px; }
.toc-foot a:hover { color: var(--fg); }

/* Breadcrumbs */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-fg); flex-wrap: wrap; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--subtle-fg); }
.crumbs .here { color: var(--fg); font-weight: 500; }

/* Article */
.article { max-width: 760px; }
.article-head { margin: 18px 0 8px; }
.article-head h1 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.03em; line-height: 1.12; }
.article-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted-fg);
}
.article-meta .meta-item { display: flex; align-items: center; gap: 7px; }
.article-meta .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: var(--primary-fg);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
  font-family: var(--font-mono);
}

/* Series switcher */
.series {
  display: flex; gap: 6px; margin: 24px 0 8px; padding: 5px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--muted); width: fit-content; max-width: 100%; flex-wrap: wrap;
}
.series a {
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  color: var(--muted-fg); font-weight: 500; white-space: nowrap;
}
.series a:hover { color: var(--fg); }
.series a.current { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }

/* Prose */
.prose { padding-top: 12px; }
.prose h2 {
  font-size: 23px; letter-spacing: -0.02em; font-weight: 700;
  margin: 44px 0 14px; padding-top: 8px;
}
.prose h3 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; letter-spacing: -0.01em; }
.prose p { margin: 12px 0; color: color-mix(in srgb, var(--fg) 86%, var(--muted-fg)); }
.prose ul, .prose ol { margin: 12px 0 12px 22px; color: color-mix(in srgb, var(--fg) 86%, var(--muted-fg)); }
.prose li { margin: 6px 0; }
.prose b, .prose strong { color: var(--fg); }
.prose a.link { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--subtle-fg); }
.prose a.link:hover { text-decoration-color: var(--fg); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* Callouts */
.callout {
  display: flex; gap: 12px; margin: 20px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-size: 14px; background: var(--card);
}
.callout .callout-ic { flex: 0 0 auto; margin-top: 1px; }
.callout p { margin: 0; font-size: 14px; }
.callout b { display: block; margin-bottom: 2px; font-size: 13.5px; }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.callout-warn .callout-ic { color: var(--warn); }
.callout-info .callout-ic { color: var(--muted-fg); }
.callout-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.callout-ok .callout-ic { color: var(--ok); }

/* Steps */
.steps { list-style: none; margin: 20px 0; counter-reset: step; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 22px 44px; margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--muted); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; font-family: var(--font-mono);
}
.steps > li::after {
  content: ""; position: absolute; left: 13px; top: 31px; bottom: 4px;
  width: 1px; background: var(--border);
}
.steps > li:last-child::after { display: none; }
.steps > li > b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.steps > li > p { margin: 2px 0 0; font-size: 14px; color: var(--muted-fg); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 600; font-size: 12.5px;
  background: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: color-mix(in srgb, var(--fg) 86%, var(--muted-fg)); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { white-space: nowrap; }

/* Formula chips */
.formula {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0;
  overflow-x: auto; white-space: nowrap;
}

/* Next / related cards inside article */
.next-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.next-card { padding: 16px 18px; display: block; }
.next-card .nk { font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted-fg); }
.next-card b { display: block; margin-top: 5px; font-size: 14.5px; }
.next-card span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted-fg); }

/* Feedback footer of article */
.article-foot {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted-fg);
}
.article-foot .btns { display: flex; gap: 8px; }

/* ============================================================
   Product page
   ============================================================ */

.product-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px; align-items: start; padding: 40px 0 80px;
}
.product-head h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.03em; line-height: 1.1; margin-top: 14px; }
.product-head .lede { margin-top: 16px; font-size: 16.5px; color: var(--muted-fg); max-width: 620px; line-height: 1.65; }
.head-badges { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; align-items: center; }

.buy-card { position: sticky; top: calc(var(--header-h) + 28px); }
.buy-card .card-pad { display: flex; flex-direction: column; gap: 14px; }
.buy-price { display: flex; align-items: baseline; gap: 10px; }
.buy-price b { font-size: 32px; letter-spacing: -0.02em; font-family: var(--font-mono); }
.buy-price span { color: var(--muted-fg); font-size: 13.5px; }
.buy-alt { font-size: 13px; color: var(--muted-fg); margin-top: -6px; }
.buy-note {
  font-size: 12.5px; color: var(--muted-fg); line-height: 1.55;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.buy-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.buy-list li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted-fg); }
.buy-list .ck { color: var(--ok); flex: 0 0 auto; margin-top: 3px; }

.spec-list { list-style: none; font-size: 13.5px; }
.spec-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.spec-list li:last-child { border-bottom: 0; }
.spec-list .k { color: var(--muted-fg); }
.spec-list .v { font-weight: 500; text-align: right; }

/* Feature grid on product page */
.feature { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.feature .f-ic {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--muted); border: 1px solid var(--border);
  display: grid; place-items: center; margin-bottom: 4px;
}
.feature h3 { font-size: 14.5px; font-weight: 600; }
.feature p { font-size: 13.5px; color: var(--muted-fg); }

/* FAQ */
.faq { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  font-size: 14.5px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { transition: transform .2s; color: var(--muted-fg); flex: 0 0 auto; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .faq-body { padding: 0 20px 16px; font-size: 14px; color: var(--muted-fg); max-width: 640px; }

/* ---------- Figures: product shots and manual illustrations ----------
   Картинки панелей отрисованы генератором (Advisors/MT5/AW Recovery EA/
   marketing/render_site.py) по реплике, снятой с исходников 4.20. Кадр чарта —
   настоящий скриншот карточки MQL5. Подпись живёт в HTML, а не в пикселях:
   RU-версия переводится без перерендера.                                     */
.figure { margin: 26px 0; }
.figure > img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--muted);
}
.figure figcaption {
  margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--muted-fg);
}
.figure figcaption b { color: var(--fg); font-weight: 600; }
/* тёмный кадр панели на светлой теме не должен «висеть» без опоры */
.figure > img[src*="panel-"] { border-color: color-mix(in srgb, var(--fg) 14%, var(--border)); }

/* Панель слева, карточки справа — раскладка блока «три панели» */
.panel-band {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px; align-items: start;
}
.panel-band .figure { margin: 0; }
.panel-cards { display: grid; gap: 14px; }

/* ---------- Product identity: знак рядом с названием товара ----------
   В шапке сайта круглый знак убран (дублирует вордмарк при 30px), здесь он
   работает как иконка товара — размер тот, где знак читается.               */
.product-id { display: flex; gap: 18px; align-items: flex-start; }
.product-id > div { min-width: 0; }
.product-mark {
  flex: 0 0 auto; width: 58px; height: 58px; margin-top: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--fg);
  display: grid; place-items: center;
}
.product-mark svg { display: block; width: 34px; height: 34px; }

/* ============================================================
   Catalog rows (products.html) and product logos in finder rows
   ============================================================ */

.p-logo {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden; background: #fff;
}
.p-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-ext { gap: 10px; }
.m-ext .m-ext-k { font-family: var(--font-mono); font-size: 11px; color: var(--subtle-fg); }
.m-ext a { display: inline-flex; align-items: center; gap: 3px; color: var(--muted-fg); }
.m-ext a:hover { color: var(--fg); }
.shelf-top a.cnt:hover { color: var(--fg); }

.p-row .p-main { min-width: 0; }
.p-row .p-name { display: inline-flex; align-items: center; gap: 4px; }
.p-row .p-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.p-price { font-family: var(--font-mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.p-rate { font-family: var(--font-mono); font-size: 11.5px; color: var(--subtle-fg); white-space: nowrap; min-width: 92px; text-align: right; }
.p-links { display: flex; gap: 6px; flex: 0 0 auto; }
.p-links .btn { gap: 4px; padding: 0 10px; }

@media (max-width: 760px) {
  .p-row { flex-wrap: wrap; }
  .p-row .p-rate { min-width: 0; text-align: left; }
  .p-row .p-links { width: 100%; }
  .p-links .btn { flex: 1; }
  .m-ext .m-ext-k { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .finder { grid-template-columns: 1fr; gap: 32px; }
  .finder-side { position: static; }
  .manual-layout { grid-template-columns: 1fr; gap: 28px; }
  .toc-card { position: static; }
  .product-layout { grid-template-columns: 1fr; gap: 32px; }
  .buy-card { position: static; max-width: 480px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .band { grid-template-columns: 1fr; }
  .band-visual { border-left: 0; border-top: 1px solid var(--border); min-height: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .panel-band { grid-template-columns: 1fr; gap: 24px; }
  .panel-band .figure { max-width: 340px; }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .menu-btn { display: grid; }
  .header-actions .lang, .header-actions .hdr-divider, .header-actions .btn-client { display: none; }
  .form { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .next-cards { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 52px 0; }
  .band-copy { padding: 28px 24px; }
  .header-actions .btn-market { display: none; }
  .product-mark { width: 46px; height: 46px; margin-top: 12px; }
  .product-mark svg { width: 27px; height: 27px; }
}
