/* ═══════════════════════════════════════════════════════════════
   TRATOK LABS — DEVELOPER PLATFORM
   Design system aligned with the Tratok ecosystem (v2.0)
   Reference: tratok.info/styles/main.css
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* ─── Primary Palette (ember + amber gradient) ─── */
    --ember:        #E85D3A;
    --ember-glow:   #FF7B5C;
    --ember-deep:   #C43D1E;
    --teal:         #2ECDA7;
    --teal-glow:    #5BFFCF;
    --teal-deep:    #1A9B7A;
    --amber:        #F5A623;
    --amber-glow:   #FFD076;
    --violet:       #8B5CF6;
    --violet-glow:  #A78BFA;

    /* ─── Dark Canvas ─── */
    --void:             #0B0E17;
    --abyss:            #111827;
    --slate:            #1E293B;
    --surface:          #243044;
    --surface-hover:    #2D3B52;
    --surface-elevated: #2F3D57;

    /* ─── Text ─── */
    --white: #FFFFFF;
    --snow:  #F1F5F9;
    --mist:  #94A3B8;
    --ghost: #64748B;
    --faint: rgba(255, 255, 255, 0.06);

    /* ─── Glass ─── */
    --glass:        rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover:  rgba(255, 255, 255, 0.08);
    --glass-active: rgba(255, 255, 255, 0.12);
    --glass-strong: rgba(255, 255, 255, 0.12);

    /* ─── Feedback ─── */
    --success: #22C55E;
    --warning: #EAB308;
    --danger:  #EF4444;
    --info:    #3B82F6;

    /* ─── Elevation ─── */
    --shadow-sm:    0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:    0 8px 30px rgba(0,0,0,0.5);
    --shadow-xl:    0 20px 60px rgba(0,0,0,0.6);
    --shadow-ember: 0 4px 20px rgba(232, 93, 58, 0.25);
    --shadow-teal:  0 4px 20px rgba(46, 205, 167, 0.2);

    /* ─── Radii ─── */
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-2xl:  32px;
    --radius-full: 9999px;

    /* ─── Motion ─── */
    --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration:      0.3s;
    --duration-slow: 0.5s;

    /* ─── Spacing ─── */
    --header-h:        72px;
    --container-max:   1280px;
    --container-narrow: 880px;
    --safe-top:    env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--void);
    color: var(--snow);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* Ambient grain */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Ambient orbs */
body::after {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(800px circle at 10% -10%, rgba(232, 93, 58, 0.12), transparent 50%),
        radial-gradient(800px circle at 90% 110%, rgba(46, 205, 167, 0.10), transparent 50%),
        radial-gradient(600px circle at 50% 50%, rgba(139, 92, 246, 0.05), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

img, svg, video { max-width: 100%; display: block; }

::selection { background: var(--ember); color: var(--white); }

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--white);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

p { color: var(--mist); }
p + p { margin-top: 1em; }

a {
    color: var(--teal);
    text-decoration: none;
    transition: color var(--duration) var(--ease-out);
}
a:hover { color: var(--teal-glow); }

code, pre, .mono {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

code {
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--amber-glow);
}

pre {
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; color: var(--snow); font-size: 1em; }

.text-gradient {
    background: linear-gradient(135deg, var(--ember-glow), var(--amber));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-teal {
    background: linear-gradient(135deg, var(--teal-glow), var(--teal));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal);
    padding: 6px 14px;
    background: rgba(46, 205, 167, 0.08);
    border: 1px solid rgba(46, 205, 167, 0.2);
    border-radius: var(--radius-full);
}

.eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.2); }
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow { max-width: var(--container-narrow); }

.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.section-lg { padding: 128px 0; }

@media (max-width: 768px) {
    .section { padding: 64px 0; }
    .section-lg { padding: 80px 0; }
}

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 968px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER (shared with Tratok.info)
   ═══════════════════════════════════════════════════════════════ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(11, 14, 23, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: border-color var(--duration) var(--ease-out);
}

.site-header.scrolled {
    background: rgba(11, 14, 23, 0.92);
    border-bottom-color: var(--glass-strong);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--white);
    letter-spacing: -0.01em;
}
.brand:hover { color: var(--white); }

.brand-mark {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #F5D888, #B8860B 70%);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3),
                inset 0 1px 2px rgba(255,255,255,0.4),
                inset 0 -1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.brand-mark img {
    width: 100%; height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}
.brand-mark::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease-out);
    border-radius: 50%;
}
.brand:hover .brand-mark::after { opacity: 1; }

