/* ============================================================
   Rawi — public site. Black & white only, like the app.
   Hierarchy from typography, spacing and hairlines. No colour.
   ============================================================ */

:root {
    --ink: #0d0d0d;
    --ink-2: #3d3d3d;
    --muted: #6e6e6e;
    --faint: #9c9c9c;
    --line: #e5e5e5;
    --line-2: #d0d0d0;
    --paper: #ffffff;
    --wash: #f7f7f7;
    --code-bg: #111111;
    --code-fg: #f2f2f2;
    --radius: 14px;
    --maxw: 1140px;
    --font: "Alan Sans", "Segoe UI", "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
    --ink: #f2f2f2;
    --ink-2: #c9c9c9;
    --muted: #9a9a9a;
    --faint: #707070;
    --line: #2a2a2a;
    --line-2: #3a3a3a;
    --paper: #0e0e0e;
    --wash: #161616;
    --code-bg: #000000;
    --code-fg: #f2f2f2;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

html, body { max-width: 100%; overflow-x: clip; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }

p { margin: 0; }

img, svg { max-width: 100%; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.eyebrow {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

/* ------------------------------------------------------------- top nav */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-nav .inner {
    display: flex;
    align-items: center;
    gap: 26px;
    height: 66px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; flex: 0 0 auto; }

.logo-mark {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 9px;
    background: var(--ink);
    color: var(--paper);
    display: grid; place-items: center;
    font-size: 18px; font-weight: 700; line-height: 1;
}

.nav-links { display: flex; align-items: center; gap: 4px; margin-inline-start: 8px; }

.nav-links a {
    padding: 8px 13px;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.nav-links a:hover { background: var(--wash); color: var(--ink); }

.nav-links a.active { color: var(--ink); }

.nav-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* login is a call to action, not part of the utility cluster */
.nav-actions .btn { margin-inline-start: 10px; }

.icon-btn {
    width: 38px; height: 38px;
    border: 1px solid var(--line-2);
    background: var(--paper);
    color: var(--ink);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center;
}

.icon-btn:hover { background: var(--wash); }

.nav-burger { display: none; }

/* ------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .14s ease, transform .14s ease;
    white-space: nowrap;
}

.btn:hover { opacity: .82; }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; opacity: 1; }

.btn.small { padding: 9px 16px; font-size: 13.5px; }

.btn.block { width: 100%; }

/* ------------------------------------------------------------- hero */
.hero { padding: 96px 0 72px; text-align: center; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 13px; font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 28px;
}

.hero-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: inline-block; }

.hero h1 {
    font-size: clamp(38px, 6.4vw, 68px);
    letter-spacing: -.035em;
    line-height: 1.06;
    font-weight: 800;
}

.hero h1 .thin { display: block; font-weight: 300; color: var(--ink); opacity: .66; }

.hero .lede {
    max-width: 640px;
    margin: 26px auto 0;
    font-size: 18.5px;
    color: var(--muted);
    line-height: 1.7;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }

.hero-note { margin-top: 16px; font-size: 13.5px; color: var(--faint); }

/* terminal card */
.hero-card {
    max-width: 760px;
    margin: 64px auto 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .35);
    background: var(--wash);
}

.hero-card .bar {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.hero-card .bar i { width: 10px; height: 10px; border-radius: 50%; background: #6e6e6e; display: block; }

.hero-card pre {
    margin: 0;
    padding: 22px 24px;
    background: var(--code-bg);
    color: var(--code-fg);
    font-family: var(--mono);
    font-size: 13.2px;
    line-height: 1.75;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.hero-card .cm { color: #8b8b8b; }
.hero-card .st { color: #d8d8d8; }
.hero-card .k { color: #ffffff; font-weight: 700; }

/* ------------------------------------------------------------- sections */
.section { padding: 84px 0; }

.section.alt { background: var(--wash); border-block: 1px solid var(--line); }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 52px; }

.section-head h2 { font-size: clamp(27px, 4vw, 40px); letter-spacing: -.025em; }

.section-head p { margin-top: 14px; color: var(--muted); font-size: 16.5px; }

/* stats strip */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    overflow: hidden;
}

.stats .cell { padding: 26px 20px; text-align: center; border-inline-start: 1px solid var(--line); }
.stats .cell:first-child { border-inline-start: 0; }
.stats .num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stats .cap { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* feature grid */
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.feat {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    background: var(--paper);
    transition: border-color .15s ease;
}

.feat:hover { border-color: var(--line-2); }

.feat .ico {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: var(--ink);
    color: var(--paper);
    display: grid; place-items: center;
    font-size: 19px;
    margin-bottom: 18px;
}

.feat h3 { font-size: 17.5px; margin-bottom: 9px; }

.feat p { font-size: 14.5px; color: var(--muted); line-height: 1.7; }

/* models list */
.models-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }

.models-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.models-row:last-child { border-bottom: 0; }

.models-row.head { background: var(--wash); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line-2); }

.models-row .name { font-weight: 700; font-size: 15.5px; }

.models-row .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pill {
    display: inline-block;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
}

.price-tag { font-family: var(--mono); font-size: 14px; font-weight: 700; white-space: nowrap; }

/* api steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 44px; }

.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--paper); }

.step .n {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--ink); color: var(--paper);
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px;
    margin-bottom: 16px;
}

.step h3 { font-size: 16px; margin-bottom: 7px; }

.step p { font-size: 14px; color: var(--muted); }

/* code tabs */
.code-block { border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: var(--code-bg); direction: ltr; }

.code-tabs { display: flex; gap: 2px; padding: 8px 10px 0; background: var(--code-bg); border-bottom: 1px solid #2c2c2c; }

.code-tabs button {
    border: 0; background: transparent;
    color: #9a9a9a;
    font-family: var(--mono); font-size: 12.5px; font-weight: 600;
    padding: 9px 14px;
    border-radius: 9px 9px 0 0;
    cursor: pointer;
}

.code-tabs button.active { background: #222; color: #fff; }

.code-block pre {
    margin: 0; padding: 20px 22px;
    color: var(--code-fg);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
    display: none;
    text-align: left;
}

.code-block pre.active { display: block; }

.code-block .cm { color: #8b8b8b; }
.code-block .st { color: #cfe8c9; }
.code-block .kw { color: #9ecbff; }

.endpoint-list { margin-top: 22px; display: grid; gap: 10px; }

.endpoint {
    display: flex; align-items: center; gap: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    background: var(--paper);
    font-family: var(--mono);
    font-size: 13.5px;
    direction: ltr;
    text-align: left;
}

.endpoint .m {
    font-size: 11px; font-weight: 800;
    border: 1px solid var(--ink);
    border-radius: 6px;
    padding: 2.5px 8px;
    font-family: var(--font);
}

.endpoint .m.get { background: var(--paper); color: var(--ink); }
.endpoint .m.post { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------- pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: stretch; }

.plans.single { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }

.plan {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px 24px;
    background: var(--paper);
    display: flex; flex-direction: column;
    position: relative;
}

.plan.featured { border: 1.5px solid var(--ink); }

.plan .flag {
    position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--paper);
    font-size: 11.5px; font-weight: 700;
    padding: 4px 13px; border-radius: 999px;
    white-space: nowrap;
}

[dir="rtl"] .plan .flag { transform: translateX(50%); }

.plan h3 { font-size: 16.5px; }

.plan .price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; line-height: 1.1; }

.plan .price small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }

.plan .unit { font-size: 12.5px; color: var(--faint); margin-bottom: 18px; }

.plan .credits { font-size: 14.5px; font-weight: 600; padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 16px; }

.plan .credits b { font-size: 17px; }

.plan ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }

.plan li { font-size: 13.8px; color: var(--ink-2); display: flex; gap: 9px; align-items: baseline; }

.plan li::before { content: "✓"; font-weight: 800; }

.plan .btn { margin-top: auto; }

/* faq */
.faq { max-width: 720px; margin: 0 auto; }

details { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-bottom: 12px; }

details summary {
    cursor: pointer; padding: 18px 22px;
    font-weight: 700; font-size: 15.5px;
    list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

details summary::-webkit-details-marker { display: none; }

details summary::after { content: "+"; font-weight: 400; font-size: 20px; color: var(--muted); }

details[open] summary::after { content: "−"; }

details .body { padding: 0 22px 18px; color: var(--muted); font-size: 14.8px; line-height: 1.75; }

/* CTA band */
.cta-band {
    background: var(--ink);
    color: var(--paper);
    border-radius: 24px;
    padding: clamp(40px, 7vw, 80px) 28px;
    text-align: center;
}

.cta-band h2 { font-size: clamp(26px, 4.5vw, 42px); letter-spacing: -.03em; }

.cta-band p { color: rgba(255, 255, 255, .62); margin-top: 12px; font-size: 16.5px; }

.cta-band .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); margin-top: 30px; }

/* ------------------------------------------------------------- about */
.prose { max-width: 700px; margin-inline: auto; }

.prose .lead { font-size: clamp(19px, 2.6vw, 24px); line-height: 1.6; font-weight: 300; color: var(--ink-2); letter-spacing: -.01em; }

.prose h2 { font-size: 22px; margin-top: 46px; margin-bottom: 12px; }

.prose p { color: var(--muted); font-size: 16px; }

.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 56px; }

/* ------------------------------------------------------------- auth */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 48px 20px; }

.auth-card { width: 100%; max-width: 430px; }

.auth-card .logo-mark { margin: 0 auto 18px; }
[dir="rtl"] .auth-card .logo-mark { margin-inline: auto; }

.auth-card h1 { font-size: 26px; text-align: center; letter-spacing: -.02em; }

.auth-card .sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 8px 0 30px; }

.auth-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--paper); }

