/* =====================================================================
   SMART GUARDIAN — CORE DESIGN SYSTEM
   Cyber Neon · Glass · Depth
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
:root {
    /* Surfaces */
    --void:        #03060a;
    --void-flat:   #020406;   /* inner pages — black, no texture */
    --deep:        #060b11;
    --graphite:    #0d141b;
    --graphite-2:  #121b24;
    --panel:       rgba(13, 21, 28, 0.66);
    --panel-solid: #0b1219;
    --glass:       rgba(255, 255, 255, 0.035);
    --glass-2:     rgba(255, 255, 255, 0.06);

    /* Neon spectrum */
    --neon:      #6bff7a;
    --neon-dim:  #3ecf5a;
    --lime:      #c8ff38;
    --glow:      #39ff9c;
    --aqua:      #2ff2d0;
    --ice:       #7fe9ff;

    /* Semantic */
    --danger:  #ff3d63;
    --warn:    #ffb02e;
    --caution: #ff7a3d;
    --info:    #59b6ff;
    --profit:  #56ff8f;
    --loss:    #ff4d6d;

    /* Type */
    --txt:       #e6f3ea;
    --txt-soft:  #a9c2b4;
    --txt-mute:  #6c8578;
    --txt-faint: #47594f;

    /* Lines */
    --line:      rgba(107, 255, 122, 0.12);
    --line-soft: rgba(255, 255, 255, 0.06);
    --line-hot:  rgba(107, 255, 122, 0.42);

    /* Glow shadows */
    --glow-sm: 0 0 12px rgba(107, 255, 122, 0.35);
    --glow-md: 0 0 24px rgba(107, 255, 122, 0.28), 0 0 60px rgba(107, 255, 122, 0.12);
    --glow-lg: 0 0 40px rgba(107, 255, 122, 0.32), 0 0 120px rgba(107, 255, 122, 0.16);
    --shadow:  0 18px 50px rgba(0, 0, 0, 0.55);
    --shadow-2: 0 30px 80px rgba(0, 0, 0, 0.65);

    /* Geometry */
    --r-sm: 10px;
    --r:    16px;
    --r-lg: 22px;
    --r-xl: 30px;

    /* Motion */
    --ease:      cubic-bezier(0.22, 1, 0.36, 1);
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.18s;
    --t:      0.32s;
    --t-slow: 0.6s;

    /* Fonts — system stack, zero network requests, perfect for CSP */
    --font: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;

    --header-h: 74px;
    --rail-w: 264px;
}

/* ---------------------------------------------------------------------
   2. Reset
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

/*
   Reserve the scrollbar's width at all times. Without it, any change that
   makes the document taller or shorter adds or removes the scrollbar and
   shifts the whole layout sideways — which reads as the page twitching.
*/
html {
    scrollbar-gutter: stable;
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--void);
    color: var(--txt);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

/* An icon dropped inline with no class and no explicit size follows the text.
   Component rules below (.btn svg, .tile .ico svg, …) override this. */