.brand-tag {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--teal);
    background: rgba(46, 205, 167, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Horizontal nav — lives inside the header on desktop. */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

/* Off-canvas slide-out — lives as a body sibling of <header>, NOT inside.
   The header has backdrop-filter, which would create a containing block
   for fixed descendants and clip the menu. */
.nav {
    display: none;            /* hidden by default; shown only on mobile */
}

.nav-link {
    position: relative;
    padding: 10px 14px;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--mist);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease-out);
}
.nav-link:hover { color: var(--white); background: var(--glass); }
.nav-link.active { color: var(--white); background: var(--glass); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 14px; right: 14px;
    height: 2px;
    background: linear-gradient(90deg, var(--ember), var(--amber));
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-toggle {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease-out);
}
.nav-toggle:hover { background: var(--glass-hover); border-color: var(--glass-strong); }
.nav-toggle-bar {
    position: relative;
    width: 18px; height: 2px;
    background: currentColor;
    border-radius: 2px;
    display: block;
}
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px; height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--duration) var(--ease-out);
}
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after  { top:  6px; }

/* Hamburger → X when menu is open */
.nav-toggle.active .nav-toggle-bar { background: transparent; }
.nav-toggle.active .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle.active .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

/* Lock body scroll while the slide-out is open (avoids scroll-bleed) */
html.nav-locked, html.nav-locked body { overflow: hidden; }

.nav-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 98;        /* above content (z:1), below the menu (z:99), below the header (z:100) */
}
.nav-backdrop.open { display: block; }

@media (max-width: 968px) {
    .nav-desktop { display: none; }

    .nav {
        display: flex;
        position: fixed;
        top: var(--header-h);
        right: 0; bottom: 0;
        width: min(320px, 85vw);
        background: var(--abyss);
        border-left: 1px solid var(--glass-border);
        z-index: 99;             /* above content (1) and backdrop (98), below header (100) */
        box-shadow: -10px 0 32px rgba(0, 0, 0, 0.45);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 24px;
        transform: translateX(100%);
        transition: transform var(--duration) var(--ease-out);
        overflow-y: auto;
    }
    .nav.open { transform: translateX(0); }
    .nav-link { padding: 14px 18px; font-size: 1rem; }
    .nav-toggle { display: inline-flex; }
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, var(--ember), var(--ember-deep));
    color: var(--white);
    box-shadow: var(--shadow-ember);
}
.btn-primary:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232, 93, 58, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: var(--white);
    box-shadow: var(--shadow-teal);
}
.btn-secondary:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(46, 205, 167, 0.4);
}

.btn-ghost {
    background: var(--glass);
    color: var(--snow);
    border-color: var(--glass-border);
}
.btn-ghost:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    color: var(--white);
}

.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-danger-ghost {
    background: var(--glass);
    color: var(--mist);
    border-color: var(--glass-border);
}
.btn-danger-ghost:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--duration) var(--ease-out);
    position: relative;
    overflow: hidden;
}
.card:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
}

.card-accent-ember::before,
.card-accent-teal::before,
.card-accent-amber::before,
.card-accent-violet::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    opacity: 0.85;
}
.card-accent-ember::before  { background: linear-gradient(90deg, var(--ember), var(--amber)); }
.card-accent-teal::before   { background: linear-gradient(90deg, var(--teal), var(--teal-glow)); }
.card-accent-amber::before  { background: linear-gradient(90deg, var(--amber), var(--amber-glow)); }
.card-accent-violet::before { background: linear-gradient(90deg, var(--violet), var(--violet-glow)); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.card-header h3 { margin: 0; }

.card-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    font-size: 1.4rem;
}
.card-icon-ember  { background: rgba(232, 93, 58, 0.12); color: var(--ember-glow); }
.card-icon-teal   { background: rgba(46, 205, 167, 0.12); color: var(--teal-glow); }
.card-icon-amber  { background: rgba(245, 166, 35, 0.12); color: var(--amber-glow); }
.card-icon-violet { background: rgba(139, 92, 246, 0.12); color: var(--violet-glow); }

.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════════
   AUTH / FORM CARD
   ═══════════════════════════════════════════════════════════════ */