.field { margin-bottom: 16px; }

.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; }

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
}

.field input:focus { outline: 2px solid var(--ink); border-color: var(--ink); }

.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.alert { border-radius: 11px; padding: 12px 15px; font-size: 14px; margin-bottom: 16px; border: 1px solid var(--line-2); background: var(--wash); }

.alert.bad { border-color: var(--ink); }

.alert.ok { border-style: dashed; }

.auth-alt { text-align: center; margin-top: 18px; font-size: 13.8px; color: var(--muted); }

.auth-alt a { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.otp-row { display: flex; gap: 8px; direction: ltr; margin-bottom: 6px; }

.otp-row input {
    flex: 1 1 0; min-width: 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 21px; font-weight: 700;
    padding: 13px 4px;
}

/* ------------------------------------------------------------- console */
.console { padding: 36px 0 80px; }

.console-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }

.console-head h1 { font-size: 24px; }

.console-head .who { color: var(--muted); font-size: 14px; }

.cstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }

.cstat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--paper); }

.cstat .cap { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }

.cstat .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 24px; overflow: hidden; }

.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.panel-head h2 { font-size: 16.5px; }

.panel-body { padding: 22px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

.inline-form .field { margin-bottom: 0; flex: 1 1 170px; min-width: 0; }

.key-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.key-card .meta { min-width: 0; }

.key-card .kn { font-weight: 700; font-size: 15px; }

.key-card .kp { font-family: var(--mono); font-size: 12.8px; color: var(--muted); margin-top: 2px; direction: ltr; text-align: start; overflow-wrap: anywhere; }

.key-card .kstat { font-size: 12.5px; color: var(--faint); margin-top: 3px; }

.reveal {
    border: 1.5px solid var(--ink);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 24px;
    background: var(--wash);
}

.reveal h3 { font-size: 15px; margin-bottom: 10px; }

.reveal .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.reveal code {
    flex: 1 1 260px;
    font-family: var(--mono);
    font-size: 13.5px;
    background: var(--code-bg);
    color: var(--code-fg);
    padding: 12px 14px;
    border-radius: 10px;
    overflow-x: auto;
    direction: ltr;
    white-space: nowrap;
}

.env-badge { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 11px; border: 1px solid var(--line-2); text-transform: uppercase; letter-spacing: .06em; }

.env-badge.live { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 40px; background: var(--paper); }

.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 36px; margin-bottom: 44px; }

