/* ZoPanel website — design tokens, layout, components. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-elev: #ffffff;
  --fg: #0b0d12;
  --fg-soft: #4a5161;
  --fg-mute: #737b8c;
  --line: #e6e8ee;
  --line-strong: #d5d9e2;
  --brand: #5b1fdc;
  --brand-ink: #4c11d6;
  --brand-soft: #f2edff;
  --brand-2: #7034e4;
  --brand-grad: linear-gradient(135deg, #7034e4, #4c11d6);
  --text-grad: linear-gradient(90deg, #8b5cf6, #5316d9 70%);
  --accent: #12b886;
  --warn: #f08c00;
  --danger: #e03131;
  --code-bg: #0f1218;
  --code-fg: #e6e9ef;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10; --bg-soft: #10131a; --bg-elev: #131721; --fg: #eef1f6; --fg-soft: #b3bac8; --fg-mute: #8790a2;
    --line: #1f2430; --line-strong: #2b3242; --brand: #8b5cf6; --brand-ink: #b197fc; --brand-soft: #1f1640; --brand-2: #9f7aea; --text-grad: linear-gradient(90deg, #c4b5fd, #8b5cf6 70%);
    --code-bg: #0d1016; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c10; --bg-soft: #10131a; --bg-elev: #131721; --fg: #eef1f6; --fg-soft: #b3bac8; --fg-mute: #8790a2;
  --line: #1f2430; --line-strong: #2b3242; --brand: #8b5cf6; --brand-ink: #b197fc; --brand-soft: #1f1640; --brand-2: #9f7aea; --text-grad: linear-gradient(90deg, #c4b5fd, #8b5cf6 70%);
  --code-bg: #0d1016; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.section { padding: 72px 0; }
.section.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-block; font: 600 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--fg-soft); max-width: 720px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
.muted { color: var(--fg-mute); }
.small { font-size: .875rem; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.hdr .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.1rem; color: var(--fg); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .wordmark { width: 111px; height: 30px; }
.ftr .logo .wordmark { width: 104px; height: 28px; }
.nav { display: none; gap: 4px; flex: 1; }
.nav a { color: var(--fg-soft); padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); background: var(--bg-soft); text-decoration: none; }
.hdr-actions { display: none; align-items: center; gap: 8px; margin-left: auto; }
.menu-btn { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--fg); cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }
@media (min-width: 980px) { .nav, .hdr-actions { display: flex; } .menu-btn { display: none; } }
.mobile-nav { display: none; border-bottom: 1px solid var(--line); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 16px; color: var(--fg); border-top: 1px solid var(--line); }
.flag { width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--fg-mute); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: var(--bg-soft); color: var(--fg); }
.lang-menu .chev { width: 12px; height: 12px; transition: transform .15s; }
.lang-menu[open] .chev { transform: rotate(180deg); }
.lang-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.ftr .lang-pop { top: auto; bottom: calc(100% + 6px); }
.lang-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--fg); font-size: .93rem; }
.lang-pop a:hover { background: var(--bg-soft); text-decoration: none; }
.lang-pop a[aria-current] { background: var(--brand-soft); font-weight: 600; }
.mobile-langs { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.mobile-nav .mobile-langs a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.mobile-nav .mobile-langs a[aria-current] { border-color: var(--brand); background: var(--brand-soft); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; font: 600 .95rem/1 var(--font); border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: linear-gradient(135deg, #7c45ea, #4310c4); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: .875rem; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 680px; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.hero h1 { max-width: 920px; }
.hero h1 .grad { background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--fg-mute); font-size: .9rem; }
.badge-row span { display: inline-flex; align-items: center; gap: 6px; }
.badge-row svg { width: 16px; height: 16px; color: var(--brand); }

/* Install command */
.cmd { display: flex; align-items: center; gap: 10px; max-width: 680px; background: var(--code-bg); color: var(--code-fg); border: 1px solid #1d2230; border-radius: var(--radius); padding: 12px 12px 12px 16px; font: .92rem/1.4 var(--mono); }
.cmd .prompt { color: #6b7385; user-select: none; }
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; background: none; border: 0; padding: 0; color: inherit; }
.cmd button { flex: none; background: #232938; color: #e6e9ef; border: 1px solid #323a4d; border-radius: 8px; padding: 6px 10px; font: 600 .8rem var(--font); cursor: pointer; }
.cmd button:hover { background: #2c3446; }

/* Stats */
.highlights { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.hl { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start; padding: 18px 18px; color: inherit; text-decoration: none; }
.hl + .hl::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: var(--line); }
.hl-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.hl-ic svg { width: 20px; height: 20px; }
.hl b { font-size: 1rem; letter-spacing: -.01em; line-height: 1.35; }
.hl-tx { color: var(--fg-mute); font-size: .9rem; line-height: 1.5; }
a.hl b::after { content: " \2192"; color: var(--brand); opacity: 0; transition: opacity .15s; }
a.hl:hover b::after, a.hl:focus-visible b::after { opacity: 1; }
@media (min-width: 720px) { .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hl + .hl::before { display: none; } .hl:nth-child(even)::after { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); } .hl:nth-child(n+3)::before { display: block; content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: var(--line); } }
@media (min-width: 1080px) { .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hl { grid-template-columns: minmax(0, 1fr); padding: 22px 22px; } .hl-ic { grid-row: auto; margin-bottom: 10px; } .hl:nth-child(n+3)::before { display: none; } .hl + .hl::after { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); } }

/* Grids and cards */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
a.card { color: inherit; display: block; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.card h3 { margin-top: 10px; }
.card p { color: var(--fg-soft); margin: 0; font-size: .95rem; }
.icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); }
.icon svg { width: 22px; height: 22px; }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* Checklists */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; color: var(--fg-soft); }
.checks svg { flex: none; width: 18px; height: 18px; margin-top: 4px; color: var(--brand); }