.auth-shell {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 80px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.auth-card-wide { max-width: 540px; }
.auth-card .brand-mark { margin: 0 auto 20px; }
.auth-card h1, .auth-card h2 {
    font-size: clamp(1.6rem, 4vw, 1.9rem);
    margin-bottom: 8px;
}
.auth-card .lead {
    color: var(--mist);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.field { margin-bottom: 18px; text-align: left; }
.field label {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mist);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--snow);
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    transition: border-color var(--duration) var(--ease-out),
                box-shadow var(--duration) var(--ease-out),
                background var(--duration) var(--ease-out);
    outline: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ghost); }
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--ember);
    box-shadow: 0 0 0 3px rgba(232, 93, 58, 0.15);
    background: rgba(255,255,255,0.06);
}
.field textarea { min-height: 110px; resize: vertical; }
.field-hint { font-size: 0.78rem; color: var(--ghost); margin-top: 6px; }
.field-msg  { font-size: 0.82rem; margin-top: 6px; min-height: 1.1em; }
.field-msg.error   { color: var(--danger); }
.field-msg.success { color: var(--success); }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 22px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: rgba(34, 197, 94, 0.08);  border: 1px solid rgba(34, 197, 94, 0.25);  color: var(--success); }
.alert-danger  { background: rgba(239, 68, 68, 0.08);  border: 1px solid rgba(239, 68, 68, 0.25);  color: var(--danger); }
.alert-warning { background: rgba(234, 179, 8, 0.08);  border: 1px solid rgba(234, 179, 8, 0.25);  color: var(--warning); }
.alert-info    { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25); color: var(--info); }

.auth-foot {
    margin-top: 24px;
    font-size: 0.92rem;
    color: var(--mist);
}
.auth-foot a { color: var(--ember-glow); font-weight: 600; }
.auth-foot a:hover { color: var(--amber); }

/* Status icon (verify / reset success) */
.status-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    font-size: 32px;
    font-weight: 700;
}
.status-icon.success { background: rgba(34, 197, 94, 0.12);  border: 2px solid var(--success); color: var(--success); }
.status-icon.error   { background: rgba(239, 68, 68, 0.12);  border: 2px solid var(--danger);  color: var(--danger); }
.status-icon.info    { background: rgba(59, 130, 246, 0.12); border: 2px solid var(--info);    color: var(--info); }

/* Password strength */
.pw-bar {
    height: 4px; border-radius: 2px;
    background: var(--glass-border);
    overflow: hidden;
    margin: 8px 0 6px;
}
.pw-bar-fill {
    height: 100%; width: 0;
    border-radius: 2px;
    background: var(--danger);
    transition: width var(--duration) var(--ease-out), background var(--duration);
}
.pw-text { font-size: 0.78rem; color: var(--ghost); }

/* Wizard progress */
.wiz-progress { margin-bottom: 32px; }
.wiz-steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.wiz-line {
    position: absolute;
    top: 50%; left: 0; right: 0; height: 2px;
    background: var(--glass-border);
    transform: translateY(-50%);
    z-index: 0;
}
.wiz-fill {
    position: absolute;
    top: 50%; left: 0; height: 2px;
    background: linear-gradient(90deg, var(--ember), var(--amber));
    transform: translateY(-50%);
    z-index: 1;
    width: 0;
    transition: width var(--duration-slow) var(--ease-out);
}
.wiz-dot {
    position: relative; z-index: 2;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--abyss);
    border: 2px solid var(--glass-border);
    color: var(--ghost);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    display: grid; place-items: center;
    transition: all var(--duration) var(--ease-out);
}
.wiz-dot.active    { border-color: var(--ember);  color: var(--ember-glow); }
.wiz-dot.completed { border-color: var(--success); background: var(--success); color: var(--white); }
.wiz-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ghost);
    font-family: 'Sora', sans-serif;
    font-weight: 600;
}
.wiz-labels span { width: 33.33%; text-align: center; }
.wiz-labels span.active { color: var(--ember-glow); }
.wiz-step { display: none; animation: fadeSlide 0.4s var(--ease-out); }
.wiz-step.active { display: block; }
@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.wiz-actions {
    display: flex; gap: 12px; margin-top: 24px;
}
.wiz-actions .btn { flex: 1; }
.wiz-actions .btn-back { flex: 0 0 auto; }

.review-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.92rem;
    text-align: left;
}
.review-row:last-child { border-bottom: none; }
.review-row .label { color: var(--mist); font-family: 'Sora', sans-serif; font-weight: 600; }
.review-row .value { color: var(--white); text-align: right; max-width: 60%; word-break: break-word; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */

.hero {
    position: relative;
    padding: 96px 0 80px;
    text-align: center;
}
.hero-eyebrow { margin-bottom: 24px; }
.hero h1 {
    margin: 0 auto 24px;
    max-width: 900px;
}
.hero-lede {
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    color: var(--mist);
    max-width: 720px;
    margin: 0 auto 36px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    max-width: 880px;
    margin: 0 auto;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    overflow: hidden;
}
.stat {
    padding: 28px 20px;
    text-align: center;
    border-right: 1px solid var(--glass-border);
}
.stat:last-child { border-right: none; }
.stat-value {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--ember-glow), var(--amber));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 6px;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
}
@media (max-width: 640px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--glass-border); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════════════════════════════ */