.footer-grid h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }

.footer-grid a { display: block; font-size: 14.5px; color: var(--ink-2); padding: 5px 0; }

.footer-grid a:hover { color: var(--ink); }

.footer-tag { font-size: 14.5px; color: var(--muted); max-width: 320px; margin-top: 14px; }

.footer-bottom { border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .feat-grid, .steps, .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats .cell:nth-child(3) { border-inline-start: 0; }
    .stats .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-burger { display: inline-flex; }

    .site-nav .inner { gap: 12px; }

    .nav-actions { gap: 7px; }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        inset-inline: 0;
        top: 66px;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 12px 20px 18px;
        gap: 2px;
    }

    .hero { padding: 64px 0 48px; }
    .section { padding: 60px 0; }
}

@media (max-width: 620px) {
    .feat-grid, .steps, .about-grid, .plans, .cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .models-row { grid-template-columns: minmax(0, 1fr) auto; }
    .models-row .mid { grid-column: 1 / -1; order: 3; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-card pre { font-size: 11.6px; }
    .panel-head, .panel-body { padding-inline: 16px; }
}

@media (max-width: 560px) {
    /* two-up feature cards clipped at phone widths — one readable column wins */
    .feat-grid, .steps, .about-grid, .plans, .cstats { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 460px) {
    .container { padding-inline: 16px; }
}

/* ---- Hugeicons inline sprite + auth extras ---- */
svg.hi { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.field .req { color: currentColor; opacity: .6; }
details.alt-identity { border: 1px dashed var(--line, #ddd); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
details.alt-identity summary { cursor: pointer; font-size: 13px; color: var(--muted, #888); list-style: none; }
details.alt-identity[open] { padding-bottom: 4px; }

/* ============================================================
   v5 — "Neural Void": black & white base, aurora glows, motion.
   Colour is allowed ONLY as ambient glow (aurora orbs, focus
   rings, chart accents) — surfaces and text stay monochrome.
   ============================================================ */
:root {
    --glow-1: #7c6cff;   /* violet  */
    --glow-2: #38bdf8;   /* sky     */
    --glow-3: #f472b6;   /* pink    */
    --glow-4: #34d399;   /* mint    */
}

/* ------------------------------------------------------- aurora backdrop */
.aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.aurora .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    will-change: transform;
}

[data-theme="light"] .aurora .orb { opacity: .3; }

.aurora .orb.o1 { width: 520px; height: 520px; background: var(--glow-1); top: -180px; inset-inline-start: -120px; animation: drift1 22s ease-in-out infinite alternate; }
.aurora .orb.o2 { width: 460px; height: 460px; background: var(--glow-2); top: -60px; inset-inline-end: -140px; animation: drift2 26s ease-in-out infinite alternate; }
.aurora .orb.o3 { width: 420px; height: 420px; background: var(--glow-3); bottom: -220px; inset-inline-start: 22%; animation: drift3 30s ease-in-out infinite alternate; }
.aurora .orb.o4 { width: 300px; height: 300px; background: var(--glow-4); bottom: -120px; inset-inline-end: 12%; animation: drift2 24s ease-in-out infinite alternate-reverse; }

@keyframes drift1 { to { transform: translate(90px, 60px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-80px, 90px) scale(.9); } }
@keyframes drift3 { to { transform: translate(60px, -70px) scale(1.2); } }

/* neural grid: faint perspective lines that slowly scroll */
.neural-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
    animation: gridflow 14s linear infinite;
}

@keyframes gridflow { to { background-position: 0 56px, 56px 0; } }

/* floating sparks */
.sparks { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.sparks i {
    position: absolute;
    bottom: -12px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--ink);
    opacity: 0;
    animation: rise linear infinite;
}

.sparks i:nth-child(1)  { inset-inline-start: 6%;  animation-duration: 13s; animation-delay: 0s;   background: var(--glow-2); }
.sparks i:nth-child(2)  { inset-inline-start: 16%; animation-duration: 17s; animation-delay: 2.4s; }
.sparks i:nth-child(3)  { inset-inline-start: 27%; animation-duration: 12s; animation-delay: 5s;   background: var(--glow-1); }
.sparks i:nth-child(4)  { inset-inline-start: 38%; animation-duration: 19s; animation-delay: 1.2s; }
.sparks i:nth-child(5)  { inset-inline-start: 49%; animation-duration: 14s; animation-delay: 6.5s; background: var(--glow-3); }
.sparks i:nth-child(6)  { inset-inline-start: 61%; animation-duration: 18s; animation-delay: 3.1s; }
.sparks i:nth-child(7)  { inset-inline-start: 72%; animation-duration: 12.5s; animation-delay: 7.8s; background: var(--glow-4); }
.sparks i:nth-child(8)  { inset-inline-start: 83%; animation-duration: 16s; animation-delay: 0.7s; }
.sparks i:nth-child(9)  { inset-inline-start: 92%; animation-duration: 20s; animation-delay: 4.4s; background: var(--glow-2); }

@keyframes rise {
    0%   { transform: translateY(0) scale(.6); opacity: 0; }
    12%  { opacity: .8; }
    85%  { opacity: .5; }
    100% { transform: translateY(-88vh) scale(1.1); opacity: 0; }
}

/* ------------------------------------------------------- hero, rebuilt */
.hero { position: relative; padding: 110px 0 84px; }
.hero > * { position: relative; z-index: 1; }

.hero-badge {
    border-color: color-mix(in srgb, var(--glow-1) 45%, var(--line-2));
    background: color-mix(in srgb, var(--glow-1) 7%, transparent);
    box-shadow: 0 0 24px -6px color-mix(in srgb, var(--glow-1) 40%, transparent);
}

.hero-badge i {
    background: var(--glow-4);
    animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glow-4) 55%, transparent); }
    70%  { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* the title carries the only gradient text on the site */
.hero h1 .glowline {
    background: linear-gradient(92deg, var(--glow-1), var(--glow-2) 45%, var(--glow-3) 90%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: hueshift 9s ease-in-out infinite alternate;
}

@keyframes hueshift { to { background-position: 100% 0; } }

/* logo mark breathes a soft halo */
.logo-mark { position: relative; isolation: isolate; }
.logo-mark::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 13px;
    background: conic-gradient(var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-4), var(--glow-1));
    filter: blur(10px);
    opacity: .5;
    z-index: -1;
    animation: spin 7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* primary CTA: ink fill with a coloured edge-glow on hover */
.btn.glow:hover {
    opacity: 1;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--glow-1) 60%, transparent),
                0 8px 34px -8px color-mix(in srgb, var(--glow-1) 65%, transparent);
    transform: translateY(-1px);
}

/* ------------------------------------------------------- live demo chat */
.demo-shell {
    max-width: 720px;
    margin: 64px auto 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: 0 40px 100px -50px rgba(0, 0, 0, .5),
                0 0 60px -30px color-mix(in srgb, var(--glow-1) 35%, transparent);
    overflow: hidden;
    text-align: start;
}

.demo-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.demo-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--glow-4); box-shadow: 0 0 8px var(--glow-4); }
.demo-head .ttl { font-weight: 700; font-size: 14px; }
.demo-head .mdl { margin-inline-start: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }

.demo-body { padding: 20px 18px; min-height: 250px; display: flex; flex-direction: column; gap: 14px; }

.demo-msg { max-width: 86%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.75; animation: msgin .35s ease both; }

@keyframes msgin { from { opacity: 0; transform: translateY(10px); } }

.demo-msg.user {
    align-self: flex-end;
    background: var(--ink);
    color: var(--paper);
}

[dir="rtl"] .demo-msg.user { border-radius: 18px 18px 6px 18px; }
[dir="ltr"] .demo-msg.user { border-radius: 18px 18px 18px 6px; }

.demo-msg.ai {
    align-self: flex-start;
    border: 1px solid var(--line);
    background: var(--wash);
}

[dir="rtl"] .demo-msg.ai { border-radius: 18px 18px 18px 6px; }
[dir="ltr"] .demo-msg.ai { border-radius: 18px 18px 6px 18px; }

.demo-msg.ai .who {
    display: flex; align-items: center; gap: 7px;
    font-size: 11.5px; font-weight: 800; color: var(--muted);
    margin-bottom: 6px; letter-spacing: .04em;
}

.demo-msg.ai .who i { width: 7px; height: 7px; border-radius: 50%; background: var(--glow-1); box-shadow: 0 0 7px var(--glow-1); }
.demo-msg.ai .who img { width: 18px; height: 18px; border-radius: 6px; display: inline-block; }