/* Split feature rows */
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } .split.rev > :first-child { order: 2; } }
.shot { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: var(--bg-soft); }
.shot img { display: block; width: 100%; height: auto; }

/* Architecture diagram */
.arch { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.arch svg { width: 100%; height: auto; }
.arch text { font-family: var(--font); fill: var(--fg); }
.arch .sub { fill: var(--fg-mute); font-size: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-soft); font-weight: 650; font-size: .85rem; color: var(--fg-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.zo { font-weight: 600; color: var(--fg); background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }

/* Pricing */
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; }
.plan.hl { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan .tag { position: absolute; top: -12px; left: 24px; background: var(--brand); color: #fff; font: 600 .75rem/1 var(--font); padding: 6px 10px; border-radius: 999px; }
.plan h3 { font-size: 1.15rem; margin: 0 0 4px; }
.plan .desc { color: var(--fg-mute); font-size: .92rem; min-height: 2.8em; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; }
.price b { font-size: 2.6rem; letter-spacing: -.04em; line-height: 1; }
.price s { color: var(--fg-mute); }
.price span { color: var(--fg-mute); }
.plan .checks { margin: 22px 0 26px; flex: 1; align-content: start; }
.addon { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.promo { display: flex; gap: 10px; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; margin: 0 auto 28px; width: fit-content; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--fg-mute); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--fg-soft); margin: 10px 0 0; }

/* CTA band */
.cta-band { border-radius: 20px; padding: 48px 28px; text-align: center; background: radial-gradient(80% 120% at 100% 0%, #6d28d9 0%, transparent 60%), linear-gradient(135deg, #12082e, #2a0f6b 60%, #3b0fb0); color: #fff; }
.cta-band p { color: #ddd6fe; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .08); }

/* Docs / prose */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 24px; padding-bottom: 72px; }
@media (min-width: 1000px) { .docs { grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 32px; padding-top: 32px; } .docs.docs-single { grid-template-columns: minmax(0, 1fr) 220px; } }
.docs-nav { font-size: .92rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.docs-nav > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; }
.docs-nav > summary::-webkit-details-marker { display: none; }
.docs-nav > summary span { margin-left: auto; color: var(--fg-mute); font-weight: 400; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.docs-nav > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 2px 0 0; transition: transform .15s; flex: none; }
.docs-nav[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.docs-nav > nav { padding: 0 6px 12px; max-height: 60vh; overflow-y: auto; }
@media (min-width: 1000px) { .docs-nav { border: 0; background: none; } .docs-nav > summary { display: none; } .docs-nav > nav { padding: 0; max-height: none; overflow: visible; } }
.docs-nav h4 { font: 650 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--fg-mute); margin: 22px 0 8px; }
.docs-nav a { display: block; padding: 5px 10px; color: var(--fg-soft); border-radius: 6px; }
.docs-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.toc { font-size: .85rem; position: sticky; top: 88px; align-self: start; display: none; }
@media (min-width: 1000px) { .toc { display: block; } }
.toc a { display: block; color: var(--fg-mute); padding: 3px 0; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; padding-top: .2em; }
.prose h3 { margin-top: 1.8em; }
.prose p, .prose li { color: var(--fg-soft); }
.prose li { margin: .3em 0; }
.prose pre { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-size: .88rem; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose table { margin: 1.2em 0; border: 1px solid var(--line); }
.prose blockquote { margin: 1.2em 0; padding: 12px 16px; border-left: 3px solid var(--brand); background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--fg-soft); }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.prose .anchor { opacity: 0; margin-left: 6px; color: var(--fg-mute); }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.breadcrumb { font-size: .88rem; color: var(--fg-mute); margin-bottom: 18px; }
.breadcrumb a { color: var(--fg-mute); }

/* Blog */
.post-meta { color: var(--fg-mute); font-size: .9rem; margin-bottom: 28px; }
.post-card .post-meta { margin: 10px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { font-size: .78rem; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg-soft); }

/* Forms */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { color: var(--fg-mute); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: inherit; font-size: .95rem; }
textarea { height: auto; min-height: 140px; padding: 10px 12px; line-height: 1.5; font-family: var(--font); }
textarea.code { font-family: var(--mono); font-size: .88rem; min-height: 420px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.check-row { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.auth { max-width: 420px; margin: 56px auto 96px; }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); margin-bottom: 18px; font-size: .92rem; }
.alert.ok { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.alert.err { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--bg)); }

/* Portal & console */
.app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; padding-bottom: 72px; }
@media (min-width: 900px) { .app { grid-template-columns: 220px minmax(0, 1fr); } }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--fg-soft); border-radius: 8px; font-size: .94rem; }
.side a svg { width: 18px; height: 18px; }
.side a[aria-current="page"] { background: var(--bg-soft); color: var(--fg); font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }
.pill.ok { color: #0b7a55; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.pill.warn { color: #9a5b00; background: color-mix(in srgb, var(--warn) 12%, var(--bg)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pill.err { color: #b42318; background: color-mix(in srgb, var(--danger) 10%, var(--bg)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.kpi span { color: var(--fg-mute); font-size: .85rem; }
.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg.staff { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.msg .who { font-size: .85rem; color: var(--fg-mute); margin-bottom: 6px; }
.inline-form { display: inline; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

/* Footer */
.ftr { border-top: 1px solid var(--line); padding: 56px 0 32px; background: var(--bg-soft); font-size: .92rem; }
.ftr-grid { display: grid; gap: 28px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .ftr-grid { grid-template-columns: 2fr repeat(4, 1fr); } }
.ftr h4 { font: 650 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-mute); margin: 4px 0 14px; }
.ftr a { display: block; color: var(--fg-soft); padding: 3px 0; }
.ftr .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; color: var(--fg-mute); }
.ftr .bottom a { display: inline; }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--fg-soft); padding: 4px 10px; cursor: pointer; font: inherit; font-size: .85rem; }
.ftr-tools { display: flex; align-items: center; gap: 8px; }
.ftr .bottom .lang-pop a { display: flex; }