.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 56px;
}
.section-header .eyebrow { margin-bottom: 16px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { font-size: 1.02rem; }

/* ═══════════════════════════════════════════════════════════════
   STEPS / HOW IT WORKS
   ═══════════════════════════════════════════════════════════════ */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 16.66%; right: 16.66%;
    height: 2px;
    background: linear-gradient(90deg, var(--ember), var(--amber), var(--teal));
    opacity: 0.3;
}
.step {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--duration) var(--ease-out);
}
.step:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    transform: translateY(-3px);
}
.step-num {
    width: 64px; height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: grid; place-items: center;
    background: var(--abyss);
    border: 2px solid var(--ember);
    color: var(--ember-glow);
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}
.step h3 { font-family: 'Sora', sans-serif; margin-bottom: 8px; }
.step p { font-size: 0.92rem; }
@media (max-width: 768px) {
    .steps { grid-template-columns: 1fr; }
    .steps::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.site-footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(11, 14, 23, 0.6);
    padding: 60px 0 32px;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.footer-brand .brand-mark { width: 32px; height: 32px; }
.footer-brand span {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--white);
}
.site-footer h4 {
    font-family: 'Sora', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--snow);
    margin-bottom: 16px;
}
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer ul a { color: var(--mist); font-size: 0.9rem; }
.site-footer ul a:hover { color: var(--ember-glow); }
.footer-base {
    border-top: 1px solid var(--glass-border);
    padding-top: 24px;
    text-align: center;
    color: var(--ghost);
    font-size: 0.82rem;
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ═══════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER
   ═══════════════════════════════════════════════════════════════ */

.lang-switcher { position: relative; }

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--snow);
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.lang-btn:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    color: var(--white);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all var(--duration-fast) var(--ease-out);
}
.lang-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--snow);
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast);
}
.lang-option:hover { background: var(--glass-hover); color: var(--white); }
.lang-option.active { background: rgba(46, 205, 167, 0.12); color: var(--teal-glow); }

.lang-flag { font-size: 1.05rem; line-height: 1; }

[dir="rtl"] .lang-menu { right: auto; left: 0; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD (account.php)
   ═══════════════════════════════════════════════════════════════ */

.dash-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 264px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform var(--duration) var(--ease-out);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--white);
}
.sidebar-brand .brand-mark { width: 32px; height: 32px; }
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ghost);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0 12px;
    margin-bottom: 8px;
    font-family: 'Sora', sans-serif;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--mist);
    font-family: 'Sora', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all var(--duration-fast) var(--ease-out);
}
.sidebar-link:hover { background: var(--glass); color: var(--white); }
.sidebar-link.active {
    background: rgba(232, 93, 58, 0.10);
    color: var(--ember-glow);
}
.sidebar-link .icon { width: 20px; text-align: center; font-size: 1.05rem; }

.sidebar-foot {
    padding: 16px 16px 20px;
    border-top: 1px solid var(--glass-border);
}
.sidebar-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(232, 93, 58, 0.08);
    border: 1px solid rgba(232, 93, 58, 0.18);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ember-glow);
    margin-bottom: 12px;
}

.dash-main {
    flex: 1;
    margin-left: 264px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 32px;
    background: rgba(11, 14, 23, 0.65);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 40;
}
.dash-topbar h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}
.dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-content { padding: 32px; max-width: 1200px; }

.hb {
    display: none;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--white);
    padding: 8px;
    cursor: pointer;
}
.hb svg { width: 22px; height: 22px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 55;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 968px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .dash-main { margin-left: 0; }
    .hb { display: inline-flex; }
    .dash-content { padding: 24px 18px; }
}