.demo-caret::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--glow-2); }

@keyframes blink { 50% { opacity: 0; } }

.demo-typing { display: inline-flex; gap: 5px; align-items: center; padding: 4px 0; }
.demo-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.1s ease-in-out infinite; }
.demo-typing i:nth-child(2) { animation-delay: .16s; }
.demo-typing i:nth-child(3) { animation-delay: .32s; }

@keyframes bounce { 30% { transform: translateY(-6px); opacity: 1; } }

.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 18px; }

.demo-chips button {
    border: 1px solid var(--line-2);
    background: var(--paper);
    color: var(--ink-2);
    border-radius: 999px;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.demo-chips button:hover {
    border-color: color-mix(in srgb, var(--glow-1) 55%, var(--line-2));
    box-shadow: 0 0 18px -6px color-mix(in srgb, var(--glow-1) 50%, transparent);
    transform: translateY(-1px);
}

.demo-chips button:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

.demo-note { text-align: center; font-size: 12.5px; color: var(--faint); padding: 0 18px 16px; }

/* ------------------------------------------------------- scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ------------------------------------------------------- model cards */
.model-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }

.model-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    background: var(--paper);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.model-card::before {
    content: "";
    position: absolute;
    inset-inline-start: -40px; top: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--mc, var(--glow-1));
    filter: blur(52px);
    opacity: .16;
    transition: opacity .25s ease;
}

.model-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 24px 60px -30px rgba(0,0,0,.35); }
.model-card:hover::before { opacity: .34; }

.model-card .m-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }

.model-card .m-alias {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    border: 1px solid var(--line-2); border-radius: 8px;
    padding: 3px 9px; margin-top: 8px;
    direction: ltr;
    background: var(--wash);
}

.model-card .m-alias::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mc, var(--glow-1)); box-shadow: 0 0 6px var(--mc, var(--glow-1)); }

.model-card .m-desc { font-size: 13.5px; color: var(--muted); margin-top: 12px; line-height: 1.7; min-height: 44px; }

.model-card .m-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.model-card .m-tag { font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); }

.model-card .m-price { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; }
.model-card .m-price b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.model-card .m-price span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------- stats, animated */
.stats .num { font-variant-numeric: tabular-nums; }

.stats .cell { position: relative; transition: background .2s ease; }
.stats .cell::after {
    content: "";
    position: absolute; inset: auto 20% -1px 20%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--glow-1), var(--glow-2), transparent);
    opacity: 0; transition: opacity .3s ease;
}
.stats .cell:hover::after { opacity: 1; }

/* ------------------------------------------------------- dev page blocks */
.env-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.env-card { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--paper); position: relative; overflow: hidden; }

.env-card .env-badge { display: inline-block; margin-bottom: 14px; }
.env-card.live { border-color: color-mix(in srgb, var(--glow-4) 40%, var(--line)); }
.env-card.test { border-color: color-mix(in srgb, var(--glow-2) 40%, var(--line)); }
.env-card h3 { font-size: 17px; margin-bottom: 8px; }
.env-card p { font-size: 14px; color: var(--muted); line-height: 1.75; }