/* Blog */
.blog-hero { position: relative; padding: 64px 0 28px; overflow: hidden; }
.blog-hero::before { content: ""; position: absolute; inset: -60% -10% auto; height: 560px; background: radial-gradient(55% 60% at 50% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%); pointer-events: none; }
.blog-hero .wrap { position: relative; }
.blog-search { display: flex; align-items: center; gap: 8px; max-width: 520px; margin-top: 22px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-elev); }
.blog-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.blog-search svg { width: 18px; height: 18px; color: var(--fg-mute); flex: none; }
.blog-search input[type=search] { border: 0; box-shadow: none; background: none; height: 46px; padding: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
a.tag-chip { color: var(--fg-soft); }
a.tag-chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-ink); }
.tag-chip.on { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.tag-chip span { opacity: .6; margin-left: 2px; }
.post-featured { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--bg-elev); color: inherit; margin-bottom: 28px; transition: border-color .15s, box-shadow .15s; }
.post-featured:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
@media (min-width: 900px) { .post-featured { grid-template-columns: 1.15fr 1fr; } }
.pf-media, .pc-media { aspect-ratio: 1200 / 630; background: var(--bg-soft); overflow: hidden; }
.pf-media img, .pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-body { padding: 28px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.pf-body h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.pf-body p { color: var(--fg-soft); margin: 0; }
.badge-brand { align-self: flex-start; font: 600 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--brand-grad); padding: 6px 9px; border-radius: 6px; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(70% 90% at 80% 10%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 70%), linear-gradient(135deg, var(--bg-soft), color-mix(in srgb, var(--brand) 10%, var(--bg-soft))); }
.cover-fallback svg { width: 22%; height: auto; aspect-ratio: 1; opacity: .9; }
.post-card { padding: 0; overflow: hidden; display: flex !important; flex-direction: column; }
.post-card > :not(.pc-media) { margin-left: 20px; margin-right: 20px; }
.post-card .tags { margin-top: 16px; }
.post-card h3 { margin-top: 12px; }
.post-card .post-meta, .post-card > p:last-child { margin-bottom: 20px; }
.post-grid { margin-top: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; }
.byline { display: flex; align-items: center; gap: 12px; }
.byline a { color: var(--fg); }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; display: inline-grid; place-items: center; background: var(--brand-grad); color: #fff; font-weight: 700; font-size: .95rem; }
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--brand-grad); }
.post-head { padding: 48px 0 28px; }
.post-narrow { max-width: 860px; }
.post-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.post-head .lead { margin-bottom: 24px; }
.post-cover { max-width: 1060px; margin: 0 auto 8px; }
.post-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); }
.post-layout { display: grid; gap: 32px; padding-top: 24px; }
@media (min-width: 1000px) { .post-layout { grid-template-columns: 48px minmax(0, 760px) 220px; justify-content: center; } }
.post-share { display: flex; gap: 8px; order: 2; }
@media (min-width: 1000px) { .post-share { order: 0; flex-direction: column; position: sticky; top: 96px; align-self: start; } }
.post-share a, .post-share button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg-soft); cursor: pointer; font: inherit; }
.post-share a:hover, .post-share button:hover { color: var(--brand-ink); border-color: var(--brand); }
.post-share svg { width: 17px; height: 17px; }
.post-main .prose { max-width: none; }
.takeaways { border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, var(--bg)); border-radius: 14px; padding: 18px 22px; margin-bottom: 28px; }
.takeaways h2 { font-size: .8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brand-ink); margin: 0 0 8px; }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin: 6px 0; color: var(--fg); }
.post-tags { margin: 32px 0 0; }
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 36px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
.author-box .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.author-box h3 { margin: 4px 0 8px; }
.author-box p { margin: 0; color: var(--fg-soft); }
.post-nav { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 720px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav .card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.toc a.lv3 { padding-left: 12px; }
.toc a.active { color: var(--brand-ink); font-weight: 600; }
.author-hero { display: flex; gap: 24px; align-items: flex-start; }
.author-hero > .avatar { width: 96px; height: 96px; font-size: 2rem; }
.prose img { height: auto; }
.prose .callout, .prose blockquote.note { border-left-color: var(--brand); }

/* Console editor */
.editor-app { max-width: 1600px; }
.ed-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); }
.ed-top .pill { margin-left: 8px; }
.ed-saved { margin-left: 10px; }
.ed-grid { display: grid; gap: 24px; }
@media (min-width: 1200px) { .ed-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.ed-title { font-size: 1.9rem !important; font-weight: 700; height: auto !important; padding: 10px 0 !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; letter-spacing: -.02em; }
.ed-title:focus { border-bottom-color: var(--brand) !important; }
.ed-slug { display: flex; align-items: center; gap: 4px; font-size: .85rem; margin: 8px 0 18px; flex-wrap: wrap; }
.ed-slug input { height: 30px !important; width: auto !important; min-width: 240px; font-family: var(--mono); font-size: .85rem; padding: 0 8px !important; }
.ed-summary { min-height: 64px !important; }
.ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--bg-soft); position: sticky; top: 125px; z-index: 10; }
.ed-toolbar button { height: 32px; min-width: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; border-radius: 6px; color: var(--fg-soft); cursor: pointer; font: 600 .82rem/1 var(--font); }
.ed-toolbar button:hover { background: var(--bg-elev); color: var(--fg); }
.ed-toolbar button.on { background: var(--bg-elev); color: var(--brand-ink); box-shadow: 0 0 0 1px var(--line); }
.ed-toolbar svg { width: 16px; height: 16px; }
.ed-toolbar .sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.ed-toolbar .grow { flex: 1; }
.ed-toolbar .seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.ed-panes { display: grid; border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; min-height: 560px; }
.ed-panes[data-view="split"] { grid-template-columns: 1fr 1fr; }
.ed-panes[data-view="write"] .ed-preview, .ed-panes[data-view="preview"] .ed-body { display: none; }
.ed-body { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-height: 560px !important; height: 100% !important; resize: vertical; font: .92rem/1.7 var(--mono) !important; padding: 18px 20px !important; background: var(--bg-elev) !important; tab-size: 2; }
.ed-body.drop { outline: 2px dashed var(--brand); outline-offset: -8px; background: var(--brand-soft) !important; }
.ed-preview { padding: 18px 24px; overflow: auto; max-height: 78vh; border-left: 1px solid var(--line); background: var(--bg); max-width: none; }
.ed-panes[data-view="preview"] .ed-preview { border-left: 0; max-height: none; }
.ed-stats { padding: 8px 2px; }
.ed-side { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 1200px) { .ed-side { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow: auto; padding-right: 2px; } }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); }
.panel > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: "▾"; margin-left: auto; color: var(--fg-mute); }
.panel:not([open]) > summary::after { content: "▸"; }
.panel-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.panel-body .field { margin: 0; }
.score { font: 700 .78rem/1 var(--mono); padding: 4px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--fg-mute); }
.score.good { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); color: #0b7a55; }
.score.warn { background: color-mix(in srgb, var(--warn) 16%, var(--bg)); color: #b45309; }
.score.bad { background: color-mix(in srgb, var(--danger) 14%, var(--bg)); color: var(--danger); }
.counter { float: right; font: 600 .75rem/1.6 var(--mono); color: var(--fg-mute); }
.counter.good { color: #0b7a55; } .counter.warn { color: #b45309; } .counter.bad { color: var(--danger); }
.checks-list { list-style: none; margin: 0; padding: 0; font-size: .84rem; display: flex; flex-direction: column; gap: 6px; }
.checks-list li { padding-left: 18px; position: relative; color: var(--fg-soft); line-height: 1.4; }
.checks-list li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 8px; height: 8px; border-radius: 50%; }
.checks-list li.ok::before { background: var(--accent); }
.checks-list li.warn::before { background: var(--warn); }
.checks-list li.bad::before { background: var(--danger); }
.serp { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); font-family: Arial, sans-serif; }
.serp-site { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--fg-soft); line-height: 1.3; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; border: 1px solid var(--line); }
.serp-fav svg { width: 14px; height: 14px; }
.serp-title { color: #1a0dab; font-size: 1.05rem; margin: 6px 0 2px; line-height: 1.3; }
:root[data-theme="dark"] .serp-title { color: #99c3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp-title { color: #99c3ff; } }
.serp-desc { font-size: .82rem; color: var(--fg-soft); line-height: 1.45; }
.cover-box { aspect-ratio: 1200 / 630; border: 1px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--bg-soft); }
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.tag-chip.missing { border-style: dashed; opacity: .7; }
.tag-chip .flag { width: 16px; height: 11px; }
.rev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.rev-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
body.ed-focus .side, body.ed-focus .hdr, body.ed-focus .ftr, body.ed-focus .ed-side { display: none; }
body.ed-focus .app { grid-template-columns: 1fr !important; }
body.ed-focus .ed-grid { grid-template-columns: 1fr; }
body.ed-focus .ed-top, body.ed-focus .ed-toolbar { top: 0; }
.media-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.media-grid .card { padding: 0; overflow: hidden; }
.media-grid .thumb { aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; }
.media-grid .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-grid .meta { padding: 10px 12px; font-size: .8rem; display: flex; flex-direction: column; gap: 6px; }
.media-grid .meta code { word-break: break-all; }
.drop-zone { border: 2px dashed var(--line-strong); border-radius: 14px; padding: 28px; text-align: center; color: var(--fg-mute); margin-bottom: 18px; cursor: pointer; }
.drop-zone.drop { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.side a.sub { padding-left: 30px; font-size: .88rem; }
@media (min-width: 900px) { .post-featured .pf-media { aspect-ratio: auto; display: flex; align-items: center; background: #0d0820; } .post-featured .pf-media img { height: auto; aspect-ratio: 1200 / 630; } .post-featured .pf-media .cover-fallback { height: 100%; } }
/* Phones: nothing in a layout may be wider than the screen. */
.grid > *, .split > *, .docs > *, .post-layout > *, .app > * { min-width: 0; }
.prose { overflow-wrap: break-word; }
.prose pre { max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
:not(pre) > code { overflow-wrap: anywhere; }
.table-wrap { -webkit-overflow-scrolling: touch; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.docs-single > .prose { width: 100%; margin: 0 auto; }
/* Console revenue bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bars > div { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.bars i { display: block; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.bars span { font-size: .72rem; color: var(--fg-mute); margin-top: 4px; white-space: nowrap; overflow: hidden; }
@media (max-width: 520px) { .bars { gap: 3px; } .bars > div:nth-child(even) span { visibility: hidden; } }
/* Phones: the portal/console menu becomes a scrollable tab strip above the page. */
@media (max-width: 899px) {
  .app { padding-top: 12px; gap: 16px; }
  .side { display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .side::-webkit-scrollbar { display: none; }
  .side a, .side a.sub { flex: none; white-space: nowrap; padding: 8px 12px; font-size: .9rem; }
  .side a svg { width: 16px; height: 16px; }
  .side form { flex: none; margin: 0 !important; } .side form .btn { width: auto; padding: 8px 12px; }
}
.cmd code { min-width: 0; }