svg:not([class]):not([width]) {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

::selection { background: rgba(107, 255, 122, 0.28); color: #fff; }

:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #05090d; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(107,255,122,.35), rgba(107,255,122,.12));
    border-radius: 10px;
    border: 2px solid #05090d;
}
::-webkit-scrollbar-thumb:hover { background: rgba(107,255,122,.5); }

/* ---------------------------------------------------------------------
   3. Ambient background system
   --------------------------------------------------------------------- */
.bg-stack {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(1200px 800px at 12% -10%, rgba(57, 255, 156, 0.10), transparent 60%),
        radial-gradient(900px 700px at 92% 8%, rgba(47, 242, 208, 0.07), transparent 62%),
        radial-gradient(1000px 900px at 50% 115%, rgba(200, 255, 56, 0.06), transparent 60%),
        linear-gradient(180deg, #03060a 0%, #04080d 45%, #03060a 100%);
}

/*
   Inner pages get a flat, near-black field instead of the stack above.

   The landing page earns its drifting grid and glow: it is a first
   impression with nothing to read. Behind a dashboard the same texture
   sits under live numbers and moves while the eye is trying to hold a
   figure still, so the app and admin shells drop it entirely and let the
   panels carry the depth on their own.
*/
.bg-stack.bg-flat { background: var(--void-flat); }

/* ---- Terminal backdrop (front-of-house pages) ----------------------
   A live console types behind the page. Two things keep it a backdrop
   rather than a distraction: the canvas is masked so it thins out under
   the headline, and a scrim sits on top of it to guarantee the copy wins
   even when a bright burst of output lands in the middle of the screen.
   -------------------------------------------------------------------- */
/*
   Depth, not flat black. A single light source sits behind the hero and the
   field cools as it falls away from it, so the page has somewhere to look
   before it has anything to read.
*/
.bg-stack.bg-terminal {
    background:
        radial-gradient(720px 540px at 50% 28%, rgba(28, 96, 58, .40), transparent 66%),
        radial-gradient(1000px 620px at 10% 2%,  rgba(12, 52, 50, .30), transparent 68%),
        radial-gradient(1000px 620px at 90% 6%,  rgba(16, 50, 34, .26), transparent 68%),
        radial-gradient(1300px 560px at 50% 106%, rgba(24, 68, 34, .26), transparent 72%),
        linear-gradient(180deg, #05090d 0%, #03070a 44%, #04080b 100%);
}

/*
   The console is texture, not copy. At full strength it was a second column
   of text competing with the page's own words, which is what made the
   layout read as noisy — dropping it to roughly a third, at a smaller size,
   keeps the atmosphere and gives the words back their weight.
*/
canvas.bg-code {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    /* Held in a variable, not written straight onto opacity, because the
       flicker below animates opacity — and an animated property beats a
       plain declaration no matter how specific that declaration is. Set
       directly, the phone's lower value was simply overwritten by the
       first keyframe and never applied at all: the backdrop stayed at
       full strength on exactly the screen with least room for it. */
    --code-op: .30;
    opacity: var(--code-op);
    /* Thinned across the centre column, where the page's own words live,
       and left alone down the flanks. This is a mask on the canvas rather
       than a dark panel laid over it: a panel would dim the glow behind the
       hero too, and the glow is the thing giving the page its depth. */
    mask-image: linear-gradient(90deg,
        rgba(0,0,0,.55) 0%, #000 6%, rgba(0,0,0,.80) 13%, rgba(0,0,0,.16) 28%,
        rgba(0,0,0,.09) 50%,
        rgba(0,0,0,.16) 72%, rgba(0,0,0,.80) 87%, #000 94%, rgba(0,0,0,.55) 100%);
    -webkit-mask-image: linear-gradient(90deg,
        rgba(0,0,0,.55) 0%, #000 6%, rgba(0,0,0,.80) 13%, rgba(0,0,0,.16) 28%,
        rgba(0,0,0,.09) 50%,
        rgba(0,0,0,.16) 72%, rgba(0,0,0,.80) 87%, #000 94%, rgba(0,0,0,.55) 100%);
    animation: crtFlicker 7s steps(1, end) infinite;
}

/* A phone stacks rather than columns, so the clearing has to be horizontal
   too: an ellipse over the lower half, where the headline and paragraph
   sit, instead of a centre column that would blank the whole screen. */
@media (max-width: 720px) {
    canvas.bg-code {
        --code-op: .17;
        mask-image: radial-gradient(ellipse 104% 50% at 50% 68%,
            rgba(0,0,0,.05) 0%, rgba(0,0,0,.28) 48%, #000 90%);
        -webkit-mask-image: radial-gradient(ellipse 104% 50% at 50% 68%,
            rgba(0,0,0,.05) 0%, rgba(0,0,0,.28) 48%, #000 90%);
    }
}

/* A real phosphor screen is never perfectly steady. Rare and shallow —
   a regular pulse would read as a broken animation, not as a CRT. */
/* Proportional to whatever strength the screen size settled on, so the
   phone flickers around its own dimmer level instead of being yanked
   back up to the desktop one four times a cycle. */
@keyframes crtFlicker {
    0%, 91%, 100% { opacity: var(--code-op); }
    92%           { opacity: calc(var(--code-op) * .80); }
    93%           { opacity: calc(var(--code-op) * 1.13); }
    94%           { opacity: calc(var(--code-op) * .90); }
}

/* Keeps the navigation off the console text without darkening the page. */
.bg-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 7, 10, .74) 0, rgba(3, 7, 10, .22) 84px, transparent 150px);
}

/* Digital grid */
.bg-grid {
    position: absolute;
    inset: -40% -10%;
    background-image:
        linear-gradient(rgba(107, 255, 122, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 255, 122, 0.055) 1px, transparent 1px);
    background-size: 62px 62px;
    transform: perspective(600px) rotateX(58deg) translateZ(0);
    transform-origin: 50% 0%;
    mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, #000 20%, transparent 78%);
    animation: gridDrift 26s linear infinite;
    opacity: 0.75;
}

@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 62px, 62px 0; }
}

/* Moving light sweep */
.bg-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 38%, rgba(107, 255, 122, 0.055) 50%, transparent 62%);
    background-size: 300% 300%;
    animation: sweep 14s var(--ease-soft) infinite;
}