.err-table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.err-row { display: grid; grid-template-columns: 90px 230px minmax(0, 1fr); gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.err-row:last-child { border-bottom: 0; }
.err-row.head { background: var(--wash); font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.err-row .code { font-family: var(--mono); font-weight: 700; direction: ltr; text-align: start; }
.err-row .st { font-family: var(--mono); font-weight: 800; direction: ltr; }
.err-row .st.c4 { color: var(--glow-2); }
.err-row .st.c5 { color: var(--glow-3); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }

.mini-list { display: grid; gap: 12px; }
.mini-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--paper); }
.mini-item .mi-ico { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 16px; }
.mini-item h4 { font-size: 14.5px; margin-bottom: 4px; }
.mini-item p { font-size: 13px; color: var(--muted); line-height: 1.65; }

@media (max-width: 860px) {
    .env-grid, .split { grid-template-columns: minmax(0, 1fr); }
    .err-row { grid-template-columns: 70px minmax(0, 1fr); }
    .err-row .code { grid-column: 1 / -1; }
    .hero { padding: 72px 0 56px; }
}

/* motion-sensitivity: everything above collapses to static */
@media (prefers-reduced-motion: reduce) {
    .aurora .orb, .neural-grid, .sparks i, .hero-badge i, .hero h1 .glowline, .logo-mark::after, .demo-caret::after, .demo-typing i { animation: none !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .sparks i { opacity: .4; }
}

/* ------------------------------------------------------- brand mark (real logo) */
.logo-mark.logo-img {
    background: #000 url(/rawi-mark-white.png) center / 74% no-repeat;
    overflow: hidden;
}

.brand-mark.brand-img {
    background: #fff url(/rawi-mark-black.png) center / 68% no-repeat;
}

.auth-mark.auth-img {
    background: #fff url(/rawi-mark-black.png) center / 64% no-repeat;
}

.hero-logo { display: inline-block; margin-bottom: 22px; position: relative; z-index: 1; }

.hero-logo img {
    width: 118px; height: 118px;
    border-radius: 28px;
    display: block;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .55),
                0 0 46px -14px color-mix(in srgb, var(--glow-1) 55%, transparent);
    animation: floaty 7s ease-in-out infinite alternate;
}

@keyframes floaty { to { transform: translateY(-9px); } }

.demo-msg.ai .who img { width: 18px; height: 18px; border-radius: 6px; display: inline-block; }