/* Stat cards (in dashboard) */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    text-align: center;
    transition: all var(--duration) var(--ease-out);
}
.kpi:hover { background: var(--glass-hover); transform: translateY(-2px); }
.kpi-value {
    font-family: 'Sora', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ember-glow), var(--amber));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-label {
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    color: var(--ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 6px;
    font-weight: 600;
}

/* Module pill buttons */
.module-row {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.module-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--mist);
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--duration-fast) var(--ease-out);
}
.module-pill:hover { background: var(--glass-hover); color: var(--white); }
.module-pill.active {
    background: rgba(232, 93, 58, 0.12);
    border-color: rgba(232, 93, 58, 0.3);
    color: var(--ember-glow);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES (covers PHP-emitted dynamic tables)
   ═══════════════════════════════════════════════════════════════ */

table.dt,
table.functions,
table.table-form,
.card table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Sans', sans-serif;
}
table.dt th,
table.functions th,
table.table-form th,
.card table th,
th.apps {
    text-align: left;
    padding: 12px 16px;
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mist) !important;
    background: rgba(255,255,255,0.02) !important;
    border-bottom: 1px solid var(--glass-border) !important;
}
table.dt td,
table.functions td,
table.table-form td,
.card table td,
td.summary {
    padding: 14px 16px !important;
    font-size: 0.9rem !important;
    color: var(--snow) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    background: transparent !important;
    text-align: left !important;
    font-family: 'DM Sans', sans-serif !important;
}
table.dt tr:last-child td,
table.functions tr:last-child td,
table.table-form tr:last-child td,
.card table tr:last-child td { border-bottom: none !important; }
table.dt tr:hover td,
table.functions tr:hover td,
table.table-form tr:hover td,
tr.summary:hover td,
.card table tr:hover td { background: rgba(255,255,255,0.02) !important; }
.card table a { color: var(--ember-glow); font-weight: 600; }
.card table a:hover { color: var(--amber); }

/* status pills (used in app listings) */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: 'Sora', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.badge-success { background: rgba(34, 197, 94, 0.14); color: var(--success); }
.badge-warning { background: rgba(234, 179, 8, 0.14); color: var(--warning); }
.badge-danger  { background: rgba(239, 68, 68, 0.14); color: var(--danger); }

/* API endpoint table */
.api-table th { color: var(--ember-glow) !important; background: rgba(232, 93, 58, 0.05) !important; }
.api-table td { vertical-align: top; }
.api-fn { font-family: 'JetBrains Mono', monospace; font-size: 0.92rem; color: var(--white); font-weight: 700; }
.api-arg { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--amber-glow); }

/* Wallet card */
.wallet-addr {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    word-break: break-all;
    text-align: center;
    margin-bottom: 16px;
    color: var(--snow);
}
.wallet-qr { text-align: center; margin: 16px 0; }
.wallet-qr img {
    max-width: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    padding: 8px;
    background: #fff;
}

/* News cards (landing) */
.news-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration) var(--ease-out);
}
.news-card:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    transform: translateY(-3px);
}
.news-img { width: 100%; height: 200px; object-fit: cover; display: block; }
.news-body { padding: 22px 24px; }
.news-tag {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ember-glow);
    background: rgba(232, 93, 58, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}
.news-body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.news-body p { font-size: 0.88rem; margin-bottom: 12px; }
.news-date { font-size: 0.78rem; color: var(--ghost); }

/* ═══════════════════════════════════════════════════════════════
   FADE / MOTION
   ═══════════════════════════════════════════════════════════════ */

.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up-1 { transition-delay: 0.08s; }
.fade-up-2 { transition-delay: 0.16s; }
.fade-up-3 { transition-delay: 0.24s; }
.fade-up-4 { transition-delay: 0.32s; }

/* ═══════════════════════════════════════════════════════════════
   RTL SUPPORT
   ═══════════════════════════════════════════════════════════════ */

[dir="rtl"] body { font-family: 'Sora', 'Segoe UI', Tahoma, sans-serif; }
[dir="rtl"] .nav-link.active::after { left: auto; right: 14px; }
[dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--glass-border); }
[dir="rtl"] .dash-main { margin-left: 0; margin-right: 264px; }
[dir="rtl"] .review-row .value { text-align: left; }
[dir="rtl"] .field label { text-align: right; }
@media (max-width: 968px) {
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    [dir="rtl"] .sidebar.open { transform: translateX(0); }
    [dir="rtl"] .dash-main { margin-right: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-mono   { font-family: 'JetBrains Mono', monospace; }
.flex-row    { display: flex; gap: 12px; flex-wrap: wrap; }
.mb-0  { margin-bottom: 0 !important; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.no-bullet { list-style: none; padding: 0; }
.divider { border: none; border-top: 1px solid var(--glass-border); margin: 24px 0; }
.scroll-x { overflow-x: auto; }
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--glass-strong); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   API ENDPOINT CARDS + CODE SAMPLES
   ═══════════════════════════════════════════════════════════════ */

.docs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.endpoint-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color var(--duration) var(--ease-out);
}
.endpoint-card:hover { border-color: var(--glass-strong); }

.endpoint-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.endpoint-method {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--white);
    word-break: break-all;
}
.endpoint-method::before {
    content: 'POST /data.php · ';
    color: var(--ghost);
    font-weight: 500;
    font-size: 0.82rem;
}