@keyframes sweep {
    0%   { background-position: 120% 0%; }
    100% { background-position: -40% 100%; }
}

/* Scanline texture */
.bg-scan {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
    opacity: .35;
    mix-blend-mode: multiply;
}

/* Vignette */
.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.72) 100%);
}

canvas.bg-particles { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------------------------------------------------------------
   4. Typography helpers
   --------------------------------------------------------------------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--neon);
    opacity: .85;
}

.muted  { color: var(--txt-mute); }
.soft   { color: var(--txt-soft); }
.faint  { color: var(--txt-faint); }
.profit { color: var(--profit); }
.loss   { color: var(--loss); }

.gradient-text {
    background: linear-gradient(100deg, #ffffff 0%, var(--neon) 42%, var(--lime) 78%, var(--aqua) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.glow-text { text-shadow: 0 0 18px rgba(107, 255, 122, 0.55); }

/* ---------------------------------------------------------------------
   5. Glass surfaces
   --------------------------------------------------------------------- */
.glass {
    position: relative;
    background:
        linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.012) 42%, rgba(255,255,255,0) 100%),
        var(--panel);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.055);
}

/* Neon top edge that lights up on hover */
.glass::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(107,255,122,.55), transparent);
    opacity: .5;
    transition: opacity var(--t) var(--ease);
}

.glass:hover::before { opacity: 1; }

.card {
    composes: glass;
    padding: 22px;
}

.card-lift {
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
    will-change: transform;
}

.card-lift:hover {
    transform: translateY(-4px);
    border-color: var(--line-hot);
    box-shadow: var(--shadow-2), var(--glow-sm), inset 0 1px 0 rgba(255,255,255,.08);
}

/* Reflection strip under featured cards */
.reflect::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -22px;
    height: 22px;
    background: linear-gradient(180deg, rgba(107,255,122,.16), transparent);
    filter: blur(9px);
    border-radius: 50%;
    opacity: .6;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   6. Buttons
   --------------------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    isolation: isolate;
    border: 1px solid var(--line-soft);
    background: var(--glass);
    color: var(--txt);
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease),
                border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}

.btn:hover  { transform: translateY(-2px); border-color: var(--line-hot); }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }

.btn svg { width: 17px; height: 17px; flex: none; }