@media (max-width: 620px) {
    .hero-logo img { width: 88px; height: 88px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-logo img { animation: none; }
}

/* ============================================================
   v7 — Developer Portal chrome (DeepSeek-style: top bar +
   sidebar, one job per screen). Black & white surfaces, colour
   only as glow.
   ============================================================ */

.portal-body { background: var(--wash); }

.ptop {
    position: sticky; top: 0; z-index: 60;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.ptop-in {
    max-width: 1340px; margin: 0 auto; padding: 0 24px;
    height: 62px; display: flex; align-items: center; gap: 14px;
}
.pburger { display: none; }

.pbrand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.pbrand em {
    font-style: normal; font-weight: 600; font-size: 12.5px; color: var(--muted);
    border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; margin-inline-start: 4px;
    background: var(--paper);
}
.ptop-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.ptop-link {
    font-size: 14px; font-weight: 600; color: var(--ink-2); background: none; border: 0;
    cursor: pointer; padding: 8px 12px; border-radius: 10px; font-family: inherit;
}
.ptop-link:hover { background: var(--wash); color: var(--ink); }

.puser { position: relative; }
.pavatar {
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-family: inherit;
    background: radial-gradient(120% 120% at 20% 0%, #3a3a3a 0%, #0c0c0c 70%);
    color: #fff; font-weight: 700; font-size: 15px; border: 1px solid #000;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow-1, #6d5efc) 22%, transparent);
}
.puser-menu {
    position: absolute; inset-inline-end: 0; top: 46px; min-width: 230px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 24px 60px -24px rgba(0,0,0,.35); padding: 8px;
    opacity: 0; pointer-events: none; transform: translateY(-6px); transition: .16s ease;
}
.puser-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.pu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.pu-head strong { font-size: 15px; }
.pu-head span { font-size: 13px; color: var(--muted); }
.pu-bal { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.pu-bal b { font-size: 15px; }
.puser-menu a, .puser-menu button {
    display: block; width: 100%; text-align: start; padding: 10px 12px; font-size: 14px;
    border: 0; background: none; color: var(--ink); border-radius: 10px; cursor: pointer;
    font-family: inherit; text-decoration: none;
}
.puser-menu a:hover, .puser-menu button:hover { background: var(--wash); }
.puser-menu form { margin: 0; }

.portal-shell {
    max-width: 1340px; margin: 0 auto; padding: 26px 24px 80px;
    display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px;
    align-items: start;
}

.pside {
    position: sticky; top: 88px;
    display: grid; gap: 4px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px;
}
.pside-nav { display: grid; gap: 3px; }
.pside a {
    display: flex; align-items: center; gap: 11px; padding: 11px 13px;
    border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.pside a svg { opacity: .75; }
.pside a:hover { background: var(--wash); color: var(--ink); }
.pside a.on {
    background: #0d0d0d; color: #fff;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,.5), 0 0 0 1px #0d0d0d;
}
[data-theme="dark"] .pside a.on { background: #fff; color: #0d0d0d; box-shadow: 0 6px 18px -8px rgba(255,255,255,.28), 0 0 0 1px #fff; }
.pside a.on svg { opacity: 1; }
.pside-links { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: grid; gap: 3px; }
.pside-foot { border-top: 1px solid var(--line); margin-top: 8px; padding: 14px 13px 10px; }
.pside-foot .cap { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.pside-foot .val { font-size: 24px; font-weight: 800; margin: 4px 0 10px; }
.pside-foot .val span { font-size: 12px; color: var(--muted); font-weight: 600; }

.portal-main { min-width: 0; display: grid; gap: 22px; }

.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.phead h1 { font-size: 26px; letter-spacing: -.03em; }
.phead .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.phead .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* stat tiles */
.pstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pstat {
    position: relative; overflow: hidden;
    background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 16px;
}
.pstat::after {
    content: ""; position: absolute; inset-inline-end: -34px; top: -34px; width: 110px; height: 110px;
    border-radius: 50%; background: radial-gradient(closest-side, var(--halo, transparent), transparent 70%);
    opacity: .5; pointer-events: none;
}
.pstat .cap { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.pstat .val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.pstat .sub { font-size: 12.5px; color: var(--faint); margin-top: 7px; }

/* sparkline */
.spark { display: flex; align-items: flex-end; gap: 5px; height: 74px; }
.spark i {
    flex: 1; min-height: 3px; border-radius: 6px 6px 2px 2px; position: relative;
    background: linear-gradient(180deg, #1a1a1a, #6e6e6e);
    opacity: .85; transition: height .5s ease;
}
[data-theme="dark"] .spark i { background: linear-gradient(180deg, #fff, #8a8a8a); }
.spark i:last-child { box-shadow: 0 0 16px -2px var(--glow-1, #6d5efc); }
.spark-x { display: flex; gap: 5px; margin-top: 7px; }
.spark-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); }

/* data tables */
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable th {
    text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--line);
    white-space: nowrap; background: var(--paper);
}
.ptable td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable tbody tr { transition: background .12s; }
.ptable tbody tr:hover { background: color-mix(in srgb, var(--wash) 70%, transparent); }
.ptable .mono { font-family: var(--mono); font-size: 13px; }
.ptable .num { font-variant-numeric: tabular-nums; }

/* status pills — colour is a glow, not a paint */
.pill {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--wash); color: var(--ink-2);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.live { border-color: color-mix(in srgb, #0d0d0d 30%, var(--line)); }
.pill.live i { background: #0d0d0d; box-shadow: 0 0 8px #0d0d0d; }
.pill.test i { background: #9a9a9a; }
.pill.ok i { background: #17a673; box-shadow: 0 0 8px #17a673; }
.pill.warn i { background: #e8a13c; box-shadow: 0 0 8px #e8a13c; }
.pill.bad i { background: #e0596f; box-shadow: 0 0 8px #e0596f; }
.pill.off { opacity: .55; }

/* copy chip */
.copychip {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: var(--mono); font-size: 13px; color: var(--ink-2);
    border: 1px dashed var(--line-2); border-radius: 9px; padding: 5px 10px; background: var(--paper);
}
.copychip::after { content: "⧉"; opacity: .5; }
.copychip.copied { border-style: solid; border-color: #0d0d0d; color: #0d0d0d; }
[data-theme="dark"] .copychip.copied { border-color: #fff; color: #fff; }

/* section panel headers */
.psec { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.psec-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.psec-head h2 { font-size: 16px; }
.psec-head .hint { font-size: 13px; color: var(--muted); }
.psec-body { padding: 20px; }
.psec .empty { padding: 28px 20px; color: var(--muted); font-size: 14px; text-align: center; }

/* modal */
.pmodal {
    position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 22px;
    background: rgba(6, 6, 8, .6); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.pmodal.on { opacity: 1; pointer-events: auto; }
.pmodal-card {
    width: min(460px, 100%); background: var(--paper); border: 1px solid var(--line);
    border-radius: 22px; padding: 26px; transform: translateY(10px) scale(.985); transition: .2s ease;
    box-shadow: 0 40px 90px -30px rgba(0,0,0,.5);
}
.pmodal.on .pmodal-card { transform: none; }
.pmodal-card h3 { font-size: 19px; margin-bottom: 6px; }
.pmodal-card .desc { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.pfield { margin-bottom: 14px; }
.pfield label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pfield input[type=text], .pfield input[type=number], .pfield select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px;
    background: var(--paper); color: var(--ink); font-family: inherit; font-size: 15px;
}
.pfield input:focus, .pfield select:focus { outline: 2px solid color-mix(in srgb, var(--glow-1, #6d5efc) 45%, transparent); border-color: var(--ink); }
.seg { display: flex; gap: 6px; background: var(--wash); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg label { flex: 1; margin: 0 !important; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
    display: block; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 13.5px;
    font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0,0,0,.3); border: 1px solid var(--line); }

/* billing */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 13px; }
.plan-card {
    position: relative; text-align: start; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; background: var(--paper);
    transition: border-color .15s, transform .15s, box-shadow .2s; font-family: inherit; color: inherit;
}
.plan-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.plan-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 14px 30px -18px rgba(0,0,0,.5); }
.plan-card .nm { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.plan-card .cr { font-size: 24px; font-weight: 800; margin: 5px 0 2px; letter-spacing: -.03em; }
.plan-card .bonus { font-size: 12px; color: #17a673; font-weight: 700; }
.plan-card .pr { font-size: 13.5px; color: var(--ink-2); margin-top: 9px; }
.plan-card.feat::before {
    content: "★"; position: absolute; top: -9px; inset-inline-end: 12px; font-size: 15px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 99px; width: 26px; height: 26px;
    display: grid; place-items: center; color: #e8a13c;
}

.order-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 10px; background: var(--paper); }
.order-card .orow { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.order-card .ref { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.order-card .meta { font-size: 12.5px; color: var(--muted); }
.steps { display: flex; gap: 0; counter-reset: s; }
.step { flex: 1; position: relative; text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 26px; }
.step::before {
    counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--paper);
    display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.step::after { content: ""; position: absolute; top: 10px; inset-inline-start: calc(50% + 12px); width: calc(100% - 24px); height: 1.5px; background: var(--line); }
.step:last-child::after { display: none; }
.step.done::before { background: #0d0d0d; border-color: #0d0d0d; color: #fff; }
[data-theme="dark"] .step.done::before { background: #fff; border-color: #fff; color: #0d0d0d; }
.acc-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; background: var(--wash); border: 1px dashed var(--line-2); border-radius: 10px; padding: 9px 12px; }
.acc-line b { font-family: var(--mono); letter-spacing: .02em; }

/* usage extras */
.bar-row td { padding: 9px 16px; }
.bar { display: block; height: 7px; border-radius: 99px; background: linear-gradient(90deg, #1a1a1a, #777); min-width: 3px; }
[data-theme="dark"] .bar { background: linear-gradient(90deg, #fff, #8a8a8a); }

.pgrid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: start; }

.pscrim { display: none; }

@media (max-width: 980px) {
    .portal-shell { grid-template-columns: 1fr; padding-top: 18px; }
    .pburger { display: inline-grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 6px; }
    .pside {
        position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 95; width: 262px; border-radius: 0 20px 20px 0;
        transform: translateX(calc(-100% - 10px)); transition: transform .22s ease; overflow: auto;
        box-shadow: 30px 0 80px -40px rgba(0,0,0,.5);
    }
    [dir="rtl"] .pside { transform: translateX(calc(100% + 10px)); }
    .pside.open { transform: none; }
    .pscrim { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: .2s; }
    .pscrim.on { opacity: 1; pointer-events: auto; }
    .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .ptop-in { padding: 0 14px; }
    .pbrand em { display: none; }
    .portal-shell { padding-inline: 14px; }
    .pstat .val { font-size: 22px; }
    .ptable { font-size: 13px; }
    .ptable th, .ptable td { padding-inline: 10px; }
}


/* developers page numbered cards (own namespaced classes — portal .steps/.step
   is a horizontal wizard stepper and must not leak here) */
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.step3 { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 16px 18px; }
.step3 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.step3 h3 { font-size: 14.5px; margin-bottom: 3px; }
.step3 p { font-size: 12.5px; color: var(--muted); word-break: break-word; }
@media (max-width: 860px) {
    .steps3 { grid-template-columns: 1fr; }
}

/* ---- v8 fix: the console-era .reveal BOX (border+padding) collided with the
   v5 scroll-animation .reveal. Marketing pages animate; the portal reveal
   banner keeps the box look and must never sit at opacity 0. ---- */
.portal-main .reveal { opacity: 1; transform: none; }
@media (max-width: 860px) {
    .portal-main .reveal { margin-top: 8px; }
}

/* ---- v8 mobile patches (must sit after everything they tune) ---- */
@media (max-width: 860px) {
    .split { gap: 28px; }
    .err-row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 2px; }
    .err-row > div:last-child { grid-column: 1 / -1; padding-inline-start: 2px; }
    .err-row.head > div:nth-child(3) { display: none; }
    .logo-mark.logo-img img { width: 100%; height: 100%; object-fit: cover; }
}
