/*
 * Tradez.eu — landing page (v5 design system extensions)
 * Inspired by the "fintech / Linear / Robinhood" + editorial concepts.
 * All rules scoped under .app like v5.css unless they target the cookie banner
 * or the lightbox (both render outside .app).
 */

/* The landing page paints to the edge — match shell bg early to avoid white flash. */
html, body { background: #f5f1e8; }
html[data-bs-theme="dark"], html[data-bs-theme="dark"] body { background: #16181a; }

/* The shell's <main> is the central column on app pages. On the landing
 * page we want a slightly wider canvas so editorial sections breathe. */
.app.landing .main {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 32px 80px;
}

/* Public topbar: simple nav links instead of the in-app navbar. */
.app .topbar .landing-nav { gap: 6px; }
.app .topbar .landing-nav a { font-size: 13px; padding: 8px 12px; }

/* Sign in: text link, not a button. Lets the primary "Play now" button win. */
.app .signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--rule-strong, var(--rule));
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.1px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.app .signin-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.app.theme-dark .signin-btn {
    border-color: color-mix(in srgb, var(--text) 28%, transparent);
    color: var(--text);
}
.app.theme-dark .signin-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.app .m-topbar .signin-btn { height: 30px; padding: 0 12px; font-size: 12.5px; }

/* Big-button helper used on hero/CTAs. */
.app .btn.lg {
    font-size: 14px;
    padding: 11px 22px;
    font-weight: 500;
    border-radius: 6px;
}

/* ===================== EDITORIAL TYPE ===================== */

/* Live pulse dot — used in eyebrow + ticker tag. */
.app .live-dot {
    display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: live-pulse 2s ease-out infinite;
    vertical-align: 1px;
    margin-right: 8px;
}
@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(184, 104, 13, 0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(184, 104, 13, 0); }
    100% { box-shadow: 0 0 0 0 rgba(184, 104, 13, 0); }
}
.app.theme-dark .live-dot {
    animation-name: live-pulse-dark;
}
@keyframes live-pulse-dark {
    0%   { box-shadow: 0 0 0 0 rgba(216, 155, 58, 0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(216, 155, 58, 0); }
    100% { box-shadow: 0 0 0 0 rgba(216, 155, 58, 0); }
}

/* Editorial label (§ THE SYSTEMS) — mono, accent-tinted, all caps. */
.app .ed-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2.5px;
    color: var(--accent);
    margin-bottom: 14px;
}
.app .ed-label.centered { text-align: center; }

/* Section headline + deck — the editorial treatment. */
.app .ed-headline {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 14px;
}
.app .ed-deck {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-2);
    max-width: 640px;
    margin: 0 0 32px;
}
.app .accent-word {
    color: var(--accent);
    font-style: italic;
}

/* ===================== HERO ===================== */
.app .landing-hero {
    padding: 32px 0 28px;
    position: relative;
}
.app .landing-hero-inner {
    position: relative;
    z-index: 1;
}

/* ===================== HERO CHART (cumulative wholesale volume, 30d) =====================
   Decorative + interactive. Single 2px amber stroke with a subtle area fill,
   floating end-of-line value, hover guideline + tooltip. Hidden on mobile. */
.app .hero-chart {
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    width: 44%;
    max-width: 560px;
    height: 220px;
    color: var(--accent);
    /* Sit above .landing-hero-inner (z-index:1) so the SVG can receive mouse
       events for the hover tooltip. The container itself is pointer-events:none
       so the H1/subhead/CTAs underneath stay fully clickable; only the SVG
       (pointer-events:auto, below) captures events over the chart area. */
    z-index: 2;
    pointer-events: none;
}
.app .hero-chart-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: auto;
}
.app .hero-chart-line { fill: none; }
.app .hero-chart-area { opacity: 1; }

/* Top-left kicker label. */
.app .hero-chart-label {
    position: absolute;
    top: -4px;
    left: 0;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-2);
    opacity: 0.7;
    white-space: nowrap;
}
.app .hero-chart-label .hcl-tag {
    border-left: 2px solid var(--accent);
    padding-left: 8px;
}