/* Primary — the signature glow button */
.btn-primary {
    background: linear-gradient(135deg, var(--neon) 0%, #4ee36a 45%, var(--lime) 100%);
    color: #04140a;
    border-color: transparent;
    font-weight: 750;
    box-shadow: 0 8px 26px rgba(107, 255, 122, 0.28), inset 0 1px 0 rgba(255,255,255,.45);
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
    background-size: 250% 100%;
    background-position: 180% 0;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--t) var(--ease);
}

.btn-primary:hover {
    box-shadow: 0 12px 40px rgba(107, 255, 122, 0.45), 0 0 60px rgba(107,255,122,.22), inset 0 1px 0 rgba(255,255,255,.5);
}

.btn-primary:hover::after { opacity: 1; animation: shine 1.1s var(--ease-soft); }

@keyframes shine {
    from { background-position: 180% 0; }
    to   { background-position: -80% 0; }
}

.btn-ghost {
    background: rgba(107, 255, 122, 0.05);
    border-color: rgba(107, 255, 122, 0.28);
    color: var(--neon);
}
.btn-ghost:hover {
    background: rgba(107, 255, 122, 0.11);
    box-shadow: var(--glow-sm);
}

.btn-outline { background: transparent; border-color: var(--line-soft); color: var(--txt-soft); }
.btn-outline:hover { color: var(--txt); border-color: var(--line-hot); }

.btn-danger {
    background: rgba(255, 61, 99, 0.10);
    border-color: rgba(255, 61, 99, 0.35);
    color: #ff8ba1;
}
.btn-danger:hover {
    background: rgba(255, 61, 99, 0.18);
    box-shadow: 0 0 22px rgba(255, 61, 99, 0.3);
}

.btn-lg { padding: 16px 34px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: 11px; }
.btn-icon svg { width: 18px; height: 18px; }

/* In-button spinner */
.btn.is-loading::before {
    content: "";
    width: 15px; height: 15px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   7. Forms
   --------------------------------------------------------------------- */
.field { position: relative; margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--txt-mute);
}

.input, .select, textarea.input {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    background: rgba(4, 8, 12, 0.62);
    border: 1px solid var(--line-soft);
    color: var(--txt);
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.input::placeholder { color: var(--txt-faint); }

.input:hover, .select:hover { border-color: rgba(107,255,122,.24); }

.input:focus, .select:focus, textarea.input:focus {
    outline: none;
    border-color: var(--neon);
    background: rgba(6, 12, 16, 0.85);
    box-shadow: 0 0 0 3px rgba(107, 255, 122, 0.13), var(--glow-sm);
}

.input.has-icon { padding-left: 44px; }

.field-icon {
    position: absolute;
    left: 15px;
    top: 41px;
    width: 17px;
    height: 17px;
    color: var(--txt-faint);
    pointer-events: none;
    transition: color var(--t) var(--ease);
}

.field:focus-within .field-icon { color: var(--neon); }

.select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c8578' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.select option { background: #0b1219; color: var(--txt); }

.hint  { margin-top: 7px; font-size: 12px; color: var(--txt-faint); line-height: 1.5; }
.error-text { margin-top: 7px; font-size: 12.5px; color: #ff8ba1; }

/* Password strength */
.strength { display: flex; gap: 5px; margin-top: 9px; }
.strength i {
    flex: 1; height: 3px; border-radius: 3px;
    background: rgba(255,255,255,.08);
    transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--lime); }
.strength[data-level="4"] i { background: var(--neon); box-shadow: 0 0 8px rgba(107,255,122,.6); }

/* Checkbox */
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 13px; color: var(--txt-soft); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
    flex: none;
    width: 19px; height: 19px;
    margin-top: 1px;
    border: 1.5px solid var(--line-soft);
    border-radius: 6px;
    background: rgba(4,8,12,.6);
    display: grid;
    place-items: center;
    transition: all var(--t) var(--ease);
}
.check .box::after {
    content: "";
    width: 9px; height: 5px;
    border: 2px solid #04140a;
    border-top: 0; border-right: 0;
    transform: rotate(-45deg) scale(0);
    transition: transform var(--t) var(--ease);
}
.check input:checked + .box {
    background: var(--neon);
    border-color: var(--neon);
    box-shadow: var(--glow-sm);
}
.check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .box { outline: 2px solid var(--neon); outline-offset: 2px; }