.endpoint-desc {
    color: var(--mist);
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.endpoint-params {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
}
.endpoint-param {
    font-size: 0.85rem;
    margin: 4px 0;
    line-height: 1.5;
}
.endpoint-param-name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--amber-glow);
    font-weight: 600;
}
.endpoint-param-type {
    font-family: 'JetBrains Mono', monospace;
    color: var(--ghost);
    font-size: 0.78rem;
    margin-left: 6px;
}
.endpoint-param-required {
    color: var(--danger);
    font-size: 0.7rem;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
}
.endpoint-param-hint {
    color: var(--mist);
    font-size: 0.85rem;
    margin-left: 6px;
}

/* ─── Code tabs ─── */

.code-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0;
    overflow-x: auto;
    padding: 0;
}
.code-tabs::-webkit-scrollbar { height: 4px; }
.code-tabs::-webkit-scrollbar-thumb { background: var(--glass-strong); border-radius: 2px; }

.code-tab {
    padding: 9px 14px;
    background: transparent;
    border: none;
    color: var(--mist);
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--duration-fast), border-color var(--duration-fast);
    white-space: nowrap;
    margin-bottom: -1px;
}
.code-tab:hover { color: var(--white); }
.code-tab.active {
    color: var(--ember-glow);
    border-bottom-color: var(--ember);
}

/* ─── Code block ─── */

.code-block {
    position: relative;
    margin-top: 0;
}
.code-block pre {
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 18px 56px 18px 18px;
    overflow-x: auto;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.65;
}
.code-block pre code {
    color: var(--snow);
    background: none;
    border: none;
    padding: 0;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    white-space: pre;
}
.code-block pre::-webkit-scrollbar { height: 6px; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--glass-strong); border-radius: 3px; }

.code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 11px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--mist);
    font-family: 'Sora', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast);
    z-index: 1;
}
.code-copy:hover {
    color: var(--white);
    border-color: var(--glass-strong);
    background: var(--glass-hover);
}
.code-copy.copied {
    color: var(--success);
    border-color: rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.08);
}

/* ─── Sample response ─── */

