/* Nexta Update Hub — hand-written CSS, no build step. Light/dark via prefers-color-scheme. */
:root {
  --bg: #f7f7fb; --surface: #ffffff; --surface-2: #f2f2f8; --border: #e4e4ee; --text: #16161f; --muted: #5d5d72; --faint: #8d8da3;
  --brand: #4f46e5; --brand-2: #6366f1; --brand-ink: #ffffff; --brand-soft: #eef0ff; --brand-text: #3f37c9;
  --ok: #0f9d58; --ok-soft: #e7f6ee; --warn: #b45309; --warn-soft: #fef3e2; --bad: #c62828; --bad-soft: #fdecec;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 4px 16px rgba(20, 20, 40, .04);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Inter", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d14; --surface: #15151f; --surface-2: #1c1c29; --border: #2a2a3a; --text: #ececf4; --muted: #a3a3b8; --faint: #74748a;
    --brand: #6d66f6; --brand-2: #8b85ff; --brand-soft: #1f1d3d; --brand-text: #b3afff;
    --ok: #34c77b; --ok-soft: #10261b; --warn: #f0a24a; --warn-soft: #2a1d0c; --bad: #ff6b6b; --bad-soft: #2c1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 2.6vw + 1rem, 2.6rem); letter-spacing: -.03em; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.08rem; } h4 { font-size: .98rem; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 6px; word-break: break-word; }
pre { background: #10101a; color: #e6e6f0; padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.55; margin: 0 0 1.2em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; flex: none; vertical-align: -2px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; } .tiny { font-size: .76rem; }
.mono { font-family: var(--mono); } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.stack > * + * { margin-top: 16px; } .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
@media (prefers-color-scheme: dark) { .brand img { filter: brightness(0) invert(1); opacity: .92; } }
.brand .pill { font-size: .7rem; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); border-radius: 99px; padding: 2px 8px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 600 .92rem var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 20px; }

/* Hero */
.hero { padding: 64px 0 36px; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: .82rem; color: var(--brand-text); background: var(--brand-soft); border-radius: 99px; padding: 5px 12px; margin-bottom: 18px; }
.hero h1 { max-width: 760px; }
.hero h1 span { background: linear-gradient(92deg, var(--brand), #a855f7 60%, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 680px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.hero-points span { display: inline-flex; gap: 7px; align-items: center; }
.hero-points .icon { color: var(--ok); }

/* Directory */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 20px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .icon { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search input[type=search] { padding-left: 38px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 6px 13px; font: 500 .84rem var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.product-card { display: flex; flex-direction: column; padding: 22px; transition: border-color .15s, transform .15s; color: inherit; }
.product-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-2px); text-decoration: none; }
.product-card .top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.logo { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-lg { width: 72px; height: 72px; border-radius: 18px; font-size: 1.8rem; }
.product-card h3 { margin: 0; font-size: 1.08rem; color: var(--text); }
.product-card p { color: var(--muted); font-size: .92rem; flex: 1; margin-bottom: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--faint); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* Product page */
.show-md { display: none !important; }
.product-hero { padding: 40px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.product-hero .title { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.product-hero h1 { margin: 0; font-size: clamp(1.6rem, 2vw + 1rem, 2.3rem); }
.download-box { position: sticky; top: 82px; }
.download-box .ver { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .88rem; margin: 14px 0; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.links { display: grid; gap: 6px; }
.links a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); border: 1px solid var(--border); font-size: .9rem; font-weight: 500; }
.links a:hover { background: var(--surface-2); text-decoration: none; }
.links a .icon:last-child { margin-left: auto; color: var(--faint); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.shots figure { margin: 0; } .shots img { border-radius: 10px; border: 1px solid var(--border); display: block; }
.shots figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 900px) { .product-hero { grid-template-columns: minmax(0, 1fr); } .download-box { position: static; } .show-md { display: inline-flex !important; } }
@media (max-width: 520px) { .brand .pill, .hide-sm { display: none; } .nav { gap: 0; } .nav a { padding: 7px 8px; } .site-header .container { gap: 10px; } }

/* Prose */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.8em; padding-top: .2em; } .prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; } .prose li { margin: .25em 0; }
.prose blockquote { margin: 0 0 1.2em; padding: 10px 16px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--text); }
.prose blockquote p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table, .table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td, .table th, .table td { padding: 9px 13px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th, .table th { background: var(--surface-2); font-weight: 600; font-size: .82rem; color: var(--muted); }
.prose tr:last-child td, .table tr:last-child td { border-bottom: 0; }
.prose pre code { font-size: .86em; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr) 210px; gap: 36px; padding: 32px 0 60px; }
.docs-nav { position: sticky; top: 82px; align-self: start; display: grid; gap: 2px; }
.docs-nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-size: .9rem; }
.docs-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.docs-nav .label, .toc .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 0 11px 6px; }
.toc { position: sticky; top: 82px; align-self: start; font-size: .84rem; display: grid; gap: 4px; min-width: 0; }
.toc a, .docs-nav a { overflow-wrap: anywhere; }
.docs > * { min-width: 0; }
.toc a { color: var(--muted); padding: 2px 11px; } .toc a.l3 { padding-left: 24px; }
@media (max-width: 1100px) { .docs { grid-template-columns: 210px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) { .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; } .docs-nav { position: static; grid-auto-flow: column; overflow-x: auto; padding-bottom: 6px; } .docs-nav .label { display: none; } .docs-nav a { white-space: nowrap; } }

/* Releases timeline */
.release { padding: 22px; } .release + .release { border-top: 1px solid var(--border); }
.release h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.release .notes { margin-top: 10px; }
.hash { font-family: var(--mono); font-size: .76rem; color: var(--faint); overflow-wrap: anywhere; }

/* Promo */
.promo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin: 40px 0 0; background: linear-gradient(100deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 40%, var(--surface))); border: 1px solid var(--border); border-radius: var(--radius); }
.promo p { margin: 0; flex: 1; min-width: 220px; font-weight: 500; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 28px 0 40px; color: var(--muted); font-size: .86rem; }
.site-footer .container { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Forms */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--faint); font-size: .8rem; margin-top: 5px; display: block; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .93rem; }
textarea { height: auto; min-height: 110px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input[type=file] { font: inherit; font-size: .88rem; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Alerts */
.alert { display: flex; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; align-items: flex-start; }
.alert-success { background: var(--ok-soft); color: var(--ok); } .alert-error { background: var(--bad-soft); color: var(--bad); } .alert-warn { background: var(--warn-soft); color: var(--warn); } .alert-info { background: var(--brand-soft); color: var(--brand-text); }
.secret { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--border); padding: 10px 12px; border-radius: 10px; font-family: var(--mono); font-size: .84rem; overflow-wrap: anywhere; }

/* Admin */
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { padding: 6px 10px 18px; }
.sidebar a.item, .sidebar button.item { display: flex; gap: 10px; align-items: center; padding: 8px 11px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: .92rem; background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left; }
.sidebar a.item:hover, .sidebar button.item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar a.item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); }
.sidebar .spacer { flex: 1; }
.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; margin: 0; flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; } .stat .n { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; } .stat .l { color: var(--muted); font-size: .84rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 10px; }
.bars i { flex: 1; background: var(--brand); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars i:hover { opacity: 1; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .sidebar .brand { padding: 4px 8px; width: 100%; } .sidebar a.item, .sidebar button.item { width: auto; } .sidebar .spacer { display: none; }
  .main { padding: 20px 16px 48px; }
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; }
details.panel summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.panel summary::-webkit-details-marker { display: none; }
.hidden { display: none !important; }