/* Toggle */
.toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track {
    width: 46px; height: 25px;
    border-radius: 99px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line-soft);
    position: relative;
    transition: all var(--t) var(--ease);
}
.toggle .track::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: var(--txt-mute);
    transition: all var(--t) var(--ease);
}
.toggle input:checked + .track {
    background: rgba(107,255,122,.22);
    border-color: var(--neon);
}
.toggle input:checked + .track::after {
    left: 23px;
    background: var(--neon);
    box-shadow: 0 0 12px rgba(107,255,122,.8);
}

/* ---------------------------------------------------------------------
   8. Badges & pills
   --------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-neon    { background: rgba(107,255,122,.12); color: var(--neon);   border-color: rgba(107,255,122,.32); }
.badge-lime    { background: rgba(200,255,56,.12);  color: var(--lime);   border-color: rgba(200,255,56,.3); }
.badge-aqua    { background: rgba(47,242,208,.12);  color: var(--aqua);   border-color: rgba(47,242,208,.3); }
.badge-danger  { background: rgba(255,61,99,.12);   color: #ff7d97;       border-color: rgba(255,61,99,.32); }
.badge-warn    { background: rgba(255,176,46,.12);  color: var(--warn);   border-color: rgba(255,176,46,.32); }
.badge-caution { background: rgba(255,122,61,.12);  color: var(--caution);border-color: rgba(255,122,61,.32); }
.badge-info    { background: rgba(89,182,255,.12);  color: var(--info);   border-color: rgba(89,182,255,.3); }
.badge-mute    { background: rgba(255,255,255,.05); color: var(--txt-mute); border-color: var(--line-soft); }

.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.pulse .dot { animation: dotPulse 1.8s var(--ease-soft) infinite; }

@keyframes dotPulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: .35; transform: scale(.7); }
}

/* Risk level colours, one source of truth */
.risk-safe     { --risk: var(--neon);    }
.risk-moderate { --risk: var(--lime);    }
.risk-warning  { --risk: var(--warn);    }
.risk-danger   { --risk: var(--caution); }
.risk-critical { --risk: var(--danger);  }

.badge-risk {
    background: color-mix(in srgb, var(--risk) 14%, transparent);
    color: var(--risk);
    border-color: color-mix(in srgb, var(--risk) 34%, transparent);
}

/* ---------------------------------------------------------------------
   8b. Brand lockup (shared by the landing nav, the app rail and admin)
   --------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
    position: relative;
    flex: none;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: linear-gradient(140deg, rgba(107,255,122,.22), rgba(200,255,56,.08));
    border: 1px solid rgba(107,255,122,.34);
    box-shadow: var(--glow-sm), inset 0 1px 0 rgba(255,255,255,.15);
}

.brand-mark svg { width: 21px; height: 21px; color: var(--neon); }

.brand-mark::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 16px;
    border: 1px solid rgba(107,255,122,.18);
    animation: neonPulse 3s var(--ease-soft) infinite;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
    min-width: 0;
}

.brand-text b {
    font-size: 15.5px;
    font-weight: 750;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text span {
    font-size: 9.5px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--txt-mute);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
   8c. Language switch
   --------------------------------------------------------------------- */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 650;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .035);
    color: var(--txt-soft);
    transition: all var(--t) var(--ease);
    white-space: nowrap;
}

.lang-switch:hover {
    border-color: var(--line-hot);
    color: var(--neon);
    background: rgba(107, 255, 122, .07);
    box-shadow: var(--glow-sm);
    transform: translateY(-1px);
}