/* Floating end-value annotation, mono, sits next to the end dot. */
.app .hero-chart-value {
    position: absolute;
    transform: translate(12px, -50%);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--accent);
    white-space: nowrap;
    pointer-events: none;
}

/* Hover tooltip. */
.app .hero-chart-tip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 10px));
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.app .hero-chart-tip .tip-date {
    color: var(--muted);
    margin-right: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 9.5px;
}
.app .hero-chart-tip .tip-value {
    color: var(--accent);
    font-weight: 600;
}

/* ---- Animation (≈1.1s, plays once per session). ---- */
.app .hero-chart.is-animating .hero-chart-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: hero-chart-draw 950ms cubic-bezier(0.65, 0, 0.35, 1) 150ms forwards;
}
.app .hero-chart.is-animating .hero-chart-area {
    opacity: 0;
    animation: hero-chart-fade-in 350ms cubic-bezier(0.65, 0, 0.35, 1) 750ms forwards;
}
.app .hero-chart.is-animating .hero-chart-dot {
    opacity: 0;
    transform: scale(0.6);
    transform-box: fill-box;
    transform-origin: center;
    animation: hero-chart-dot-in 200ms cubic-bezier(0.65, 0, 0.35, 1) 1100ms forwards;
}
.app .hero-chart.is-animating .hero-chart-value {
    opacity: 0;
    animation: hero-chart-value-in 200ms ease-out 1200ms forwards;
}

@keyframes hero-chart-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes hero-chart-fade-in {
    to { opacity: 1; }
}
@keyframes hero-chart-dot-in {
    to { opacity: 1; transform: scale(1); }
}
@keyframes hero-chart-value-in {
    to { opacity: 1; }
}

/* Loading state: flat dotted baseline, no animation, label still shown. */
.app .hero-chart.hero-chart-empty .hero-chart-empty-line {
    opacity: 0.35;
}

/* Reduced-motion: render the final state instantly. Non-negotiable. */
@media (prefers-reduced-motion: reduce) {
    .app .hero-chart.is-animating .hero-chart-line,
    .app .hero-chart.is-animating .hero-chart-area,
    .app .hero-chart.is-animating .hero-chart-dot,
    .app .hero-chart.is-animating .hero-chart-value {
        animation: none;
        opacity: 1;
        transform: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
    .app .hero-chart.is-animating .hero-chart-dot { transform-box: fill-box; transform-origin: center; }
}

/* ---- Responsive ---- */
/* Tablet 768–1199px: chart drops below the title as a half-height bar, full width. */
@media (max-width: 1199px) and (min-width: 768px) {
    .app .hero-chart {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        max-width: none;
        height: 110px;
        margin: 24px 0 8px;
    }
}
/* Mobile <768px: hide the chart entirely. */
@media (max-width: 767px) {
    .app .hero-chart { display: none; }
}

.app .landing-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 28px;
    display: inline-flex;
    align-items: center;
}
.app .landing-hero-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 76px;
    line-height: 1.0;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0 0 22px;
    max-width: 980px;
}
.app .landing-hero-sub {
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-2);
    max-width: 580px;
    margin: 0 0 28px;
}
.app .landing-cta-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.app .landing-cta-row.centered { justify-content: center; }
.app .landing-cta-row .cta-aside {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-left: 4px;
}