.code-response {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}
.code-response-label {
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ghost);
    font-weight: 700;
    margin-bottom: 10px;
}
.code-response pre {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
}
.code-response pre code {
    color: var(--teal-glow);
    background: none;
    border: none;
    padding: 0;
    font-family: 'JetBrains Mono', monospace;
    white-space: pre;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE LAYOUT POLISH (≤ 768px) AND TINY (≤ 480px)
   ═══════════════════════════════════════════════════════════════ */

/* All actionable controls hit at least 44×44 — Apple HIG / WCAG 2.5.5. */
@media (hover: none) and (pointer: coarse) {
    .btn-sm { min-height: 40px; }
    .btn,
    .nav-link,
    .sidebar-link,
    .lang-btn,
    .lang-option,
    .module-pill,
    .code-tab,
    .code-copy { min-height: 44px; }
}

/* ─── Tables → stacked cards on mobile ─── */
@media (max-width: 768px) {
    table.m-card,
    table.m-card thead,
    table.m-card tbody,
    table.m-card tr,
    table.m-card td {
        display: block !important;
        width: 100% !important;
    }
    table.m-card thead {
        position: absolute !important;
        clip: rect(0 0 0 0); clip-path: inset(50%);
        height: 1px; width: 1px;
        overflow: hidden;
        white-space: nowrap;
    }
    table.m-card tr {
        background: var(--glass) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: var(--radius-md) !important;
        padding: 8px 14px !important;
        margin-bottom: 12px !important;
    }
    table.m-card td {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid var(--glass-border) !important;
        text-align: right !important;
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        word-break: break-word !important;
    }
    table.m-card td:last-child {
        border-bottom: none !important;
    }
    table.m-card td::before {
        content: attr(data-label);
        font-family: 'Sora', sans-serif !important;
        font-size: 0.7rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        color: var(--ghost) !important;
        font-weight: 700 !important;
        flex: 0 0 38%;
        text-align: left !important;
        padding-top: 2px;
    }
    /* Mono code (id/secret block in listApps) wraps and stays readable */
    table.m-card td .mono {
        font-size: 0.78rem;
        word-break: break-all;
    }
    /* Action links in admin tables get pill treatment for thumb-friendly taps */
    table.m-card td a {
        display: inline-block;
        padding: 6px 12px;
        background: rgba(232, 93, 58, 0.10);
        border: 1px solid rgba(232, 93, 58, 0.2);
        border-radius: var(--radius-sm);
        color: var(--ember-glow) !important;
        font-weight: 600;
        font-size: 0.82rem;
    }
    table.m-card td a:hover { color: var(--amber) !important; }
    /* The horizontal-scroll wrapper isn't needed when we've reflowed */
    .scroll-x { overflow-x: visible; }
}

/* ─── Endpoint code samples on mobile ─── */
@media (max-width: 768px) {
    .endpoint-card {
        padding: 16px;
        margin-bottom: 14px;
    }
    .endpoint-method::before {
        content: '';   /* drop the noisy "POST /data.php · " prefix */
    }
    .endpoint-method {
        font-size: 0.95rem;
    }
    .endpoint-params {
        padding: 10px 12px;
    }
    .endpoint-param {
        font-size: 0.82rem;
    }
    .endpoint-param-hint {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
    .code-tab {
        padding: 9px 10px;
        font-size: 0.78rem;
    }
    .code-block pre {
        padding: 14px 14px 14px 14px;
        font-size: 0.78rem;
        padding-top: 38px;   /* room for the copy button moved up */
    }
    .code-copy {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 0.68rem;
    }
    .code-response pre {
        font-size: 0.74rem;
    }
}

/* ─── Sidebar / topbar / dashboard polish on mobile ─── */
@media (max-width: 968px) {
    .dash-topbar {
        padding: 14px 18px;
    }
    .dash-topbar h1 {
        font-size: 1.1rem;
    }
    .dash-content {
        padding: 18px 16px 80px;   /* extra bottom for safe-area */
    }
    .sidebar {
        width: min(300px, 88vw);
    }
    .sidebar-brand {
        padding: 18px 18px;
    }
    .sidebar-link {
        padding: 13px 14px;       /* taller for thumbs */
        font-size: 0.95rem;
    }
    .sidebar-close {
        position: absolute;
        top: 14px; right: 14px;
        width: 36px; height: 36px;
        display: grid;
        place-items: center;
        border: 1px solid var(--glass-border);
        background: var(--glass);
        color: var(--mist);
        border-radius: var(--radius-sm);
        cursor: pointer;
    }
    .sidebar-close:hover {
        color: var(--white);
        border-color: var(--glass-strong);
    }
    .sidebar-close svg { width: 16px; height: 16px; }
    /* Lang switcher: shrink to flag-only on small screens */
    #langCurrent .lc-code { display: none; }
    .lang-btn { padding: 8px 10px; }
}
@media (min-width: 969px) {
    .sidebar-close { display: none; }
}

/* ─── Hero + section padding on small screens ─── */
@media (max-width: 768px) {
    .hero {
        padding: 48px 0 56px;
    }
    .hero h1 {
        font-size: clamp(1.85rem, 8vw, 2.5rem);
        margin-bottom: 18px;
    }
    .hero-lede {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    .hero-actions {
        margin-bottom: 36px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    .hero-actions .btn { justify-content: center; }
    .stats-row {
        border-radius: var(--radius-lg);
    }
    .stat {
        padding: 18px 14px;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .stat-label {
        font-size: 0.62rem;
    }
    .section { padding: 56px 0; }
    .section-header { margin-bottom: 36px; }
    .section-header h2 { font-size: clamp(1.4rem, 6vw, 1.85rem); }
    .feature-card,
    .step,
    .news-card { /* slightly tighter cards */ }
    .step { padding: 24px 18px; }
    .step-num { width: 56px; height: 56px; font-size: 1.15rem; }
}

/* ─── Footer accordion on mobile ─── */
@media (max-width: 768px) {
    .footer-grid { gap: 8px; }
    .footer-grid > div:not(:first-child) {
        border-top: 1px solid var(--glass-border);
        padding-top: 16px;
    }
    .site-footer details > summary {
        font-family: 'Sora', sans-serif;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--snow);
        font-weight: 700;
        list-style: none;
        cursor: pointer;
        padding: 8px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .site-footer details > summary::-webkit-details-marker { display: none; }
    .site-footer details > summary::after {
        content: '+';
        font-size: 1.1rem;
        font-weight: 400;
        color: var(--mist);
        transition: transform var(--duration-fast);
    }
    .site-footer details[open] > summary::after { content: '−'; }
    .site-footer details ul { padding-top: 6px; padding-bottom: 12px; }
}
@media (min-width: 769px) {
    .site-footer details > summary {
        font-family: 'Sora', sans-serif;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--snow);
        font-weight: 700;
        margin-bottom: 16px;
        list-style: none;
        cursor: default;
    }
    .site-footer details > summary::-webkit-details-marker { display: none; }
    .site-footer details > summary::after { content: ''; }
    .site-footer details[open] { /* always-open look on desktop */ }
    .site-footer details:not([open]) ul { display: block; }
}

/* ─── Auth shell on small screens ─── */
@media (max-width: 480px) {
    .auth-shell { padding: 32px 16px 48px; }
    .auth-card { padding: 32px 22px; border-radius: var(--radius-lg); }
    .auth-card h1, .auth-card h2 { font-size: 1.4rem; }
    .wiz-step .field { margin-bottom: 14px; }
    .wiz-actions { flex-direction: column-reverse; }
    .wiz-actions .btn { width: 100%; }
}

/* ─── KPI grid: smaller min so 2-up fits on tiny screens ─── */
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi { padding: 16px 12px; }
    .kpi-value { font-size: 1.45rem; }
    .kpi-label { font-size: 0.62rem; letter-spacing: 0.1em; }
}

/* ─── Module pills on mobile: shrink + wrap nicely ─── */
@media (max-width: 768px) {
    .module-pill {
        padding: 10px 14px;
        font-size: 0.82rem;
    }
    .docs-actions .btn { font-size: 0.78rem; }
}

/* ─── Wallet QR scales down on tiny screens ─── */
@media (max-width: 480px) {
    .wallet-qr img { max-width: 160px; }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER LAYOUT — MOBILE OVERFLOW FIXES
   ═══════════════════════════════════════════════════════════════ */

/* Header inner: prevent any flex child from overflowing the viewport.
   We don't clip with `overflow: hidden` here — the language-switcher
   dropdown is positioned below the header and would be clipped. The
   body's `overflow-x: hidden` is the real horizontal safety net. */
.site-header { width: 100%; max-width: 100vw; }
.header-inner {
    width: 100%;
    max-width: var(--container-max);
    box-sizing: border-box;
}
.brand { min-width: 0; flex-shrink: 1; overflow: hidden; }
.brand > span:not(.brand-mark) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-actions { flex-shrink: 0; }

/* Auth buttons: present in BOTH the slide-out menu and the desktop
   header bar. CSS picks one per breakpoint. */
.nav-mobile-auth { display: none; }
.header-desktop-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 968px) {
    .header-inner { gap: 10px; padding: 0 16px; }
    .header-desktop-auth { display: none !important; }

    .nav-mobile-auth {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 20px;
        margin-top: auto;             /* anchor to bottom of slide-out */
        border-top: 1px solid var(--glass-border);
    }
    .nav-mobile-auth .btn { width: 100%; justify-content: center; }
    /* Make sure the slide-out is tall enough for the bottom anchor */
    .nav { display: flex; }
}

/* Tiny screens: shrink brand a bit so brand + lang + hamburger never crowd. */
@media (max-width: 480px) {
    .header-inner { gap: 8px; padding: 0 12px; }
    .brand { font-size: 1.05rem; gap: 8px; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-tag { display: none; }   /* drop the "labs" pill on very tiny */
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD TOPBAR — H1 TRUNCATION & OVERFLOW SAFETY
   ═══════════════════════════════════════════════════════════════ */

.dash-topbar {
    width: 100%;
    box-sizing: border-box;
    /* No overflow:hidden here — the lang-switcher dropdown sits below
       the topbar and would be clipped. Children handle their own
       shrinking via min-width:0 / flex-shrink. */
}
.dash-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;        /* allow shrinking below content width */
    overflow: hidden;
}
.dash-topbar h1 {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-topbar-actions {
    flex-shrink: 0;       /* lang switcher never gets squeezed off */
}
.dash-main { min-width: 0; }   /* prevent flex child from forcing wider than viewport */

@media (max-width: 480px) {
    .dash-topbar { padding: 12px 14px; }
    .dash-topbar h1 { font-size: 1rem; }
}

/* Lang switcher dropdown: clamp so it never overflows the right edge on phones. */
@media (max-width: 480px) {
    .lang-menu {
        max-width: calc(100vw - 24px);
    }
}