.lang-switch svg { width: 15px; height: 15px; opacity: .8; flex: none; }
.lang-switch b { font-weight: 750; }

/* ---------------------------------------------------------------------
   9. Toast
   --------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 11px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 17px;
    border-radius: 14px;
    background: linear-gradient(150deg, rgba(20,30,38,.96), rgba(10,16,22,.96));
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
    animation: toastIn .42s var(--ease) both;
    overflow: hidden;
    position: relative;
}

.toast.out { animation: toastOut .3s var(--ease-soft) forwards; }

.toast::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--tone, var(--neon));
    box-shadow: 0 0 16px var(--tone, var(--neon));
}

.toast .ico {
    flex: none;
    width: 32px; height: 32px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--tone, var(--neon)) 15%, transparent);
    color: var(--tone, var(--neon));
}
.toast .ico svg { width: 17px; height: 17px; }
.toast .body { flex: 1; min-width: 0; }
.toast .title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.toast .msg { font-size: 12.5px; color: var(--txt-soft); word-wrap: break-word; }
.toast .close { color: var(--txt-faint); padding: 2px; transition: color var(--t) var(--ease); }
.toast .close:hover { color: var(--txt); }

.toast-success { --tone: var(--neon); }
.toast-error   { --tone: var(--danger); }
.toast-warning { --tone: var(--warn); }
.toast-info    { --tone: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px) scale(.94); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(.95); }
}

/* ---------------------------------------------------------------------
   10. Skeleton loading
   --------------------------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,.045);
    border-radius: 8px;
    color: transparent !important;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(107,255,122,.11), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.sk-line { height: 12px; margin-bottom: 9px; }
.sk-line.w-40 { width: 40%; } .sk-line.w-60 { width: 60%; } .sk-line.w-80 { width: 80%; }
.sk-card { height: 216px; border-radius: var(--r); }

/* ---------------------------------------------------------------------
   11. Shared animation utilities
   --------------------------------------------------------------------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
    0%   { opacity: 0; transform: scale(.9); }
    70%  { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}
@keyframes neonPulse {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}
@keyframes ringExpand {
    0%   { transform: scale(.6); opacity: .85; }
    100% { transform: scale(2.1); opacity: 0; }
}

.reveal { opacity: 0; animation: fadeUp .8s var(--ease) forwards; }
.reveal[data-d="1"] { animation-delay: .08s; }
.reveal[data-d="2"] { animation-delay: .16s; }
.reveal[data-d="3"] { animation-delay: .24s; }
.reveal[data-d="4"] { animation-delay: .32s; }
.reveal[data-d="5"] { animation-delay: .40s; }
.reveal[data-d="6"] { animation-delay: .48s; }

/* Elements revealed on scroll */
.on-scroll { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.on-scroll.visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   12. Layout utilities
   --------------------------------------------------------------------- */
.wrap { width: min(1320px, calc(100% - 44px)); margin-inline: auto; }
.wrap-sm { width: min(560px, calc(100% - 36px)); margin-inline: auto; }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.wrapflex { flex-wrap: wrap; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 22px 0; }

.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:34px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:34px}
.text-c { text-align: center; }
.text-r { text-align: right; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.rel { position: relative; }

.f11{font-size:11px}.f12{font-size:12px}.f13{font-size:13px}.f14{font-size:14px}
.f16{font-size:16px}.f18{font-size:18px}.f20{font-size:20px}.f24{font-size:24px}
.f28{font-size:28px}.f34{font-size:34px}
.w600{font-weight:600}.w700{font-weight:700}.w800{font-weight:800}

/* Section title */
.sec-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.sec-title h2 { font-size: 19px; }
.sec-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* Empty state */
.empty {
    display: grid;
    place-items: center;
    gap: 14px;
    padding: 58px 24px;
    text-align: center;
    color: var(--txt-mute);
}
.empty .ring {
    width: 88px; height: 88px;
    border-radius: 50%;
    display: grid; place-items: center;
    border: 1px dashed rgba(107,255,122,.28);
    background: radial-gradient(circle, rgba(107,255,122,.08), transparent 70%);
    animation: floatY 4.5s var(--ease-soft) infinite;
}
.empty .ring svg { width: 34px; height: 34px; color: var(--neon); opacity: .8; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.data th {
    text-align: left;
    padding: 12px 15px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--txt-mute);
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}
table.data td { padding: 13px 15px; border-bottom: 1px solid rgba(255,255,255,.035); vertical-align: middle; }
table.data tbody tr { transition: background var(--t-fast) var(--ease); }
table.data tbody tr:hover { background: rgba(107,255,122,.035); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* Pagination */
.pager { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.pager a, .pager span {
    min-width: 38px; height: 38px;
    display: grid; place-items: center;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    border: 1px solid var(--line-soft);
    background: var(--glass);
    color: var(--txt-soft);
    transition: all var(--t-fast) var(--ease);
}
.pager a:hover { border-color: var(--line-hot); color: var(--txt); transform: translateY(-2px); }
.pager .active { background: rgba(107,255,122,.15); border-color: var(--neon); color: var(--neon); box-shadow: var(--glow-sm); }

/* Avatar chip */
.avatar {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 800;
    letter-spacing: .02em;
    color: #04140a;
    background: linear-gradient(135deg, var(--neon), var(--lime));
    box-shadow: 0 4px 16px rgba(107,255,122,.3);
}
.avatar.sm { width: 32px; height: 32px; font-size: 11px; border-radius: 10px; }
.avatar.lg { width: 60px; height: 60px; font-size: 19px; border-radius: 18px; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(2, 5, 8, .78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid; place-items: center;
    padding: 22px;
    animation: fadeIn .25s var(--ease) both;
}
.modal {
    width: min(520px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: 26px;
    animation: popIn .38s var(--ease) both;
}
.modal h3 { font-size: 19px; margin-bottom: 6px; }

/* Progress meter */
.meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.meter i {
    display: block; height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--risk, var(--neon)), color-mix(in srgb, var(--risk, var(--neon)) 55%, #fff));
    box-shadow: 0 0 12px var(--risk, var(--neon));
    transition: width .6s var(--ease);
}

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 7px 11px;
    border-radius: 8px;
    background: #0d151c;
    border: 1px solid var(--line-soft);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--txt-soft);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--t) var(--ease);
    z-index: 60;
    box-shadow: var(--shadow);
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------------
   13. Accessibility & responsive
   --------------------------------------------------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -60px; left: 16px; z-index: 9999;
    padding: 11px 18px; border-radius: 0 0 12px 12px;
    background: var(--neon); color: #04140a; font-weight: 700;
    transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 0; }

@media (max-width: 1080px) {
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .wrap { width: calc(100% - 28px); }
    .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
    .toast-stack { top: auto; bottom: 16px; right: 14px; left: 14px; width: auto; }
    .btn-lg { padding: 14px 24px; font-size: 14.5px; }
}

/* ---------------------------------------------------------------------
   Legal documents — reading view and admin editor
   --------------------------------------------------------------------- */
.legal-page { display: grid; gap: 16px; }
.legal-page-guest { min-height: 100svh; padding: 92px clamp(14px, 3vw, 26px) 60px; align-content: start; }

/* ---- Document switcher ---- */
.legal-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.legal-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 11px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .03);
    color: var(--txt-mute);
    font-size: 12.5px;
    font-weight: 600;
    transition: all var(--t) var(--ease);
}
.legal-tab svg { width: 15px; height: 15px; }
.legal-tab:hover { color: var(--txt-soft); border-color: rgba(107, 255, 122, .28); }
.legal-tab.is-on {
    background: rgba(107, 255, 122, .12);
    border-color: rgba(107, 255, 122, .45);
    color: var(--neon);
}