/* ===================== LIVE TICKER ===================== */
.app .ticker {
    display: flex;
    align-items: stretch;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 0 56px;
}
.app .ticker-tag {
    flex: 0 0 auto;
    padding: 12px 20px 12px 16px;
    background: var(--panel-2);
    border-right: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--muted);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.app .ticker-track {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 8px;
}
.app .ticker-row {
    display: flex;
    gap: 40px;
    padding: 0 24px;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
    will-change: transform;
}
.app .ticker:hover .ticker-row { animation-play-state: paused; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.app .t-item {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.3px;
    color: var(--text);
    display: inline-flex;
    gap: 8px;
    align-items: baseline;
}
.app .t-name { color: var(--text-2); }
.app .t-price { color: var(--text); font-weight: 600; }
.app .t-meta { color: var(--muted); font-size: 11px; }
.app .t-up { color: var(--pos); font-weight: 600; }
.app .t-dn { color: var(--neg); font-weight: 600; }

/* Mask only the right edge so items fade out before the cutoff.
   The left edge sits flush against the tag — no left fade or items will
   appear ghosted as they leave the tag's edge. */
.app .ticker-track {
    -webkit-mask-image: linear-gradient(to right, black 0%, black 92%, transparent 100%);
            mask-image: linear-gradient(to right, black 0%, black 92%, transparent 100%);
}

/* ===================== ACCENT KPI BAND ===================== */
/* The full-bleed bands (.kpi-band, .steps-on-dark) use 100vw breakouts which
   can introduce a hairline horizontal scrollbar on systems with classic
   scrollbars. Clip overflow on the landing root to suppress it without
   affecting any other page. */
.app.landing { overflow-x: clip; }

.app .kpi-band {
    background: var(--accent);
    color: #fff;
    /* Break out of .main's max-width:1440px container so the band spans the
       full viewport. The padding aligns the inner content with .main's
       content column (1440px max - 32px gutter = 688px from center). */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 56px;
    padding-left: max(32px, calc(50vw - 688px));
    padding-right: max(32px, calc(50vw - 688px));
    padding-top: 28px;
    padding-bottom: 28px;
}
.app.theme-dark .kpi-band { color: #1a1814; }
.app .kpi-band-inner {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}
.app .kpi-band-cell .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 8px;
}
.app .kpi-band-cell .value {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 30px;
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    min-width: 6ch;
}

/* ===================== SECTION SPACING ===================== */
.app .landing-section {
    margin-bottom: 80px;
    scroll-margin-top: 80px;
}

/* ===================== SYSTEMS GRID ===================== */
.app .systems-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
}
.app .systems-grid.systems-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.app .sys {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 28px 28px 32px;
    background: transparent;
    transition: background 0.15s ease;
}
.app .sys:hover { background: var(--panel); }
.app .sys-num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 14px;
}
.app .sys-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0 0 8px;
}
.app .sys-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-2);
    margin: 0;
}

/* ===================== THE FLOOR (live data panels) ===================== */
.app .floor-headline {
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    background: var(--panel);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
}
.app .floor-headline-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
}
.app .floor-headline-text {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 1.4;
    color: var(--text);
    letter-spacing: -0.005em;
}
.app .floor-headline-text strong { font-weight: 600; }
.app .floor-headline-text .mono {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--text);
    font-weight: 500;
}
.app .floor-headline-text .accent-strong {
    color: var(--accent);
    font-weight: 600;
}

.app .floor-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    align-items: start;
}
.app .floor-grid.floor-grid-3 {
    /* Wide activity feed | top players | retail volume */
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: start;
}
/* Neutralize v5's ".card + .card { margin-top: 14px }" inside the grid. */
.app .floor-grid > .card + .card { margin-top: 0; }
.app .floor-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Activity feed list (inside .floor-feed). */
.app .floor-feed { display: flex; flex-direction: column; }
.app .feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.app .feed-item {
    padding: 0 16px;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    line-height: 1.4;
    height: 44px;
    box-sizing: border-box;
}
.app .feed-item:last-child { border-bottom: none; }
.app .feed-time {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    color: var(--muted);
    text-transform: uppercase;
    flex-shrink: 0;
}
.app .feed-text {
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app .floor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    height: 46px;
    border-bottom: 1px solid var(--rule);
    background: var(--panel-2);
    flex-shrink: 0;
    box-sizing: border-box;
}
.app .floor-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 600;
}
.app .floor-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--muted);
}
.app .floor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin: 0;
}
.app .floor-table th,
.app .floor-table td {
    padding: 0 16px;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
    height: 44px;
    box-sizing: border-box;
}
.app .floor-table tbody tr:last-child th,
.app .floor-table tbody tr:last-child td { border-bottom: none; }
.app .floor-table th {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1.5px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 500;
    background: transparent;
}
.app .floor-table td.item-name {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.005em;
}
.app .floor-table td.muted-cell {
    color: var(--text-2);
    font-size: 13px;
}
.app .floor-table .num   { text-align: right; font-variant-numeric: tabular-nums; }
.app .floor-table .small { width: 36px; }
.app .floor-table .mono  { font-family: var(--font-mono); font-size: 12.5px; }
.app .floor-table .t-up  { color: var(--pos); font-weight: 600; }
.app .floor-table .t-dn  { color: var(--neg); font-weight: 600; }
.app .floor-table tbody tr { transition: background 0.12s ease; }
.app .floor-table tbody tr:hover { background: var(--panel-2); }
.app .floor-empty {
    padding: 36px 24px;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14px;
}