/*
   Index beside the text on a wide screen, above it on a narrow one.
   A seventeen-section agreement without one is a scroll bar and hope.
*/
.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }

.legal-index {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    padding: 18px 16px;
    max-height: calc(100svh - var(--header-h) - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.legal-index-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 10.5px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--txt-faint);
}
.legal-index-head svg { width: 14px; height: 14px; }
.legal-index ol { list-style: none; counter-reset: sec; display: grid; gap: 1px; }
.legal-index li { counter-increment: sec; }
.legal-index a {
    display: flex; gap: 9px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--txt-mute);
    transition: all var(--t-fast) var(--ease);
}
.legal-index a::before {
    content: counter(sec);
    flex: 0 0 auto;
    min-width: 17px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--txt-faint);
}
.legal-index a:hover { background: rgba(107, 255, 122, .07); color: var(--txt); }
.legal-index a:hover::before { color: var(--neon); }

/* ---- The document ---- */
.legal-sheet { padding: clamp(20px, 3.4vw, 40px); }

.legal-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.legal-head h1 { font-size: clamp(21px, 3vw, 30px); margin-bottom: 12px; }
.legal-stamp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.legal-ro {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--txt-faint);
}
.legal-ro svg { width: 13px; height: 13px; }

.legal-body {
    /* Long-form reading, so the measure is capped: a legal clause running
       the full width of a desktop is where eyes lose the line. */
    max-width: 68ch;
    line-height: 1.95;
    color: var(--txt-soft);
    font-size: 14px;
}