/* ===================== STEPS (on dark slab) ===================== */
.app .steps-on-dark {
    background: #1a1814;
    color: #f5f1e8;
    /* Full-viewport breakout, content aligned to .main's column. */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 80px;
    padding-left: max(32px, calc(50vw - 688px));
    padding-right: max(32px, calc(50vw - 688px));
    padding-top: 56px;
    padding-bottom: 64px;
    border-radius: 0;
}
.app .steps-on-dark .ed-label { color: #d89b3a; }
.app .steps-on-dark .ed-headline { color: #f5f1e8; }
.app .steps-on-dark .ed-deck { color: rgba(245, 241, 232, 0.7); }
.app .steps-on-dark .accent-word { color: #d89b3a; }

.app .steps {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(245, 241, 232, 0.15);
}
.app .step {
    padding: 28px 24px 0;
    border-right: 1px solid rgba(245, 241, 232, 0.10);
}
.app .step:last-child { border-right: none; }
.app .step-num {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
    font-size: 56px;
    line-height: 1;
    color: #d89b3a;
    margin-bottom: 18px;
    letter-spacing: -0.03em;
}
.app .step-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 19px;
    color: #f5f1e8;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.app .step-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: rgba(245, 241, 232, 0.7);
    margin: 0;
}

/* ===================== FAQ (definition list) ===================== */
.app .faq-list {
    border-top: 1px solid var(--rule);
    margin: 0;
}
.app .faq-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 32px;
    padding: 22px 0;
    border-bottom: 1px solid var(--rule);
}
.app .faq-row dt {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}
.app .faq-row dd {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2);
    margin: 0;
}
.app .faq-row dd a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===================== FINAL CTA ===================== */
.app .cta-final {
    padding: 80px 24px;
    text-align: center;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.app .cta-final .ed-label { margin-bottom: 24px; }
.app .cta-headline {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 64px;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0 0 28px;
}

/* ===================== FOOTER ===================== */
.app .landing-footer {
    border-top: 1px solid var(--rule);
    padding-top: 40px;
    margin-top: 24px;
}
.app .lf-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 32px;
}
.app .lf-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 10px;
}
.app .lf-brand .dot { color: var(--accent); }
.app .lf-blurb {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    max-width: 380px;
    margin: 0;
}
.app .lf-head {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}
.app .lf-col ul { list-style: none; padding: 0; margin: 0; }
.app .lf-col ul li { padding: 4px 0; }
.app .lf-col ul a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 13px;
}
.app .lf-col ul a:hover { color: var(--accent); }
.app .lf-bottom {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* ===================== TABLET (≤ 1024px) ===================== */
@media (max-width: 1024px) {
    .app .landing-hero-title { font-size: 60px; }
    .app .ed-headline { font-size: 36px; }
    .app .cta-headline { font-size: 48px; }

    .app .systems-grid { grid-template-columns: repeat(2, 1fr); }
    .app .systems-grid.systems-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .app .floor-grid   { grid-template-columns: 1fr; }
    .app .floor-grid.floor-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .app .floor-grid.floor-grid-3 > .floor-feed {
        grid-column: 1 / -1;
    }
    .app .steps        { grid-template-columns: repeat(2, 1fr); }
    .app .step:nth-child(2n)  { border-right: none; }

    .app .kpi-band-inner { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* ===================== MOBILE (≤ 720px) ===================== */
@media (max-width: 720px) {
    .app.landing .main { padding: 16px 14px 60px; }

    .app .landing-hero { padding: 16px 0 8px; }
    .app .landing-eyebrow { font-size: 10px; letter-spacing: 1.5px; margin-bottom: 18px; }
    .app .landing-hero-title { font-size: 40px; line-height: 1.05; }
    .app .landing-hero-sub   { font-size: 15px; }
    .app .landing-cta-row .btn.lg { flex: 1; min-width: 0; justify-content: center; }
    .app .landing-cta-row .cta-aside { width: 100%; margin-left: 0; margin-top: 4px; }

    .app .ticker { margin-bottom: 36px; }
    .app .ticker-tag { padding: 10px 12px; font-size: 9px; }
    .app .t-item { font-size: 11px; }
    .app .ticker-row { gap: 28px; padding: 10px 16px; animation-duration: 45s; }

    .app .kpi-band {
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        margin-bottom: 36px;
        padding-left: 14px;
        padding-right: 14px;
        padding-top: 22px;
        padding-bottom: 22px;
    }
    .app .kpi-band-inner { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .app .kpi-band-cell .value { font-size: 24px; }
    .app .kpi-band-cell .label { font-size: 9px; letter-spacing: 1.5px; }

    .app .landing-section { margin-bottom: 48px; }
    .app .ed-headline { font-size: 28px; }
    .app .ed-deck { font-size: 15px; margin-bottom: 22px; }

    .app .systems-grid { grid-template-columns: 1fr; }
    .app .systems-grid.systems-grid-4 { grid-template-columns: 1fr; }
    .app .sys { padding: 22px 18px 24px; }
    .app .sys-title { font-size: 19px; }

    .app .floor-grid { grid-template-columns: 1fr; }
    .app .floor-grid.floor-grid-3 { grid-template-columns: 1fr; }
    .app .floor-grid.floor-grid-3 > .floor-feed { grid-column: auto; }
    .app .floor-table th,
    .app .floor-table td { padding: 0 14px; height: 42px; }
    .app .floor-head { padding: 0 14px; height: 44px; }
    .app .feed-item { padding: 0 14px; height: 42px; grid-template-columns: 56px 1fr; gap: 10px; font-size: 12.5px; }
    .app .floor-headline { padding: 14px 16px; gap: 12px; }
    .app .floor-headline-text { font-size: 15px; }

    .app .steps-on-dark {
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        margin-bottom: 48px;
        padding-left: 14px;
        padding-right: 14px;
        padding-top: 36px;
        padding-bottom: 40px;
    }
    .app .steps { grid-template-columns: 1fr; border-top: none; }
    .app .step {
        border-right: none;
        border-bottom: 1px solid rgba(245, 241, 232, 0.10);
        padding: 22px 0 22px;
    }
    .app .step:last-child { border-bottom: none; }
    .app .step-num { font-size: 44px; margin-bottom: 12px; }
    .app .step-title { font-size: 17px; }

    .app .faq-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 18px 0;
    }
    .app .faq-row dt { font-size: 16px; }
    .app .faq-row dd { font-size: 13.5px; }

    .app .cta-final { padding: 56px 14px; }
    .app .cta-headline { font-size: 36px; }

    .app .lf-grid { grid-template-columns: 1fr; gap: 24px; }
    .app .lf-bottom { flex-direction: column; gap: 6px; }

    /* Hide section anchors on mobile topbar */
    .app .topbar .landing-nav { display: none; }
}

/* On very narrow screens stack the hero CTAs full-width. */
@media (max-width: 480px) {
    .app .landing-cta-row .btn.lg { width: 100%; }
}

/* Respect users who don't want motion. */
@media (prefers-reduced-motion: reduce) {
    .app .ticker-row { animation: none; }
    .app .live-dot   { animation: none; }
}

/* ===================== MOBILE NAV: HAMBURGER + DRAWER ===================== */
.app .m-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}
.app .m-burger-bars {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 12px;
}
.app .m-burger-bars span {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.18s ease, opacity 0.18s ease, top 0.18s ease;
}
.app .m-burger-bars span:nth-child(1) { top: 0; }
.app .m-burger-bars span:nth-child(2) { top: 5px; }
.app .m-burger-bars span:nth-child(3) { top: 10px; }
.app .m-burger.is-open .m-burger-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.app .m-burger.is-open .m-burger-bars span:nth-child(2) { opacity: 0; }
.app .m-burger.is-open .m-burger-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

.app .m-drawer {
    display: none;
    background: var(--panel);
    border-bottom: 1px solid var(--rule);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease;
}
.app .m-drawer.is-open { max-height: 480px; }
.app .m-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.app .m-drawer-nav a {
    padding: 12px 18px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}
.app .m-drawer-nav a:last-child { border-bottom: none; }
.app .m-drawer-nav a:hover { background: var(--panel-2); color: var(--accent); }
.app .m-drawer-nav .m-drawer-signin {
    color: var(--accent);
    font-weight: 500;
}
/* Hamburger only shows on mobile. */
.app .m-burger { display: none; }
@media (max-width: 768px) {
    .app .m-burger { display: inline-flex; }
    .app .m-drawer { display: block; }
}

/* ===================== AUTH MODAL =====================
   Lives outside .app (after </main>), so rules are unscoped. */
.auth-modal[hidden] { display: none !important; }
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 200ms ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.auth-modal.is-open { opacity: 1; }
.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 4, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.auth-modal-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #faf7ef;
    color: #1a1814;
    border: 1px solid #e4ddc9;
    border-radius: 10px;
    padding: 32px 32px 28px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
    transform: translateY(8px);
    transition: transform 220ms ease;
}
.auth-modal.is-open .auth-modal-card { transform: translateY(0); }
[data-bs-theme="dark"] .auth-modal-card,
.app.theme-dark ~ .auth-modal .auth-modal-card,
html[data-bs-theme="dark"] .auth-modal-card {
    background: #1a1814;
    color: #f5f1e8;
    border-color: #2d2a23;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.auth-modal-close:hover { opacity: 1; border-color: currentColor; }

.auth-modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e4ddc9;
    margin: 4px 0 22px;
}
html[data-bs-theme="dark"] .auth-modal-tabs { border-bottom-color: #2d2a23; }
.auth-modal-tabs .auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b665a;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
html[data-bs-theme="dark"] .auth-modal-tabs .auth-tab { color: #8a8478; }
.auth-modal-tabs .auth-tab:hover { color: inherit; }
.auth-modal-tabs .auth-tab.is-active {
    color: #b8680d;
    border-bottom-color: #b8680d;
}
html[data-bs-theme="dark"] .auth-modal-tabs .auth-tab.is-active {
    color: #d89b3a;
    border-bottom-color: #d89b3a;
}

.auth-pane[hidden] { display: none; }
.auth-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 26px;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 6px;
}
.auth-sub {
    font-size: 13.5px;
    color: #6b665a;
    margin: 0 0 22px;
}
html[data-bs-theme="dark"] .auth-sub { color: #a39d8f; }

.auth-error {
    background: rgba(192, 64, 64, 0.08);
    border: 1px solid rgba(192, 64, 64, 0.3);
    color: #a83232;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
html[data-bs-theme="dark"] .auth-error {
    background: rgba(232, 96, 96, 0.12);
    border-color: rgba(232, 96, 96, 0.35);
    color: #e88080;
}

.auth-field {
    display: block;
    margin-bottom: 14px;
}
.auth-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #6b665a;
    margin-bottom: 6px;
}
html[data-bs-theme="dark"] .auth-label { color: #a39d8f; }
.auth-field input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #d8cfb6;
    border-radius: 6px;
    color: inherit;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html[data-bs-theme="dark"] .auth-field input {
    background: #0f0d0a;
    border-color: #2d2a23;
}
.auth-field input:focus {
    outline: none;
    border-color: #b8680d;
    box-shadow: 0 0 0 3px rgba(184, 104, 13, 0.15);
}
html[data-bs-theme="dark"] .auth-field input:focus {
    border-color: #d89b3a;
    box-shadow: 0 0 0 3px rgba(216, 155, 58, 0.18);
}

.auth-submit {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
}

.auth-switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: #6b665a;
}
html[data-bs-theme="dark"] .auth-switch { color: #a39d8f; }
.auth-link {
    background: none;
    border: none;
    padding: 0;
    color: #b8680d;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
html[data-bs-theme="dark"] .auth-link { color: #d89b3a; }
.auth-link:hover { text-decoration-thickness: 2px; }

@media (max-width: 480px) {
    .auth-modal { padding: 12px; }
    .auth-modal-card { padding: 28px 22px 22px; }
    .auth-title { font-size: 22px; }
}

/* ===================== COOKIE CONSENT BANNER (v5 re-skin) =====================
   The banner markup lives outside .app (cookie_banner.php injects it into the
   <body> directly), so these rules are unscoped. The legacy cookie-consent.css
   referenced design-tokens (--accent-color etc.) that don't exist in v5; this
   re-skin uses v5 colors with hard-coded fallbacks for both themes. */
#cookieConsentBanner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 99999;
    display: none;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 220ms ease, transform 220ms ease;

    background: #faf7ef;
    color: #1a1814;
    border-top: 1px solid #e4ddc9;
    padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}
html[data-bs-theme="dark"] #cookieConsentBanner {
    background: #1c1f22;
    color: #e6e1d2;
    border-top-color: #262a2f;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
}
#cookieConsentBanner.show { opacity: 1; transform: translateY(0); }

#cookieConsentBanner .cookie-consent-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
#cookieConsentBanner .cookie-consent-text { flex: 1; min-width: 280px; }
#cookieConsentBanner .cookie-consent-text h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}
#cookieConsentBanner .cookie-icon { font-size: 16px; line-height: 1; }
#cookieConsentBanner .cookie-consent-text p {
    margin: 0;
    color: #3a3630;
    font-size: 13px;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-text p { color: #c2bdae; }
#cookieConsentBanner .cookie-consent-text a {
    color: #b8680d;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-text a { color: #d89b3a; }

#cookieConsentBanner .cookie-consent-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
#cookieConsentBanner .cookie-consent-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#cookieConsentBanner .cookie-consent-btn-accept {
    background: #b8680d;
    border: 1px solid #b8680d;
    color: #fff;
}
#cookieConsentBanner .cookie-consent-btn-accept:hover {
    background: #96540a;
    border-color: #96540a;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-btn-accept {
    background: #d89b3a;
    border-color: #d89b3a;
    color: #1a1814;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-btn-accept:hover {
    background: #e9b058;
    border-color: #e9b058;
}
#cookieConsentBanner .cookie-consent-btn-decline {
    background: transparent;
    border: 1px solid #c8bfa6;
    color: #1a1814;
}
#cookieConsentBanner .cookie-consent-btn-decline:hover {
    background: #ede7d7;
    border-color: #b8a98a;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-btn-decline {
    border-color: #3a3f46;
    color: #e6e1d2;
}
html[data-bs-theme="dark"] #cookieConsentBanner .cookie-consent-btn-decline:hover {
    background: #242830;
    border-color: #4a4f56;
}

@media (max-width: 720px) {
    #cookieConsentBanner { padding: 14px; }
    #cookieConsentBanner .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #cookieConsentBanner .cookie-consent-buttons { justify-content: flex-end; }
    #cookieConsentBanner .cookie-consent-btn { flex: 1; min-width: 0; }
}