/* Numbered sections, each announced rather than run together. h2 and h3
   are both section heads — the documents use one, an editor may use the
   other, and either way it is a section. */
.legal-body h2,
.legal-body h3 {
    font-size: clamp(16px, 2vw, 19px);
    margin: 34px 0 12px;
    padding-inline-start: 13px;
    border-inline-start: 3px solid var(--neon);
    color: var(--txt);
    line-height: 1.45;
    scroll-margin-top: calc(var(--header-h) + 20px);
}
.legal-body h2:first-child,
.legal-body h3:first-child { margin-top: 0; }
.legal-body h4 { font-size: 14.5px; margin: 22px 0 8px; color: var(--txt); }
.legal-body p  { margin: 0 0 14px; }

.legal-body ul { margin: 4px 0 16px; padding: 0; list-style: none; display: grid; gap: 7px; }
.legal-body li { position: relative; padding-inline-start: 18px; }
.legal-body li::before {
    content: "";
    position: absolute;
    inset-inline-start: 3px;
    top: .72em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--neon);
    opacity: .55;
}

.legal-body strong { color: var(--txt); font-weight: 700; }
.legal-body code { font-family: var(--mono); font-size: .88em; color: var(--neon); }
.legal-body hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-soft) 40%, var(--line-soft) 60%, transparent);
    margin: 4px 0;
}

@media (max-width: 900px) {
    .legal-grid { grid-template-columns: minmax(0, 1fr); }
    .legal-index { position: static; max-height: none; }
    .legal-index ol { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .legal-body { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    /* Entrance animations start at opacity 0 — without them the content must
       still be visible. Never trade motion preference for missing content. */
    .reveal, .on-scroll, .hero-badge, .hero h1, .hero-sub,
    .hero-trust, .scroll-cue, .pos-card, .tl-item, .user-card, .mini-pos,
    .auth-card, .modal, .toast, .notif-panel {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Purely decorative perpetual motion is switched off entirely */
    .bg-grid, .bg-sweep, .radar::before, .core, .core::before, .core::after,
    .orbit, .coin-body, .pulse-rings i, .rail-guard .beacon::after,
    .brand-mark::after, .api-status-orb::after, .empty .ring {
        animation: none !important;
    }
}

@media print {
    .bg-stack, .toast-stack, .app-rail, .app-top { display: none !important; }
    body { background: #fff; color: #000; }
}
