/* ============================================================================
   SomsanithTech Enterprise — Global Stylesheet
   ============================================================================
   Location: assets/css/style.css
   Served at: /assets/css/style.css

   EYE-COMFORT EDITION — warm, low-strain palette for long reading sessions
   ----------------------------------------------------------------------------
   Design principles:
     1. Warm charcoal canvas (never cool blue-black)
     2. Warm amber accents (never high-intensity blue — no blue-light fatigue)
     3. Warm off-white text (never pure #ffffff)
     4. Contrast ~9–11:1 — restful but still highly readable
     5. Comfortable line-height for long-form copy (1.75–1.85)
     6. Reading highlight uses warm honey, never neon — safe for hours
     7. Soft warm shadows — no clinical cool drops
     8. Optional light mode via prefers-color-scheme: light

   Layout revision:
     All outer containers are FULL-WIDTH (no max-width, no auto-centering).
     Horizontal padding is ZERO on outer shells so content touches the
     viewport edges. Inner components keep their own internal spacing.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. CSS variables & theme
   ---------------------------------------------------------------------------- */
:root {
    /* ---- Brand amber family (was Dodger-Blue) ---------------------------- */
    --st-color-primary: #f59e0b;
    --st-color-primary-hover: #d97706;
    --st-color-primary-glow: rgba(245, 158, 11, 0.28);

    /* ---- Secondary accent (was cyan) ------------------------------------ */
    --st-color-accent: #fb923c;
    --st-color-accent-hover: #ea580c;

    /* ---- Semantic colors ------------------------------------------------- */
    --st-color-green: #a3b86c;              /* warm olive — gentler than green */
    --st-color-green-hover: #8ea657;
    --st-color-warning: #f0b96a;
    --st-color-danger: #e08585;              /* warm red — muted */
    --st-color-danger-hover: #c96868;

    /* ---- Surfaces — warm charcoal family, never cool --------------------- */
    --st-color-bg: #1a1611;                  /* warm charcoal             */
    --st-color-card: rgba(40, 34, 26, 0.85); /* warm brown-grey glass     */
    --st-color-card-solid: #28221a;
    --st-color-card-hover: rgba(52, 44, 34, 0.80);
    --st-color-input: rgba(28, 23, 17, 0.75);
    --st-color-border: rgba(239, 230, 214, 0.09);
    --st-color-border-subtle: rgba(239, 230, 214, 0.045);

    /* ---- Typography ------------------------------------------------------ */
    --st-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    --st-font-mono: 'JetBrains Mono', Fira Code, Consolas, monospace;
    --st-color-text-main: #efe6d6;           /* warm off-white            */
    --st-color-text-sub: #a89f8c;            /* warm grey                 */
    --st-color-text-muted: #7a7265;          /* deeper warm grey          */

    /* ---- Validation ------------------------------------------------------ */
    --st-color-error-bg: rgba(224, 133, 133, 0.14);
    --st-color-error-border: rgba(224, 133, 133, 0.38);
    --st-color-error-text: #f0bdbd;

    --st-color-success-bg: rgba(163, 184, 108, 0.14);
    --st-color-success-border: rgba(163, 184, 108, 0.38);
    --st-color-success-text: #cfdba5;

    /* ---- Structure ------------------------------------------------------- */
    --st-radius: 16px;
    --st-radius-sm: 10px;
    --st-radius-xs: 6px;
    --st-shadow-sm: 0 4px 12px rgba(60, 40, 15, 0.35);
    --st-shadow-lg: 0 25px 50px -12px rgba(60, 40, 15, 0.58);

    --ink: #1a1611;

    /* ---- Floating chat (warm orange/gold, preserved) --------------------- */
    --st-chat-gradient-start: #f7971e;
    --st-chat-gradient-end:   #ffd200;
    --st-chat-badge:          #ff4444;

    /* ---- Full-width layout knobs (L/R padding = 0) ----------------------- */
    --st-page-gutter: 0rem;
    --st-block-gutter: 0rem;

    /* ---- Reading highlight (honey yellow, safe for hours) ---------------- */
    /*  `color: inherit` is critical — the mark paints only behind the text,
        so the original color always wins and text stays readable.        */
    --st-read-sentence-bg:      rgba(253, 224, 71, 0.32);
    --st-read-sentence-outline: rgba(217, 119, 6, 0.55);
    --st-read-sentence-glow:    rgba(217, 119, 6, 0.14);

    --st-read-word-bg:          rgba(250, 204, 21, 0.48);
    --st-read-word-outline:     rgba(180, 83, 9, 0.65);
    --st-read-word-glow:        rgba(180, 83, 9, 0.20);

    --st-read-active-bg:        rgba(245, 158, 11, 0.14);
    --st-read-active-outline:   rgba(245, 158, 11, 0.42);

    /* ---- Reading rhythm -------------------------------------------------- */
    --st-reading-size:    17px;
    --st-reading-leading: 1.8;
    --st-reading-tracking: 0.005em;
}

/* ----------------------------------------------------------------------------
   2. Base / reset
   ---------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

@supports (overflow: clip) {
    html { overflow-x: clip; }
}

body {
    background-color: var(--st-color-bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 146, 60, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--st-color-text-main);
    font-family: var(--st-font-sans);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    width: 100%;
    line-height: var(--st-reading-leading);
    letter-spacing: var(--st-reading-tracking);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01";
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--st-color-accent);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--st-color-accent-hover);
}

/* Muted warm selection — never harsh blue */
::selection {
    background: rgba(253, 224, 71, 0.35);
    color: var(--st-color-text-main);
}

/* ============================================================================
   READING HIGHLIGHT SYSTEM — warm honey, safe for hours
   ============================================================================
   Cover every possible selector a TTS / reader script may add. All rules use
   `color: inherit` so the yellow tint never hides the original text color.
   ============================================================================ */

mark,
.highlight,
.reading-highlight,
.tts-sentence-active,
.tts-sentence,
.tts-highlight,
.sentence-active,
.sentence-highlight,
.reader-active,
[data-tts-sentence],
[data-tts-active],
[class*="tts"][class*="sentence"],
[class*="sentence"][class*="active"] {
    background-color: var(--st-read-sentence-bg);
    color: inherit;                              /* ← key: keeps text color */
    border-radius: 4px;
    padding: 0.08em 0.18em;
    box-shadow:
        0 0 0 1px var(--st-read-sentence-outline),
        0 0 10px var(--st-read-sentence-glow);
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease,
        color 0.25s ease;
}

.tts-word-active,
.tts-word,
.tts-speaking,
.word-active,
.word-highlight,
.highlighted-word,
.reading-word,
[data-tts-word],
[class*="tts"][class*="word"],
[class*="word"][class*="active"] {
    background-color: var(--st-read-word-bg);
    color: inherit;
    border-radius: 3px;
    padding: 0.03em 0.12em;
    box-shadow:
        0 0 0 1.5px var(--st-read-word-outline),
        0 0 12px var(--st-read-word-glow);
    text-decoration: none;
}

.reading-current,
.reader-current,
[data-tts-current] {
    background-color: var(--st-read-active-bg);
    color: inherit;
    border-radius: 4px;
    padding: 0.08em 0.18em;
    box-shadow: 0 0 0 1px var(--st-read-active-outline);
}

/* Catch inline styles a TTS script may have injected */
.post-content span[style*="background"],
.post-container span[style*="background"],
article span[style*="background"] {
    background-color: var(--st-read-sentence-bg) !important;
    color: inherit !important;
    border-radius: 4px;
    padding: 0.08em 0.18em;
    box-shadow: 0 0 0 1px var(--st-read-sentence-outline);
}

/* ----------------------------------------------------------------------------
   3. Accessibility & utilities
   ---------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -999;
}

.skip-link:focus,
.skip-link:active {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    background: var(--st-color-primary);
    color: #1a1611;
    border-radius: var(--st-radius-xs);
    z-index: 9999;
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--st-shadow-sm);
}

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sub     { color: var(--st-color-text-sub); }
.text-muted   { color: var(--st-color-text-muted); }
.text-accent  { color: var(--st-color-accent); }
.text-danger  { color: var(--st-color-danger); }
.text-success { color: var(--st-color-green); }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.gap-1        { gap: 0.5rem; }
.gap-2        { gap: 1rem; }

.link {
    color: var(--st-color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

.link:hover {
    color: var(--st-color-primary-hover);
    text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   4. Global navigation & header
   ---------------------------------------------------------------------------- */
.navbar,
.topbar {
    background: rgba(40, 34, 26, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--st-color-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.navbar-brand,
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #efe6d6;
    text-decoration: none;
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--st-color-primary);
    border-radius: var(--st-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    color: #1a1611;
    box-shadow: 0 2px 8px var(--st-color-primary-glow);
    flex-shrink: 0;
}

.brand-title span,
.brand-title > span {
    background: linear-gradient(135deg, #efe6d6 0%, #f8c974 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--st-color-text-sub);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.navbar-links a {
    color: var(--st-color-text-sub);
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-links a:hover,
.navbar-links a[aria-current="page"],
.navbar-links a.active {
    color: var(--st-color-text-main);
    background: rgba(239, 230, 214, 0.07);
}

.navbar-links a[aria-current="page"] {
    background: var(--st-color-primary);
    color: #1a1611;
    font-weight: 700;
}

.user-profile-menu,
.top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.top-link {
    color: var(--st-color-text-sub);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.top-link:hover {
    color: var(--st-color-text-main);
    background: rgba(239, 230, 214, 0.06);
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 230, 214, 0.05);
    border: 1px solid var(--st-color-border);
    color: var(--st-color-text-main);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: rgba(239, 230, 214, 0.10);
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--st-color-danger);
    color: #1a1611;
    border: none;
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
    min-width: 18px;
    justify-content: center;
    font-weight: 700;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem;
    background: rgba(239, 230, 214, 0.05);
    border: 1px solid var(--st-color-border);
    border-radius: 9999px;
    color: var(--st-color-text-main);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.user-pill:hover {
    background: rgba(239, 230, 214, 0.10);
}

.navbar-toggle {
    font-size: 1.25rem;
    background: transparent;
    border: 1px solid var(--st-color-border);
    color: var(--st-color-text-main);
    cursor: pointer;
    display: none;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
}

/* ----------------------------------------------------------------------------
   5. Authentication (login, register, logout)
   ---------------------------------------------------------------------------- */
.st-register-layout,
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2.5rem 0;
}

.st-register-card,
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--st-color-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 2.75rem 2.25rem;
    box-shadow: var(--st-shadow-lg);
    position: relative;
    overflow: hidden;
}

.st-register-card::before,
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fb923c, #a3b86c);
}

.st-register-header,
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.st-register-header h1,
.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #efe6d6 0%, #c9bea8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.5rem 0;
}

.st-register-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.34);
    color: #f8c974;
    font-size: 0.8rem;
    font-weight: 600;
}

.st-alert-box,
.alert-banner {
    padding: 0.875rem 1rem;
    border-radius: var(--st-radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.st-alert-box.error,
.alert-banner.error {
    background: var(--st-color-error-bg);
    border: 1px solid var(--st-color-error-border);
    color: var(--st-color-error-text);
}

.st-alert-box.success,
.alert-banner.success {
    background: var(--st-color-success-bg);
    border: 1px solid var(--st-color-success-border);
    color: var(--st-color-success-text);
}

.st-form-group,
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.st-field-wrapper,
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.st-field-wrapper label,
.field-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #ddd2bc;
}

.st-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.st-input,
.form-control {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    background: var(--st-color-input);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    color: var(--st-color-text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.st-input:focus,
.form-control:focus {
    border-color: var(--st-color-primary);
    box-shadow: 0 0 0 4px var(--st-color-primary-glow);
    background: rgba(30, 25, 18, 0.92);
}

textarea.st-input,
textarea.form-control {
    height: auto;
    padding: 0.75rem 1rem;
    min-height: 120px;
    resize: vertical;
    line-height: 1.7;
}

.st-input-container .st-input {
    padding-right: 3rem;
}

.st-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--st-color-text-sub);
    cursor: pointer;
    border-radius: var(--st-radius-xs);
    font-size: 1rem;
}

.st-password-toggle:hover {
    color: var(--st-color-text-main);
    background: rgba(239, 230, 214, 0.06);
}

.st-strength-meter {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.st-strength-track {
    height: 6px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.st-strength-bar {
    height: 100%;
    width: 0;
    background: transparent;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.st-strength-text {
    font-size: 0.75rem;
    color: var(--st-color-text-sub);
    min-height: 1em;
}

.st-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--st-color-text-sub);
    cursor: pointer;
    line-height: 1.6;
}

.st-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.2rem;
    accent-color: var(--st-color-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.st-text-link {
    color: var(--st-color-primary);
    text-decoration: none;
    font-weight: 600;
}

.st-text-link:hover {
    color: var(--st-color-primary-hover);
    text-decoration: underline;
}

.st-submit-btn,
.btn-submit {
    height: 50px;
    border-radius: var(--st-radius-sm);
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1a1611;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--st-color-primary-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.st-submit-btn:hover,
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--st-color-primary-glow);
}

.st-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--st-color-text-sub);
}

.logout-box {
    text-align: center;
    padding: 2rem 1rem;
}

.logout-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--st-color-warning);
}

/* ----------------------------------------------------------------------------
   6. Core layout — FULL-WIDTH SHELL, ZERO L/R
   ---------------------------------------------------------------------------- */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.main-wrapper,
.page-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem var(--st-page-gutter);
    border: 0;
    border-radius: 0;
}

/* ----------------------------------------------------------------------------
   7. Dashboard modules
   ---------------------------------------------------------------------------- */
.hero {
    margin-bottom: 2rem;
}

.hero-banner {
    padding: 3rem 2rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    margin-bottom: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-copy {
    font-size: 1.05rem;
    color: var(--st-color-text-sub);
    margin: 0 0 1.5rem 0;
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-color-accent);
    margin-bottom: 0.5rem;
}

.membership-card {
    padding: 1.25rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.membership-card .label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--st-color-text-sub);
    margin-bottom: 0.35rem;
}

.membership-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #efe6d6;
}

.membership-note {
    font-size: 0.8rem;
    color: var(--st-color-text-sub);
    margin-top: 0.2rem;
}

.kpis,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi,
.stat-card {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1.25rem;
    transition: border-color 0.2s ease;
}

.kpi:hover,
.stat-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
}

.kpi-label,
.stat-label {
    font-size: 0.75rem;
    color: var(--st-color-text-sub);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value,
.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #efe6d6;
    margin: 0.35rem 0;
    line-height: 1.2;
}

.kpi-note {
    font-size: 0.75rem;
    color: var(--st-color-text-muted);
}

.section {
    margin-top: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.side-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card,
.content-card {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-pad {
    padding: 1.5rem;
}

.card-head,
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--st-color-border-subtle);
    flex-wrap: wrap;
}

.card-title,
.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #efe6d6;
}

.card-sub {
    font-size: 0.8rem;
    color: var(--st-color-text-sub);
    margin: 0.15rem 0 0 0;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #efe6d6;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(239, 230, 214, 0.06);
    border: 1px solid var(--st-color-border);
    color: var(--st-color-text-sub);
}

.chip.green {
    background: rgba(163, 184, 108, 0.14);
    border-color: rgba(163, 184, 108, 0.34);
    color: #cfdba5;
}

.avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--st-color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1611;
    border: 2px solid rgba(239, 230, 214, 0.2);
    object-fit: cover;
    flex-shrink: 0;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.quick {
    padding: 0.7rem 0.9rem;
    background: rgba(239, 230, 214, 0.04);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    color: var(--st-color-text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.quick:hover {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.38);
}

.learning-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    color: var(--st-color-text-sub);
    margin-bottom: 0.4rem;
}

.progress-head strong {
    color: #efe6d6;
}

.progress {
    height: 8px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-line {
    margin-top: 0.6rem;
}

.learning-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.learning-stat {
    display: flex;
    flex-direction: column;
}

.learning-stat strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.1;
}

.learning-stat span {
    font-size: 0.75rem;
    color: var(--st-color-text-sub);
}

.pulse {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    align-items: end;
    height: 120px;
    margin-top: 0.75rem;
}

.pulse > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.pulse .bar {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pulse .bar > span {
    display: block;
    width: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, #f59e0b 0%, #fb923c 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.pulse .bar-label {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--st-color-text-sub);
}

.revenue-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
}

.revenue-total {
    margin-bottom: 1rem;
}

.revenue-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--st-color-text-sub);
    font-weight: 700;
}

.revenue-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.1;
    margin: 0.25rem 0;
}

.revenue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.revenue-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid var(--st-color-border-subtle);
    border-radius: var(--st-radius-xs);
    font-size: 0.85rem;
}

.revenue-row span {
    color: var(--st-color-text-sub);
}

.revenue-row strong {
    color: #efe6d6;
}

.wallet {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%,
                rgba(251, 146, 60, 0.10) 100%);
    border-color: rgba(245, 158, 11, 0.32);
}

.wallet-balance {
    font-size: 1.85rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.1;
    margin: 0.35rem 0;
}

.wallet-extra {
    font-size: 0.8rem;
    color: var(--st-color-text-sub);
    margin-bottom: 1rem;
}

.wallet-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wallet-actions a {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    background: rgba(239, 230, 214, 0.06);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-xs);
    color: var(--st-color-text-main);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.wallet-actions a:hover {
    background: rgba(245, 158, 11, 0.18);
}

/* ----------------------------------------------------------------------------
   8. Blog, user management, CRUD
   ---------------------------------------------------------------------------- */
.blog-grid,
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.post-card {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.32);
}

.post-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: rgba(28, 23, 17, 0.85);
}

.post-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--st-color-text-sub);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #efe6d6;
    line-height: 1.35;
}

.post-excerpt {
    font-size: 0.875rem;
    color: var(--st-color-text-sub);
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.7;
}

.user-header-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    margin-bottom: 2rem;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--st-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #1a1611;
    border: 2px solid rgba(239, 230, 214, 0.2);
    object-fit: cover;
}

.avatar-md {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--st-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1a1611;
    object-fit: cover;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--st-color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1611;
    object-fit: cover;
}

/* ----------------------------------------------------------------------------
   9. Data tables, buttons, badges
   ---------------------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: rgba(28, 23, 17, 0.9);
    color: var(--st-color-text-sub);
    padding: 0.85rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--st-color-border);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--st-color-border-subtle);
    color: var(--st-color-text-main);
}

.data-table tr:hover td {
    background: rgba(239, 230, 214, 0.02);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--st-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--st-color-primary);
    color: #1a1611;
}

.btn-primary:hover {
    background: var(--st-color-primary-hover);
}

.btn-secondary {
    background: rgba(239, 230, 214, 0.08);
    color: var(--st-color-text-main);
    border: 1px solid var(--st-color-border);
}

.btn-secondary:hover {
    background: rgba(239, 230, 214, 0.14);
}

.btn-danger {
    background: var(--st-color-danger);
    color: #1a1611;
}

.btn-danger:hover {
    background: var(--st-color-danger-hover);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(245, 158, 11, 0.15);
    color: #f8c974;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-success {
    background: rgba(163, 184, 108, 0.15);
    color: #cfdba5;
    border: 1px solid rgba(163, 184, 108, 0.32);
}

.badge-warning {
    background: rgba(240, 185, 106, 0.15);
    color: #f2c998;
    border: 1px solid rgba(240, 185, 106, 0.32);
}

/* ----------------------------------------------------------------------------
   10. Alerts
   ---------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--st-radius-sm);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.alert-info {
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.34);
    color: #f8c974;
}

.alert-warning {
    background: rgba(240, 185, 106, 0.10);
    border: 1px solid rgba(240, 185, 106, 0.34);
    color: #f2c998;
}

.alert-success {
    background: var(--st-color-success-bg);
    border: 1px solid var(--st-color-success-border);
    color: var(--st-color-success-text);
}

/* ----------------------------------------------------------------------------
   11. Footer — FULL-WIDTH, ZERO L/R
   ---------------------------------------------------------------------------- */
.st-ft-wrapper {
    margin-top: 3rem;
}

.st-stats-section,
.st-lang-section,
.st-upgrade-section {
    width: 100%;
    max-width: none;
    margin: 2rem 0;
    padding: 0 var(--st-block-gutter);
}

.st-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #efe6d6;
}

.st-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.st-stat-card {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1.25rem;
    text-align: center;
}

.st-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.st-stat-label {
    font-size: 0.8rem;
    color: var(--st-color-text-sub);
    margin-top: 0.35rem;
}

.st-pulse-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--st-color-green);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(163, 184, 108, 0.7);
    animation: st-pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes st-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(163, 184, 108, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(163, 184, 108, 0); }
    100% { box-shadow: 0 0 0 0 rgba(163, 184, 108, 0); }
}

.st-lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.st-lang-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.st-lang-flag {
    font-size: 1.5rem;
    line-height: 1;
}

.st-lang-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.st-lang-country {
    font-size: 0.85rem;
    font-weight: 600;
    color: #efe6d6;
}

.st-lang-code {
    font-size: 0.7rem;
    color: var(--st-color-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.st-upgrade-card {
    width: 100%;
    max-width: none;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.75rem;
    margin: 0;
}

.st-upgrade-subtitle {
    font-size: 0.9rem;
    color: var(--st-color-text-sub);
    margin: 0 0 1.25rem 0;
}

.st-paypal-box {
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid var(--st-color-border-subtle);
    border-radius: var(--st-radius-sm);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.st-paypal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #efe6d6;
    margin-bottom: 0.5rem;
}

.st-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.st-form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ddd2bc;
}

.st-select-input {
    width: 100%;
    height: 44px;
    padding: 0 0.85rem;
    background: var(--st-color-input);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    color: var(--st-color-text-main);
    font-size: 0.9rem;
    outline: none;
}

.st-select-input:focus {
    border-color: var(--st-color-primary);
    box-shadow: 0 0 0 4px var(--st-color-primary-glow);
}

.st-bank-notice {
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid var(--st-color-border-subtle);
    border-radius: var(--st-radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    color: var(--st-color-text-sub);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.st-bank-notice strong {
    color: #efe6d6;
}

.st-qr-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.st-qr-img {
    max-width: 220px;
    border-radius: var(--st-radius-sm);
    border: 1px solid var(--st-color-border);
    background: #efe6d6;
    padding: 0.5rem;
}

.st-btn-confirm {
    width: 100%;
    height: 48px;
    background: var(--st-color-green);
    border: none;
    border-radius: var(--st-radius-sm);
    color: #1a1611;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.st-btn-confirm:hover {
    background: var(--st-color-green-hover);
}

.st-footer-nav {
    background: rgba(28, 23, 17, 0.96);
    border-top: 1px solid var(--st-color-border);
    padding: 3.5rem 0 2rem;
    margin-top: 3rem;
    width: 100%;
}

.st-footer-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
}

.st-footer-col h3,
.st-footer-col h4 {
    color: #efe6d6;
    font-weight: 700;
    margin: 0 0 1.15rem 0;
}

.st-footer-col p {
    font-size: 0.9rem;
    color: var(--st-color-text-sub);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.st-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    line-height: 2;
}

.st-footer-list a {
    color: var(--st-color-text-sub);
    text-decoration: none;
    transition: color 0.2s ease;
}

.st-footer-list a:hover {
    color: #efe6d6;
}

.st-social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.st-social-link {
    color: var(--st-color-text-sub);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    background: rgba(239, 230, 214, 0.04);
    border: 1px solid var(--st-color-border);
    border-radius: 9999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.st-social-link:hover {
    background: rgba(245, 158, 11, 0.18);
    color: #efe6d6;
}

.st-footer-bottom {
    width: 100%;
    max-width: none;
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--st-color-border-subtle);
    text-align: center;
    font-size: 0.85rem;
    color: var(--st-color-text-sub);
}

.st-footer-bottom a {
    color: var(--st-color-text-sub);
    text-decoration: none;
}

.st-footer-bottom a:hover {
    color: #efe6d6;
}

/* ----------------------------------------------------------------------------
   12. Responsive
   ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .grid,
    .hero-grid,
    .learning-top,
    .revenue-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--st-color-border);
    }

    .navbar-links.active {
        display: flex;
    }

    .navbar-links a {
        text-align: left;
    }

    .user-header-card {
        flex-direction: column;
        text-align: center;
    }

    .st-footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    :root {
        --st-reading-size: 16px;
        --st-reading-leading: 1.72;
    }

    .st-register-card,
    .auth-card,
    .content-card,
    .card {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .stats-grid,
    .kpis {
        grid-template-columns: 1fr;
    }

    .st-upgrade-card {
        padding: 1.25rem 1rem;
    }
}

/* ----------------------------------------------------------------------------
   13. Blog post page — FULL-WIDTH, ZERO L/R
   ---------------------------------------------------------------------------- */
.post-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem 0;
    word-wrap: break-word;
    line-height: var(--st-reading-leading);
    font-size: var(--st-reading-size);

    background: var(--st-color-card-solid);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    color: var(--st-color-text-main);
}

.post-container .post-content {
    color: var(--st-color-text-main);
    font-size: var(--st-reading-size);
    margin: 1.5rem 0;
    line-height: var(--st-reading-leading);

    background: rgba(28, 23, 17, 0.55);
    border: 1px solid var(--st-color-border-subtle);
    border-radius: var(--st-radius-sm);
    padding: 1.5rem 0;
}

.post-container .post-content p {
    margin: 0 0 1.2em 0;
    color: var(--st-color-text-main);
}

.post-container .post-content a,
.post-container .post-content a:visited {
    color: #f8c974;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-container .post-content a:hover {
    color: #fcd994;
}

.post-container .post-content pre {
    background: #171310;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1rem 1.15rem;
    overflow-x: auto;
    font-family: var(--st-font-mono);
    font-size: .88rem;
    line-height: 1.7;
    color: #d8ceba;
}

.post-container .post-content code {
    font-family: var(--st-font-mono);
    font-size: .9em;
    color: #d8ceba;
}

.post-container .post-content blockquote {
    border-left: 3px solid var(--st-color-primary);
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: var(--st-color-text-sub);
    font-style: italic;
}

/* --- Post header --------------------------------------------------------- */
.post-container > h1 {
    color: #efe6d6;
    font-size: 1.85rem;
    line-height: 1.35;
    margin: 0 0 .6rem 0;
    letter-spacing: -0.01em;
}

.post-container > p {
    color: var(--st-color-text-sub);
    margin: .3rem 0;
    font-size: .9rem;
}

.post-container > p a {
    color: #f8c974;
    text-decoration: none;
    font-weight: 600;
}

.post-container > p a:hover {
    color: #fcd994;
    text-decoration: underline;
}

/* --- Attached media ------------------------------------------------------ */
.media-responsive {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.25rem 0;
    border-radius: var(--st-radius-sm);
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.18);
    background: #000;
}

/* --- Action buttons (like / dislike / follow) ---------------------------- */
.action-buttons {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.action-buttons form {
    display: inline-flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.action-buttons button {
    font-size: .95rem;
    padding: .55rem 1rem;
    border-radius: var(--st-radius-sm);
    border: 1px solid var(--st-color-border);
    background: #2e2720;
    color: #ddd2bc;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .2s ease, border-color .2s ease,
                color .2s ease, transform .1s ease;
}

.action-buttons button:hover {
    background: #3b3228;
    border-color: #5a4d3d;
    color: #efe6d6;
}

.action-buttons button:active {
    transform: translateY(1px);
}

/* Like — idle and pressed */
.action-buttons button[name="action"][value="like"] {
    background: #2a3a1c;
    border-color: #3b5228;
    color: #cfdba5;
}

.action-buttons button[name="action"][value="like"]:hover {
    background: #3b5228;
    border-color: #4f6e36;
    color: #efe6d6;
}

.action-buttons button[name="action"][value="like"][aria-pressed="true"] {
    background: #a3b86c;
    border-color: #8ea657;
    color: #1a1611;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(163, 184, 108, 0.35);
}

/* Dislike — idle and pressed */
.action-buttons button[name="action"][value="dislike"] {
    background: #4a1e1e;
    border-color: #672c2c;
    color: #f0c9c9;
}

.action-buttons button[name="action"][value="dislike"]:hover {
    background: #672c2c;
    border-color: #8a3838;
    color: #efe6d6;
}

.action-buttons button[name="action"][value="dislike"][aria-pressed="true"] {
    background: #c95a5a;
    border-color: #b44b4b;
    color: #efe6d6;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(201, 90, 90, 0.35);
}

/* Follow — the last form in the action group */
.action-buttons form:last-child button {
    background: var(--st-color-primary);
    border-color: var(--st-color-primary);
    color: #1a1611;
    font-weight: 700;
}

.action-buttons form:last-child button:hover {
    background: var(--st-color-primary-hover);
    border-color: var(--st-color-primary-hover);
    color: #1a1611;
}

/* --- Clickable dictionary words ----------------------------------------- */
.clickable-word {
    cursor: pointer;
    color: #f8c974;
    background: transparent;
    border-bottom: 1px dotted rgba(248, 201, 116, 0.65);
    padding: 0 1px;
    border-radius: 3px;
    transition: background-color .2s ease, color .2s ease;
}

.clickable-word:hover,
.clickable-word:focus {
    background: #4a3a1c;
    color: #efe6d6;
    outline: none;
    border-bottom-color: transparent;
}

.clickable-word:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* --- Dictionary modal ---------------------------------------------------- */
#dictionaryModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
    overflow-y: auto;
}

#dictionaryModal.show {
    display: flex;
}

#dictionaryModal .modal-content {
    position: relative;
    background: #28221a;
    color: #efe6d6;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--st-shadow-lg);
}

#dictionaryModal h3 {
    margin: 0 0 .5rem 0;
    font-size: 1.5rem;
    color: #efe6d6;
}

#dictionaryModal .close-btn {
    position: absolute;
    top: .5rem;
    right: .75rem;
    background: transparent;
    border: none;
    color: #a89f8c;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: .25rem .5rem;
    border-radius: 6px;
}

#dictionaryModal .close-btn:hover {
    color: #efe6d6;
    background: rgba(239, 230, 214, 0.08);
}

#dictionaryModal strong {
    color: #efe6d6;
}

#dictionaryModal #modalIpa,
#dictionaryModal #modalPartOfSpeech,
#dictionaryModal #modalDefinition,
#dictionaryModal #modalSamples,
#dictionaryModal #modalTranslations {
    color: #efe6d6;
    font-size: .95rem;
    line-height: 1.75;
    margin: .35rem 0;
}

/* --- Teaching canvas ----------------------------------------------------- */
#teachingLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
    display: none;
}

.teaching-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.teaching-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 34, 26, 0.96);
    border: 1px solid var(--st-color-border);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    pointer-events: auto;
    align-items: center;
    max-width: 95vw;
    overflow-x: auto;
}

.teaching-controls button {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--st-color-border);
    cursor: pointer;
    background: #2e2720;
    color: #ddd2bc;
    flex-shrink: 0;
    font-size: .9rem;
    font-weight: 600;
}

.teaching-controls button:hover {
    background: #3b3228;
    color: #efe6d6;
}

.teaching-controls button.active {
    background: var(--st-color-primary);
    color: #1a1611;
    border-color: var(--st-color-primary);
}

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 600px) {
    .post-container {
        padding: 1.25rem 0;
    }

    .post-container .post-content {
        padding: 1rem 0;
        font-size: 1rem;
        line-height: 1.7;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons form {
        width: 100%;
        justify-content: center;
    }

    .action-buttons button {
        width: 100%;
    }
}

/* ----------------------------------------------------------------------------
   15. Dictionary page
   ---------------------------------------------------------------------------- */
.word-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.word-card {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1.25rem 1.5rem;
    color: var(--st-color-text-main);
}

.word-card:hover {
    border-color: rgba(245, 158, 11, 0.32);
}

.word-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.word-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #efe6d6;
}

.word-ipa {
    font-family: var(--st-font-mono);
    font-size: 0.9rem;
    color: var(--st-color-text-sub);
}

.word-meta,
.word-samples,
.word-translations {
    font-size: 0.9rem;
    color: var(--st-color-text-sub);
    line-height: 1.7;
    margin: 0.35rem 0;
}

.word-meta strong,
.word-samples strong,
.word-translations strong {
    color: #efe6d6;
    font-weight: 700;
    margin-right: 0.3rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--st-color-border);
    color: #efe6d6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.pagination a:hover,
.pagination a:focus {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--st-color-primary);
    color: #efe6d6;
}

.pagination .current {
    background: var(--st-color-primary);
    border-color: var(--st-color-primary);
    color: #1a1611;
    pointer-events: none;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination .ellipsis {
    border: none;
    background: transparent;
    color: var(--st-color-text-sub);
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
   16. Learned words page
   ---------------------------------------------------------------------------- */
.learned-words-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    background: var(--st-color-card);
    margin-bottom: 1.5rem;
}

.learned-words-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 1000px;
}

.learned-words-table th {
    background: rgba(28, 23, 17, 0.95);
    color: #ddd2bc;
    font-weight: 700;
    text-align: left;
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(239, 230, 214, 0.08);
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.learned-words-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(239, 230, 214, 0.05);
    color: #efe6d6;
    vertical-align: top;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 320px;
}

.learned-words-table tr:hover td {
    background: rgba(239, 230, 214, 0.02);
}

.learned-words-table td strong {
    color: #efe6d6;
}

.lw-ipa {
    font-family: var(--st-font-mono);
    font-size: .85rem;
    color: #ddd2bc;
}

.lw-mastery {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 90px;
}

.lw-mastery-track {
    height: 6px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.lw-mastery-track > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    border-radius: 9999px;
    transition: width .3s ease;
}

.lw-mastery-label {
    font-size: .7rem;
    color: #a89f8c;
    font-weight: 600;
}

/* Responsive: collapse to cards on narrow screens */
@media (max-width: 800px) {
    .learned-words-table {
        min-width: 0;
        font-size: .88rem;
    }

    .learned-words-table thead {
        display: none;
    }

    .learned-words-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: .75rem;
        border: 1px solid rgba(239, 230, 214, 0.06);
        border-radius: 10px;
        background: rgba(239, 230, 214, 0.02);
    }

    .learned-words-table td {
        display: block;
        padding: .35rem 0;
        border: none;
        max-width: none;
    }

    .learned-words-table td::before {
        content: attr(data-label);
        display: block;
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: #a89f8c;
        margin-bottom: .15rem;
    }
}

/* Print */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .navbar,
    .st-footer-nav,
    .pagination,
    .btn,
    .card-head button {
        display: none !important;
    }

    .main-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .content-card,
    .learned-words-table-wrapper {
        border: none !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }

    .learned-words-table,
    .learned-words-table th,
    .learned-words-table td {
        color: #000000 !important;
        background: #ffffff !important;
        border: 1px solid #000000 !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
    }

    .learned-words-table th {
        background: #f0f0f0 !important;
    }

    .lw-mastery-track {
        background: #e5e5e5 !important;
    }

    .lw-mastery-track > span {
        background: #d97706 !important;
    }

    /* Preserve highlight on paper */
    mark,
    .highlight,
    .reading-highlight,
    .tts-sentence-active,
    .tts-word-active {
        background: #fff3b0 !important;
        color: #000000 !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ----------------------------------------------------------------------------
   17. Index page helpers
   ---------------------------------------------------------------------------- */
.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 860px) {
    .grid-two {
        grid-template-columns: 1fr;
    }
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 8px;
    font-size: .88rem;
    color: #efe6d6;
    flex-wrap: wrap;
}

.activity-title {
    color: #efe6d6;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-title:hover,
.activity-title:focus {
    color: #efe6d6;
    text-decoration: underline;
}

.activity-meta {
    color: #a89f8c;
    font-size: .78rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* ----------------------------------------------------------------------------
   20. Shared page components
   ---------------------------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-head-text {
    min-width: 0;
}

.page-head-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #efe6d6;
    line-height: 1.2;
}

.page-head-sub {
    margin: .25rem 0 0 0;
    font-size: .9rem;
    color: #a89f8c;
}

.page-head-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #efe6d6;
}

.empty-state-body {
    margin: 0;
    font-size: .9rem;
    color: #a89f8c;
    max-width: 48ch;
    line-height: 1.7;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge-muted {
    background: rgba(168, 159, 140, 0.18);
    color: #ddd2bc;
    border: 1px solid rgba(168, 159, 140, 0.30);
}

.badge-danger {
    background: rgba(224, 133, 133, 0.16);
    color: #f0bdbd;
    border: 1px solid rgba(224, 133, 133, 0.36);
}

.table-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) auto auto;
    gap: .6rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.table-filters .field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.table-filters .field label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #a89f8c;
}

.table-filters .field input,
.table-filters .field select {
    height: 40px;
    padding: 0 .75rem;
    background: rgba(28, 23, 17, 0.75);
    border: 1px solid var(--st-color-border);
    border-radius: 8px;
    color: #efe6d6;
    font-size: .88rem;
    outline: none;
}

.table-filters .field input:focus,
.table-filters .field select:focus {
    border-color: var(--st-color-primary);
    box-shadow: 0 0 0 3px var(--st-color-primary-glow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: .65rem .9rem;
    border-radius: 10px;
    background: #28221a;
    border: 1px solid var(--st-color-border);
    color: #efe6d6;
    font-size: .875rem;
    box-shadow: 0 6px 24px rgba(60, 40, 15, 0.4);
    min-width: 220px;
    max-width: 340px;
    animation: st-toast-in .15s ease;
}

.toast.success { border-color: rgba(163, 184, 108, 0.5); }
.toast.error   { border-color: rgba(224, 133, 133, 0.5); }
.toast.info    { border-color: rgba(245, 158, 11, 0.5); }

@keyframes st-toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-sm {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 15000;
    padding: 1rem;
}

.modal-sm.open { display: flex; }

.modal-sm-content {
    background: #28221a;
    color: #efe6d6;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--st-shadow-lg);
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: #28221a;
    border-left: 1px solid var(--st-color-border);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 15000;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer.open { transform: translateX(0); }

/* ----------------------------------------------------------------------------
   21. Wave 1 — Notifications, SRS, Courses
   ---------------------------------------------------------------------------- */

/* ---- Notifications --------------------------------------------------------- */
.notif-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: .5rem .75rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.notif-tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.notif-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .8rem;
    border-radius: 8px;
    color: #ddd2bc;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.notif-tab:hover,
.notif-tab:focus {
    background: rgba(239, 230, 214, 0.06);
    color: #efe6d6;
}

.notif-tab.active {
    background: rgba(245, 158, 11, 0.18);
    color: #efe6d6;
}

.notif-count {
    font-size: .7rem;
    font-weight: 700;
    padding: .05rem .45rem;
    border-radius: 9999px;
    background: rgba(239, 230, 214, 0.12);
    color: #efe6d6;
}

.notif-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.notif-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: .85rem;
    align-items: start;
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    position: relative;
    transition: border-color .15s ease;
}

.notif-item.unread {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.05);
}

.notif-item:hover {
    border-color: rgba(245, 158, 11, 0.45);
}

.notif-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--st-color-primary);
}

.notif-body {
    min-width: 0;
}

.notif-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .2rem;
}

.notif-title {
    color: #efe6d6;
    font-weight: 700;
    font-size: .95rem;
}

.notif-badge {
    display: inline-flex;
    padding: .1rem .5rem;
    border-radius: 9999px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.notif-badge.type-info    { background: rgba(245, 158, 11, 0.18); color: #f8c974; }
.notif-badge.type-warning { background: rgba(240, 185, 106, 0.18); color: #f2c998; }
.notif-badge.type-alert   { background: rgba(224, 133, 133, 0.20); color: #f0bdbd; }

.notif-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st-color-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.notif-actor {
    font-size: .78rem;
    color: #a89f8c;
    margin-bottom: .15rem;
}

.notif-message {
    font-size: .875rem;
    color: #ddd2bc;
    line-height: 1.6;
    margin: .25rem 0;
}

.notif-meta {
    font-size: .75rem;
    color: #a89f8c;
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.notif-actions-col {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: flex-end;
}

.notif-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--st-color-border);
    background: rgba(239, 230, 214, 0.05);
    color: #efe6d6;
    cursor: pointer;
    font-size: .95rem;
}

.notif-btn:hover,
.notif-btn:focus {
    background: rgba(239, 230, 214, 0.12);
}

.notif-btn-danger:hover {
    background: rgba(224, 133, 133, 0.20);
    border-color: rgba(224, 133, 133, 0.45);
}

@media (max-width: 640px) {
    .notif-item {
        grid-template-columns: 36px 1fr;
    }
    .notif-avatar img { width: 36px; height: 36px; }
    .notif-actions-col {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* ---- SRS ------------------------------------------------------------------- */
.srs-progress-wrap {
    margin-bottom: 1.25rem;
}

.srs-progress-track {
    height: 8px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.srs-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    border-radius: 9999px;
    transition: width .3s ease;
}

.srs-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: #a89f8c;
    margin-top: .35rem;
}

.srs-card {
    width: 100%;
    max-width: none;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 2rem;
    margin: 0;
}

.srs-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(239, 230, 214, 0.06);
    flex-wrap: wrap;
    gap: .5rem;
}

.srs-card-meta {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.srs-position {
    font-size: .8rem;
    color: #a89f8c;
    font-weight: 600;
}

.srs-word {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.srs-word-text {
    margin: 0;
    font-size: 2.75rem;
    font-weight: 800;
    color: #efe6d6;
    letter-spacing: -0.02em;
    line-height: 1.15;
    word-break: break-word;
}

.srs-word-ipa {
    font-family: var(--st-font-mono);
    font-size: 1rem;
    color: #a89f8c;
    margin-top: .35rem;
}

.srs-reveal {
    display: block;
    margin: 0 auto;
    padding: .75rem 1.5rem;
    background: var(--st-color-primary);
    color: #1a1611;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease;
}

.srs-reveal:hover,
.srs-reveal:focus {
    background: var(--st-color-primary-hover);
}

.srs-answer {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.srs-answer-section .srs-answer-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #a89f8c;
    margin-bottom: .25rem;
}

.srs-answer-section .srs-answer-text {
    color: #efe6d6;
    font-size: .95rem;
    line-height: 1.7;
}

.srs-grade {
    margin-top: 1.5rem;
}

.srs-grade-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}

@media (max-width: 520px) {
    .srs-grade-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

.srs-grade-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .75rem .5rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 230, 214, 0.12);
    background: rgba(239, 230, 214, 0.05);
    color: #efe6d6;
    cursor: pointer;
    font-size: .85rem;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.srs-grade-btn strong {
    font-size: .95rem;
    font-weight: 800;
}

.srs-grade-btn span {
    font-size: .7rem;
    color: #a89f8c;
}

.srs-grade-btn:hover,
.srs-grade-btn:focus {
    transform: translateY(-1px);
}

.srs-grade-btn.again { border-color: rgba(224, 133, 133, 0.35); }
.srs-grade-btn.again:hover { background: rgba(224, 133, 133, 0.20); }

.srs-grade-btn.hard { border-color: rgba(240, 185, 106, 0.35); }
.srs-grade-btn.hard:hover { background: rgba(240, 185, 106, 0.20); }

.srs-grade-btn.good { border-color: rgba(245, 158, 11, 0.35); }
.srs-grade-btn.good:hover { background: rgba(245, 158, 11, 0.20); }

.srs-grade-btn.easy { border-color: rgba(163, 184, 108, 0.35); }
.srs-grade-btn.easy:hover { background: rgba(163, 184, 108, 0.20); }

.srs-keyboard-hint {
    margin-top: 1rem;
    text-align: center;
    font-size: .78rem;
    color: #a89f8c;
}

.srs-keyboard-hint kbd {
    display: inline-block;
    padding: .05rem .4rem;
    margin: 0 .1rem;
    border: 1px solid rgba(239, 230, 214, 0.15);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: var(--st-font-mono);
    font-size: .75rem;
    background: rgba(239, 230, 214, 0.06);
    color: #efe6d6;
}

.srs-upcoming {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .5rem;
}

.srs-upcoming-item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .6rem .75rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 8px;
}

.srs-upcoming-word {
    color: #efe6d6;
    font-weight: 700;
    font-size: .9rem;
}

/* ---- Courses --------------------------------------------------------------- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}

.course-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.35);
}

.course-cover {
    position: relative;
    height: 150px;
    background: rgba(28, 23, 17, 0.85);
    overflow: hidden;
}

.course-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%,
                rgba(251, 146, 60, 0.10) 100%);
}

.course-badges {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}

.course-body {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.25rem 1.25rem;
    flex: 1;
    gap: .5rem;
}

.course-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.course-title a,
.course-title a:visited {
    color: #efe6d6;
    text-decoration: none;
}

.course-title a:hover,
.course-title a:focus {
    text-decoration: underline;
}

.course-desc {
    margin: 0;
    font-size: .85rem;
    color: #a89f8c;
    line-height: 1.6;
    flex: 1;
}

.course-meta {
    display: flex;
    gap: .9rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

.course-progress {
    margin-top: .35rem;
}

.course-progress-track {
    height: 6px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.course-progress-track > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    border-radius: 9999px;
}

.course-progress-label {
    font-size: .72rem;
    color: #a89f8c;
    margin-top: .25rem;
}

.course-actions {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
}

/* ----------------------------------------------------------------------------
   22. Wave 2A — Store & Play
   ---------------------------------------------------------------------------- */

/* ---- Store tabs ------------------------------------------------------------ */
.store-tabs {
    display: flex;
    gap: .35rem;
    margin-bottom: 1.25rem;
    padding: .35rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: 9999px;
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
}

.store-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: 9999px;
    color: #ddd2bc;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease;
}

.store-tab:hover,
.store-tab:focus {
    background: rgba(239, 230, 214, 0.06);
    color: #efe6d6;
}

.store-tab.active {
    background: var(--st-color-primary);
    color: #1a1611;
}

/* ---- Store grid ------------------------------------------------------------ */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.store-card {
    display: flex;
    flex-direction: column;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}

.store-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.35);
}

.store-cover {
    position: relative;
    height: 140px;
    background: rgba(28, 23, 17, 0.85);
    overflow: hidden;
}

.store-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.15) 0%,
        rgba(251, 146, 60, 0.10) 100%);
}

.store-badges {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}

.store-body {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .9rem 1rem 1rem;
    flex: 1;
}

.store-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.store-title a,
.store-title a:visited {
    color: #efe6d6;
    text-decoration: none;
}

.store-title a:hover,
.store-title a:focus {
    text-decoration: underline;
}

.store-brand {
    font-size: .75rem;
    color: #a89f8c;
    letter-spacing: .02em;
}

.store-desc {
    margin: 0;
    font-size: .82rem;
    color: #a89f8c;
    line-height: 1.55;
    flex: 1;
}

.store-price {
    font-family: var(--st-font-mono);
    font-size: 1rem;
    font-weight: 800;
    color: #efe6d6;
    margin-top: .2rem;
}

.store-meta {
    display: flex;
    gap: .75rem;
    font-size: .75rem;
    color: #a89f8c;
    flex-wrap: wrap;
    margin-top: .2rem;
}

.store-actions {
    display: flex;
    gap: .4rem;
    margin-top: .6rem;
}

/* ---- Play page ------------------------------------------------------------- */
.play-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
}

.play-header {
    margin-bottom: 1.25rem;
    text-align: center;
}

.play-title {
    margin: .5rem 0 .35rem 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.play-meta-row {
    display: flex;
    gap: .75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: .85rem;
    color: #a89f8c;
}

.play-description {
    margin: 1rem auto 0 auto;
    max-width: 60ch;
    font-size: .92rem;
    color: #ddd2bc;
    line-height: 1.7;
}

.play-frame-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 400px;
    max-height: 80vh;
    background: #000;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
}

.play-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #171310;
}

.play-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.play-rating-label {
    font-size: .9rem;
    color: #ddd2bc;
    font-weight: 600;
}

.play-stars {
    display: flex;
    gap: .25rem;
}

.play-star {
    background: transparent;
    border: none;
    color: rgba(239, 230, 214, 0.25);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .1rem;
    transition: color .15s ease, transform .1s ease;
}

.play-star:hover,
.play-star:focus {
    color: #f2c998;
    transform: scale(1.1);
}

.play-star.active {
    color: #fbd38d;
}

.play-related {
    margin-top: 2rem;
}

.play-related-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #efe6d6;
    margin: 0 0 1rem 0;
}

/* ----------------------------------------------------------------------------
   23. Wave 2B — Product, Cart, Checkout
   ---------------------------------------------------------------------------- */

/* ---- Product --------------------------------------------------------------- */
.product-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 800px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.product-main-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    overflow: hidden;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: .35rem;
}

.product-thumb {
    background: transparent;
    border: 1px solid var(--st-color-border);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.product-thumb:hover,
.product-thumb:focus {
    border-color: var(--st-color-primary);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-buy {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.product-category {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #a89f8c;
    font-weight: 700;
}

.product-name {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: #efe6d6;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.product-brand {
    font-size: .85rem;
    color: #a89f8c;
}

.product-rating {
    font-size: .9rem;
    color: #f2c998;
    margin-top: .2rem;
}

.product-short {
    font-size: .9rem;
    color: #ddd2bc;
    line-height: 1.65;
    margin: .5rem 0;
}

.product-price-box {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin: .75rem 0;
}

.product-price {
    font-family: var(--st-font-mono);
    font-size: 1.85rem;
    font-weight: 800;
    color: #efe6d6;
}

.product-compare {
    font-size: 1rem;
    color: #a89f8c;
    text-decoration: line-through;
}

.product-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: .5rem;
}

.product-label {
    font-size: .82rem;
    font-weight: 600;
    color: #ddd2bc;
}

.product-qty-row {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.product-stock {
    font-size: .85rem;
}

.product-desc {
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
}

.product-desc summary {
    cursor: pointer;
    font-weight: 700;
    color: #efe6d6;
}

.product-desc-body {
    margin-top: .5rem;
    color: #efe6d6;
    font-size: .9rem;
    line-height: 1.7;
}

/* Reviews */
.product-reviews {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.product-review-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.product-review {
    padding: 1rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
}

.product-review-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .35rem;
}

.product-review-head strong {
    color: #efe6d6;
}

.product-review-stars {
    color: #fbd38d;
    letter-spacing: .1em;
}

.product-review-title {
    color: #efe6d6;
    font-weight: 700;
    margin-bottom: .2rem;
}

.product-review-body {
    color: #efe6d6;
    font-size: .9rem;
    line-height: 1.65;
}

.product-review-form {
    padding: 1.25rem 1.25rem 1rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
}

.product-review-rating {
    margin-bottom: 1rem;
}

.product-review-stars-input {
    display: flex;
    gap: .25rem;
    margin-top: .35rem;
}

.product-review-stars-input label {
    cursor: pointer;
    color: #a89f8c;
    font-size: 1.5rem;
    line-height: 1;
}

.product-review-stars-input input {
    display: none;
}

.product-review-stars-input input:checked ~ span {
    color: #fbd38d;
}

.product-review-stars-input label:hover span,
.product-review-stars-input label:hover ~ label span {
    color: #fbd38d;
}

/* ---- Cart ------------------------------------------------------------------ */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

@media (max-width: 640px) {
    .cart-item {
        grid-template-columns: 72px 1fr;
    }
    .cart-item-qty,
    .cart-item-total,
    .cart-item-remove {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

.cart-item-image img,
.cart-item-image .store-cover-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    font-size: 1.6rem;
}

.cart-item-title {
    margin: 0 0 .2rem 0;
    font-size: .95rem;
    font-weight: 700;
}

.cart-item-title a,
.cart-item-title a:visited {
    color: #efe6d6;
    text-decoration: none;
}

.cart-item-title a:hover {
    text-decoration: underline;
}

.cart-item-variant {
    font-size: .8rem;
    color: #a89f8c;
}

.cart-item-price {
    font-family: var(--st-font-mono);
    font-size: .85rem;
    color: #ddd2bc;
    margin-top: .25rem;
}

.cart-item-qty form {
    display: flex;
    gap: .35rem;
    align-items: center;
}

.cart-qty-update {
    padding: .35rem .65rem;
    background: rgba(239, 230, 214, 0.08);
    border: 1px solid var(--st-color-border);
    border-radius: 6px;
    color: #efe6d6;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
}

.cart-qty-update:hover {
    background: rgba(239, 230, 214, 0.15);
}

.cart-item-total {
    font-family: var(--st-font-mono);
    font-weight: 800;
    color: #efe6d6;
    white-space: nowrap;
}

.cart-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--st-color-border);
    background: rgba(239, 230, 214, 0.05);
    color: #f0bdbd;
    cursor: pointer;
    font-size: 1rem;
}

.cart-remove-btn:hover {
    background: rgba(224, 133, 133, 0.18);
    border-color: rgba(224, 133, 133, 0.42);
}

.cart-clear-row {
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}

.cart-summary {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}

@media (max-width: 800px) {
    .cart-summary {
        position: static;
    }
}

.cart-summary-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #efe6d6;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    font-size: .9rem;
    color: #a89f8c;
}

.cart-summary-row strong {
    color: #efe6d6;
    font-family: var(--st-font-mono);
}

.cart-summary-total {
    border-top: 1px solid rgba(239, 230, 214, 0.08);
    margin-top: .5rem;
    padding-top: .75rem;
    font-size: 1rem;
}

.cart-summary-total span {
    color: #efe6d6;
    font-weight: 700;
}

.cart-summary-total strong {
    font-size: 1.25rem;
}

.cart-summary-note {
    margin-top: 1rem;
    font-size: .75rem;
    color: #a89f8c;
    line-height: 1.6;
}

/* ---- Checkout -------------------------------------------------------------- */
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkout-summary {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius);
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}

@media (max-width: 800px) {
    .checkout-summary {
        position: static;
    }
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-bottom: .75rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid rgba(239, 230, 214, 0.06);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    font-size: .85rem;
    color: #efe6d6;
}

.checkout-item strong {
    color: #efe6d6;
    font-family: var(--st-font-mono);
    white-space: nowrap;
}

.checkout-payment-options {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.checkout-payment-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem .9rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
    cursor: pointer;
}

.checkout-payment-option:hover {
    border-color: rgba(245, 158, 11, 0.35);
}

.checkout-payment-option input {
    accent-color: var(--st-color-primary);
}

.checkout-payment-label {
    display: flex;
    flex-direction: column;
    color: #efe6d6;
}

.checkout-payment-label strong {
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   24. Wave 2C — Orders
   ---------------------------------------------------------------------------- */
.order-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.order-card {
    padding: 1rem 1.25rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-number {
    font-family: var(--st-font-mono);
    font-size: 1rem;
    font-weight: 800;
    color: #efe6d6;
    text-decoration: none;
}

.order-number:hover,
.order-number:focus {
    text-decoration: underline;
}

.order-meta {
    font-size: .82rem;
    color: #a89f8c;
    margin-top: .15rem;
}

.order-card-badges {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.order-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Order detail */
.order-status-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.order-status-box {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: .85rem 1rem;
}

.order-status-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #a89f8c;
    margin-bottom: .3rem;
}

.order-status-total {
    font-family: var(--st-font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: #efe6d6;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .75rem .9rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 8px;
    font-size: .9rem;
}

.order-item-info {
    min-width: 0;
}

.order-item-name {
    color: #efe6d6;
    font-weight: 700;
    text-decoration: none;
}

.order-item-name:hover {
    text-decoration: underline;
}

.order-item-variant {
    font-size: .78rem;
    color: #a89f8c;
    margin-top: .1rem;
}

.order-item-sku {
    font-size: .72rem;
    margin-top: .1rem;
}

.order-item-qty {
    color: #ddd2bc;
    font-size: .85rem;
    white-space: nowrap;
}

.order-item-total {
    font-family: var(--st-font-mono);
    font-weight: 800;
    color: #efe6d6;
    white-space: nowrap;
}

.order-totals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(239, 230, 214, 0.06);
}

/* Shipment */
.order-shipment {
    padding: 1rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
    margin-bottom: .75rem;
}

.order-shipment-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.order-tracking-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .75rem;
    padding-left: .25rem;
    border-left: 2px dashed rgba(239, 230, 214, 0.12);
}

.order-tracking-row {
    display: flex;
    gap: .6rem;
    padding-left: .5rem;
    font-size: .85rem;
    color: #efe6d6;
}

.order-tracking-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--st-color-primary);
    flex-shrink: 0;
    margin-top: .35rem;
}

/* Timeline */
.order-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.order-timeline-item {
    display: flex;
    gap: .6rem;
    font-size: .88rem;
}

.order-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--st-color-primary);
    flex-shrink: 0;
    margin-top: .35rem;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.order-timeline-title {
    color: #efe6d6;
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   25. Wave 3 — Publisher
   ---------------------------------------------------------------------------- */

/* Status strip */
.pub-status-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.pub-status-item {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.pub-status-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #a89f8c;
}

.pub-status-value {
    font-family: var(--st-font-mono);
    font-size: 1rem;
    font-weight: 800;
    color: #efe6d6;
}

/* Counters */
.pub-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.pub-counter {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1rem 1.15rem;
}

.pub-counter-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #a89f8c;
}

.pub-counter-value {
    font-family: var(--st-font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: #efe6d6;
    margin: .25rem 0 .1rem 0;
    line-height: 1.15;
}

.pub-counter-value small {
    font-size: .85rem;
    color: #a89f8c;
    font-weight: 600;
}

.pub-counter-sub {
    font-size: .75rem;
    color: #a89f8c;
}

/* Progress */
.pub-progress {
    height: 8px;
    background: rgba(239, 230, 214, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.pub-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    border-radius: 9999px;
    transition: width .3s ease;
}

/* Two-column */
.pub-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

@media (max-width: 800px) {
    .pub-two-col {
        grid-template-columns: 1fr;
    }
}

/* Property and channel management */
.pub-property-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pub-property {
    padding: 1rem 1.15rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
}

.pub-property-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.pub-property-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: 1rem;
}

.pub-channel-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px dashed rgba(239, 230, 214, 0.08);
}

.pub-channel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px solid rgba(239, 230, 214, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
    font-size: .9rem;
}

.pub-add-channel {
    margin-top: .75rem;
    padding: .6rem .75rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: 8px;
}

.pub-add-channel summary {
    cursor: pointer;
    font-weight: 600;
    color: #efe6d6;
    font-size: .85rem;
}

.text-mono {
    font-family: var(--st-font-mono);
    font-size: .85rem;
}

/* ----------------------------------------------------------------------------
   26. Wave 3 (continued) — Publisher content, revenue, payouts
   ---------------------------------------------------------------------------- */

/* Content list */
.pub-content-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.pub-content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

@media (max-width: 640px) {
    .pub-content-row {
        grid-template-columns: 1fr;
    }
    .pub-content-badges,
    .pub-content-actions {
        justify-self: start;
    }
}

.pub-content-main {
    min-width: 0;
}

.pub-content-title {
    color: #efe6d6;
    font-weight: 700;
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pub-content-meta {
    display: flex;
    gap: .35rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
    margin-top: .15rem;
}

.pub-content-badges {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.pub-content-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

/* Revenue periods */
.pub-revenue-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.pub-revenue-period {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.pub-revenue-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.pub-revenue-period-range {
    font-family: var(--st-font-mono);
    font-weight: 800;
    color: #efe6d6;
}

.pub-revenue-period-meta {
    font-size: .78rem;
    margin-top: .15rem;
}

.pub-revenue-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .5rem;
}

.pub-revenue-figure {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .65rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.05);
    border-radius: 8px;
    font-size: .8rem;
}

.pub-revenue-figure span {
    color: #a89f8c;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.pub-revenue-figure strong {
    color: #efe6d6;
    font-family: var(--st-font-mono);
}

.pub-revenue-figure-total {
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.08);
}

.pub-revenue-figure-total strong {
    color: #f8c974;
}

.pub-revenue-adjustments {
    margin-top: .75rem;
    padding: .6rem .75rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: 8px;
}

.pub-revenue-adjustments summary {
    cursor: pointer;
    font-weight: 600;
    color: #efe6d6;
    font-size: .85rem;
}

/* Payouts */
.pub-payout-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.pub-payout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 8px;
    flex-wrap: wrap;
}

.pub-payout-amount {
    font-family: var(--st-font-mono);
    font-weight: 800;
    color: #efe6d6;
    font-size: 1rem;
}

.pub-payout-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------------------------
   27. Wave 4 — Advertiser
   ---------------------------------------------------------------------------- */

/* Daily bar chart */
.adv-daily-chart {
    display: flex;
    align-items: flex-end;
    gap: .4rem;
    height: 160px;
    padding: 1rem 0 .25rem 0;
}

.adv-daily-bar {
    flex: 1;
    min-width: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
}

.adv-daily-bar > span {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #f59e0b 0%, #fb923c 100%);
    border-radius: 4px 4px 0 0;
    transition: height .25s ease;
}

.adv-daily-bar:hover > span {
    background: linear-gradient(180deg, #fcd994 0%, #f59e0b 100%);
}

.adv-daily-label {
    font-size: .68rem;
    color: #a89f8c;
    font-weight: 600;
}

/* Campaign list */
.adv-campaign-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.adv-campaign {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.adv-campaign-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.adv-campaign-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: 1rem;
}

.adv-campaign-actions {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
}

.adv-campaign-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .5rem;
}

.adv-campaign-figure {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .65rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.05);
    border-radius: 8px;
    font-size: .82rem;
}

.adv-campaign-figure span {
    color: #a89f8c;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.adv-campaign-figure strong {
    color: #efe6d6;
    font-family: var(--st-font-mono);
}

.adv-campaign-budget {
    margin-top: .5rem;
    padding: .6rem .75rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: 8px;
}

.adv-campaign-budget summary {
    cursor: pointer;
    font-weight: 600;
    color: #efe6d6;
    font-size: .85rem;
}

/* Creative library */
.adv-creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.adv-creative-card {
    display: flex;
    flex-direction: column;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}

.adv-creative-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.35);
}

.adv-creative-preview {
    position: relative;
    height: 140px;
    background: rgba(28, 23, 17, 0.85);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adv-creative-preview img,
.adv-creative-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adv-creative-placeholder {
    font-size: 2.5rem;
    color: #a89f8c;
}

.adv-creative-badges {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}

.adv-creative-body {
    padding: .85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex: 1;
}

.adv-creative-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.35;
}

.adv-creative-meta {
    display: flex;
    gap: .5rem;
    font-size: .75rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

.adv-creative-actions {
    display: flex;
    gap: .4rem;
    margin-top: auto;
    padding-top: .6rem;
    flex-wrap: wrap;
}

/* Reports */
.adv-report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) auto auto;
    gap: .6rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.adv-report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.adv-report-row {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem .9rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: 8px;
}

.adv-report-row span {
    color: #a89f8c;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.adv-report-row strong {
    color: #efe6d6;
    font-family: var(--st-font-mono);
    font-size: 1.15rem;
}

/* ----------------------------------------------------------------------------
   28. Wave 5 — Developer
   ---------------------------------------------------------------------------- */
.dev-secret {
    display: block;
    padding: .6rem .8rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(239, 230, 214, 0.10);
    border-radius: 8px;
    color: #efe6d6;
    font-family: var(--st-font-mono);
    font-size: .85rem;
    word-break: break-all;
    margin-top: .35rem;
}

.dev-scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .5rem;
}

.dev-scope-grid .st-checkbox-wrapper {
    margin-bottom: 0;
}

.dev-scope-grid code {
    font-family: var(--st-font-mono);
    font-size: .78rem;
    color: #f8c974;
}

.dev-client-list,
.dev-key-list,
.dev-webhook-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.dev-client,
.dev-key,
.dev-webhook {
    padding: 1rem 1.15rem;
    background: rgba(239, 230, 214, 0.03);
    border: 1px solid rgba(239, 230, 214, 0.06);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.dev-client-head,
.dev-key-head,
.dev-webhook-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.dev-client-name,
.dev-key-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: .98rem;
}

.dev-client-id,
.dev-key-prefix,
.dev-webhook-url {
    font-family: var(--st-font-mono);
    font-size: .82rem;
    color: #ddd2bc;
    margin-top: .15rem;
    word-break: break-all;
}

.dev-client-badges,
.dev-key-badges,
.dev-webhook-badges {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.dev-client-redirects {
    padding: .65rem .85rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: 8px;
}

.dev-client-redirects ul {
    list-style: none;
    padding: 0;
    margin: .35rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.dev-client-redirects code {
    font-family: var(--st-font-mono);
    font-size: .8rem;
    color: #efe6d6;
}

.dev-client-edit,
.dev-webhook-deliveries {
    padding: .6rem .75rem;
    background: rgba(239, 230, 214, 0.02);
    border: 1px dashed rgba(239, 230, 214, 0.10);
    border-radius: 8px;
}

.dev-client-edit summary,
.dev-webhook-deliveries summary {
    cursor: pointer;
    font-weight: 600;
    color: #efe6d6;
    font-size: .85rem;
}

.dev-client-actions,
.dev-key-actions,
.dev-webhook-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.dev-key-meta {
    display: flex;
    gap: .5rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

.dev-key-scopes {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.dev-key-scope {
    display: inline-flex;
    padding: .15rem .55rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    color: #f8c974;
    border: 1px solid rgba(245, 158, 11, 0.30);
    font-family: var(--st-font-mono);
    font-size: .72rem;
    font-weight: 600;
}

/* ----------------------------------------------------------------------------
   29. Wave 6 — Organizations
   ------------------------------------------------------------------------- */
.org-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.org-card {
    padding: 1.15rem 1.25rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    transition: border-color .2s ease, transform .15s ease;
}

.org-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.org-card-current {
    border-color: rgba(163, 184, 108, 0.42);
}

.org-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.org-card-name {
    color: #efe6d6;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}

.org-card-meta {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

.org-card-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.org-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .org-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Members */
.org-member-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.org-member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

@media (max-width: 720px) {
    .org-member {
        grid-template-columns: 1fr;
    }
    .org-member-roles,
    .org-member-actions {
        justify-self: start;
    }
}

.org-member-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.org-member-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.org-member-roles {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.org-role-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .55rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    color: #f8c974;
    border: 1px solid rgba(245, 158, 11, 0.30);
    font-size: .72rem;
    font-weight: 700;
}

.org-role-revoke {
    background: transparent;
    border: none;
    color: #f0bdbd;
    font-size: .9rem;
    cursor: pointer;
    padding: 0 .15rem;
    line-height: 1;
}

.org-role-revoke:hover {
    color: #efe6d6;
}

.org-member-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Roles */
.org-role-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.org-role {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.org-role-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.org-role-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.org-perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .5rem;
}

.org-perm-grid .st-checkbox-wrapper {
    margin-bottom: 0;
}

.org-perm-grid code {
    font-family: var(--st-font-mono);
    font-size: .78rem;
    color: #f8c974;
}

.org-perm-list {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

/* ----------------------------------------------------------------------------
   .org-perm-pill — completed (was truncated in the original file)
   ------------------------------------------------------------------------- */
.org-perm-pill {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 9999px;
    background: rgba(239, 230, 214, 0.06);
    color: #ddd2bc;
    border: 1px solid rgba(239, 230, 214, 0.10);
    font-family: var(--st-font-mono);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.org-perm-pill-wildcard {
    background: rgba(163, 184, 108, 0.14);
    color: #cfdba5;
    border-color: rgba(163, 184, 108, 0.32);
}

/* ----------------------------------------------------------------------------
   Role create panel — replaces .content-card on org/roles.php
   ------------------------------------------------------------------------- */
.org-role-create {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    margin-bottom: 1rem;
}

.org-role-create > summary {
    cursor: pointer;
    color: #efe6d6;
    font-weight: 700;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.org-role-create > summary::-webkit-details-marker {
    display: none;
}

.org-role-create > summary::before {
    content: "＋";
    display: inline-block;
    color: #f8c974;
    transition: transform .15s ease;
}

.org-role-create[open] > summary::before {
    content: "－";
}

.org-role-create form {
    margin-top: 1rem;
}

/* ----------------------------------------------------------------------------
   Role inline edit panel
   ------------------------------------------------------------------------- */
.org-role-edit {
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px dashed var(--st-color-border);
}

.org-role-edit > summary {
    cursor: pointer;
    color: #f8c974;
    font-weight: 700;
    font-size: .85rem;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.org-role-edit > summary::-webkit-details-marker {
    display: none;
}

.org-role-edit > summary::before {
    content: "✎";
    color: #f8c974;
}

.org-role-edit form {
    margin-top: .75rem;
}

.org-role-edit .org-perm-grid {
    margin-top: .5rem;
}

/* ----------------------------------------------------------------------------
   Action rows inside role cards / create panel
   ------------------------------------------------------------------------- */
.org-role-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.org-role-actions-danger {
    margin-top: .5rem;
}

/* ----------------------------------------------------------------------------
   Muted meta line, consistent with .org-card-meta
   ------------------------------------------------------------------------- */
.org-role-meta {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------------- */
.org-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: #a89f8c;
    font-size: .9rem;
    background: var(--st-color-card);
    border: 1px dashed var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.org-empty strong {
    display: block;
    color: #efe6d6;
    font-size: 1rem;
    margin-bottom: .35rem;
}

/* ----------------------------------------------------------------------------
   Responsive polish for role cards / create panel
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .org-role-head {
        flex-direction: column;
        align-items: stretch;
    }

    .org-role-actions {
        justify-content: stretch;
    }

    .org-role-actions > * {
        flex: 1 1 auto;
    }
}

/* ----------------------------------------------------------------------------
   34. Wave 7 — Live streaming: shared
   ------------------------------------------------------------------------- */
.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.live-card {
    padding: 1.15rem 1.25rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    transition: border-color .2s ease, transform .15s ease;
}

.live-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.live-card-live {
    border-color: rgba(224, 133, 133, 0.42);
}

.live-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.live-card-title {
    color: #efe6d6;
    font-weight: 800;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.live-card-meta {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: #a89f8c;
    flex-wrap: wrap;
}

.live-card-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Live/pill badges */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .6rem;
    border-radius: 9999px;
    font-size: .72rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.live-badge-live {
    background: rgba(224, 133, 133, 0.14);
    color: #f0bdbd;
    border-color: rgba(224, 133, 133, 0.34);
}

.live-badge-live::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 9999px;
    background: #e08585;
    box-shadow: 0 0 0 0 rgba(224, 133, 133, 0.55);
    animation: live-pulse 1.6s infinite;
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(224, 133, 133, 0.55); }
    70%  { box-shadow: 0 0 0 .5rem rgba(224, 133, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 133, 133, 0); }
}

.live-badge-scheduled {
    background: rgba(245, 158, 11, 0.14);
    color: #f8c974;
    border-color: rgba(245, 158, 11, 0.30);
}

.live-badge-ended {
    background: rgba(168, 159, 140, 0.12);
    color: #ddd2bc;
    border-color: rgba(168, 159, 140, 0.28);
}

.live-badge-recording {
    background: rgba(163, 184, 108, 0.14);
    color: #cfdba5;
    border-color: rgba(163, 184, 108, 0.32);
}

/* ----------------------------------------------------------------------------
   35. Wave 7 — Live streaming: control room
   ------------------------------------------------------------------------- */
.live-room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 980px) {
    .live-room {
        grid-template-columns: 1fr;
    }
}

.live-stage {
    position: relative;
    background: #000000;
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.live-stage video,
.live-stage iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #000000;
}

.live-stage-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: .85rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    color: #efe6d6;
}

.live-stage-title {
    font-weight: 800;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.live-stage-stats {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: #ddd2bc;
    flex-wrap: wrap;
}

.live-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat panel */
.live-chat {
    display: flex;
    flex-direction: column;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    height: 480px;
    overflow: hidden;
}

.live-chat-head {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--st-color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    color: #efe6d6;
    font-weight: 700;
    font-size: .9rem;
}

.live-chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.live-chat-msg {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    font-size: .85rem;
    line-height: 1.5;
    word-break: break-word;
}

.live-chat-msg-author {
    color: #f8c974;
    font-weight: 700;
    flex-shrink: 0;
}

.live-chat-msg-body {
    color: #efe6d6;
    min-width: 0;
}

.live-chat-msg-system {
    color: #a89f8c;
    font-style: italic;
    font-size: .78rem;
}

.live-chat-msg-mod {
    border-left: 2px solid rgba(163, 184, 108, 0.55);
    padding-left: .55rem;
}

.live-chat-foot {
    padding: .65rem .75rem;
    border-top: 1px solid var(--st-color-border);
    display: flex;
    gap: .5rem;
    align-items: center;
}

.live-chat-foot > input {
    flex: 1 1 auto;
    min-width: 0;
}

/* ----------------------------------------------------------------------------
   36. Wave 7 — Live streaming: viewer / embed
   ------------------------------------------------------------------------- */
.live-embed {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.live-embed-code {
    display: block;
    padding: .75rem .9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    font-family: var(--st-font-mono);
    font-size: .78rem;
    color: #f8c974;
    overflow-x: auto;
    white-space: pre;
}

/* Reactions strip */
.live-reactions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}

.live-reaction {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ddd2bc;
    font-size: .8rem;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease;
}

.live-reaction:hover {
    transform: translateY(-1px);
    background: rgba(245, 158, 11, 0.18);
    color: #efe6d6;
}

.live-reaction-count {
    font-size: .72rem;
    color: #a89f8c;
    font-family: var(--st-font-mono);
}

/* Viewer stat tiles */
.live-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}

.live-stat {
    padding: .85rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.live-stat-label {
    font-size: .72rem;
    color: #a89f8c;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}

.live-stat-value {
    color: #efe6d6;
    font-weight: 800;
    font-size: 1.25rem;
    font-family: var(--st-font-mono);
    line-height: 1.1;
}

.live-stat-delta-up   { color: #cfdba5; font-size: .72rem; }
.live-stat-delta-down { color: #f0bdbd; font-size: .72rem; }

/* ----------------------------------------------------------------------------
   37. Wave 9 — Admin hub: shell
   ------------------------------------------------------------------------- */
.adm-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 980px) {
    .adm-shell {
        grid-template-columns: 1fr;
    }
}

.adm-nav {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.adm-nav-group-label {
    padding: .55rem .65rem .25rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8a8272;
}

.adm-nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .65rem;
    border-radius: 6px;
    color: #ddd2bc;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.adm-nav-link:hover {
    background: rgba(245, 158, 11, 0.10);
    color: #efe6d6;
}

.adm-nav-link-active {
    background: rgba(245, 158, 11, 0.16);
    color: #efe6d6;
    box-shadow: inset 2px 0 0 #f59e0b;
}

.adm-nav-count {
    margin-left: auto;
    font-size: .72rem;
    color: #a89f8c;
    font-family: var(--st-font-mono);
}

/* Top bar with global actions */
.adm-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: .75rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.adm-topbar-title {
    color: #efe6d6;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.adm-topbar-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ----------------------------------------------------------------------------
   38. Wave 9 — Admin hub: KPI tiles
   ------------------------------------------------------------------------- */
.adm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.adm-kpi {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: border-color .2s ease, transform .15s ease;
}

.adm-kpi:hover {
    border-color: rgba(245, 158, 11, 0.30);
    transform: translateY(-2px);
}

.adm-kpi-label {
    font-size: .72rem;
    color: #a89f8c;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
}

.adm-kpi-value {
    color: #efe6d6;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1.1;
    font-family: var(--st-font-mono);
}

.adm-kpi-delta {
    font-size: .75rem;
    font-weight: 700;
}

.adm-kpi-delta-up   { color: #cfdba5; }
.adm-kpi-delta-down { color: #f0bdbd; }
.adm-kpi-delta-flat { color: #a89f8c; }

.adm-kpi-spark {
    height: 28px;
    margin-top: .25rem;
    opacity: .85;
}

/* ----------------------------------------------------------------------------
   39. Wave 9 — Admin hub: data tables
   ------------------------------------------------------------------------- */
.adm-table-wrap {
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    overflow: hidden;
}

.adm-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--st-color-border);
}

.adm-table-filters {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

.adm-table-filters > * {
    flex: 0 1 auto;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.adm-table thead th {
    text-align: left;
    padding: .65rem 1rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #a89f8c;
    background: rgba(239, 230, 214, 0.02);
    border-bottom: 1px solid var(--st-color-border);
    white-space: nowrap;
}

.adm-table tbody td {
    padding: .75rem 1rem;
    color: #efe6d6;
    border-bottom: 1px solid var(--st-color-border);
    vertical-align: middle;
}

.adm-table tbody tr:last-child td {
    border-bottom: none;
}

.adm-table tbody tr:hover td {
    background: rgba(245, 158, 11, 0.05);
}

.adm-table td.adm-table-cell-muted {
    color: #a89f8c;
    font-size: .78rem;
}

.adm-table td.adm-table-cell-mono {
    font-family: var(--st-font-mono);
    font-size: .78rem;
    color: #f8c974;
}

.adm-table td.adm-table-cell-actions {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .adm-table thead { display: none; }
    .adm-table,
    .adm-table tbody,
    .adm-table tr,
    .adm-table td {
        display: block;
        width: 100%;
    }
    .adm-table tr {
        padding: .5rem 0;
        border-bottom: 1px solid var(--st-color-border);
    }
    .adm-table td {
        border-bottom: none;
        padding: .35rem 1rem;
    }
    .adm-table td::before {
        content: attr(data-label) ": ";
        color: #a89f8c;
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-right: .4rem;
    }
}

/* Pagination */
.adm-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border-top: 1px solid var(--st-color-border);
    font-size: .8rem;
    color: #a89f8c;
}

.adm-pager-pages {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

.adm-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .55rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--st-color-border);
    color: #ddd2bc;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.adm-pager-btn:hover {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.35);
    color: #efe6d6;
}

.adm-pager-btn-active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #efe6d6;
}

.adm-pager-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ----------------------------------------------------------------------------
   40. Wave 9 — Admin hub: status pills
   ------------------------------------------------------------------------- */
.adm-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .6rem;
    border-radius: 9999px;
    font-size: .72rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.adm-status-active    { background: rgba(163, 184, 108, 0.14); color: #cfdba5; border-color: rgba(163, 184, 108, 0.32); }
.adm-status-pending   { background: rgba(250, 204, 21, 0.12); color: #fbd38d; border-color: rgba(250, 204, 21, 0.30); }
.adm-status-suspended { background: rgba(224, 133, 133, 0.12); color: #f0bdbd; border-color: rgba(224, 133, 133, 0.30); }
.adm-status-archived  { background: rgba(168, 159, 140, 0.12); color: #ddd2bc; border-color: rgba(168, 159, 140, 0.28); }
.adm-status-flagged   { background: rgba(224, 133, 133, 0.18); color: #f5cccc; border-color: rgba(224, 133, 133, 0.42); }

/* ----------------------------------------------------------------------------
   41. Wave 9 — Admin hub: feature flags
   ------------------------------------------------------------------------- */
.adm-flag-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.adm-flag {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.adm-flag-key {
    font-family: var(--st-font-mono);
    font-size: .8rem;
    color: #f8c974;
}

.adm-flag-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: .92rem;
    margin-bottom: .15rem;
}

.adm-flag-desc {
    color: #a89f8c;
    font-size: .78rem;
    line-height: 1.5;
}

.adm-flag-scope {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.adm-flag-scope-pill {
    display: inline-flex;
    padding: .12rem .5rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ddd2bc;
    font-size: .7rem;
    font-weight: 600;
}

@media (max-width: 720px) {
    .adm-flag {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------------------------
   42. Wave 9 — Admin hub: system health
   ------------------------------------------------------------------------- */
.adm-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.adm-health-card {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.adm-health-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
}

.adm-health-name {
    color: #efe6d6;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.adm-health-value {
    font-family: var(--st-font-mono);
    color: #f8c974;
    font-size: .85rem;
}

.adm-health-bar {
    height: 6px;
    border-radius: 9999px;
    background: rgba(239, 230, 214, 0.06);
    overflow: hidden;
}

.adm-health-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #a3b86c);
}

.adm-health-bar-warn > span {
    background: linear-gradient(90deg, #fbd38d, #f0b96a);
}

.adm-health-bar-crit > span {
    background: linear-gradient(90deg, #e08585, #c96868);
}

/* ----------------------------------------------------------------------------
   43. Wave 9 — Admin hub: danger / confirmation panels
   ------------------------------------------------------------------------- */
.adm-danger {
    padding: 1rem 1.15rem;
    background: rgba(224, 133, 133, 0.06);
    border: 1px solid rgba(224, 133, 133, 0.28);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.adm-danger-title {
    color: #f0bdbd;
    font-weight: 800;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.adm-danger-text {
    color: #ddd2bc;
    font-size: .82rem;
    line-height: 1.6;
}

.adm-danger-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------------------------
   44. Wave 9 — Admin hub: responsive shell
   ------------------------------------------------------------------------- */
@media (max-width: 980px) {
    .adm-nav {
        position: static;
    }
    .adm-topbar {
        align-items: stretch;
    }
    .adm-topbar-actions {
        justify-content: stretch;
    }
    .adm-topbar-actions > * {
        flex: 1 1 auto;
    }
}

/* ----------------------------------------------------------------------------
   45. Wave 8 — Unified search: search bar
   ------------------------------------------------------------------------- */
.srch-bar {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .5rem .5rem .5rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: 9999px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.srch-bar:focus-within {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.srch-bar-icon {
    color: #a89f8c;
    font-size: 1rem;
    flex-shrink: 0;
}

.srch-bar-input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #efe6d6;
    font-size: .95rem;
    padding: .35rem 0;
}

.srch-bar-input::placeholder {
    color: #8a8272;
}

.srch-bar-submit {
    flex-shrink: 0;
    padding: .5rem 1rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.40);
    color: #efe6d6;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s ease;
}

.srch-bar-submit:hover {
    background: rgba(245, 158, 11, 0.28);
}

/* Compact variant for header */
.srch-bar-compact {
    padding: .25rem .25rem .25rem .75rem;
}

.srch-bar-compact .srch-bar-input {
    font-size: .85rem;
    padding: .2rem 0;
}

/* ----------------------------------------------------------------------------
   46. Wave 8 — Unified search: filters / scope chips
   ------------------------------------------------------------------------- */
.srch-scopes {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.srch-scope {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    border-radius: 9999px;
    background: transparent;
    border: 1px solid var(--st-color-border);
    color: #ddd2bc;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.srch-scope:hover {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.35);
    color: #efe6d6;
}

.srch-scope-active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #efe6d6;
}

.srch-scope-count {
    font-size: .7rem;
    color: #a89f8c;
    font-family: var(--st-font-mono);
}

.srch-scope-active .srch-scope-count {
    color: #f8c974;
}

.srch-filter-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.srch-filter-row > * {
    flex: 0 1 auto;
}

/* ----------------------------------------------------------------------------
   47. Wave 8 — Unified search: result list
   ------------------------------------------------------------------------- */
.srch-summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    color: #a89f8c;
    font-size: .82rem;
}

.srch-summary strong {
    color: #efe6d6;
    font-weight: 700;
}

.srch-summary-time {
    font-family: var(--st-font-mono);
    font-size: .75rem;
    color: #8a8272;
}

.srch-results {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.srch-result {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    text-decoration: none;
    transition: border-color .2s ease, transform .15s ease;
}

.srch-result:hover {
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.srch-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.srch-result-title {
    color: #efe6d6;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.srch-result-type {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .12rem .5rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #f8c974;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.srch-result-type-user     { background: rgba(163, 184, 108, 0.14); border-color: rgba(163, 184, 108, 0.32); color: #cfdba5; }
.srch-result-type-org      { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.32); color: #f8c974; }
.srch-result-type-post     { background: rgba(250, 204, 21, 0.12); border-color: rgba(250, 204, 21, 0.30); color: #fbd38d; }
.srch-result-type-stream   { background: rgba(224, 133, 133, 0.12); border-color: rgba(224, 133, 133, 0.30); color: #f0bdbd; }
.srch-result-type-dict     { background: rgba(168, 159, 140, 0.12); border-color: rgba(168, 159, 140, 0.28); color: #ddd2bc; }

.srch-result-snippet {
    color: #ddd2bc;
    font-size: .85rem;
    line-height: 1.6;
}

.srch-result-snippet mark {
    background: rgba(253, 224, 71, 0.35);
    color: #efe6d6;
    padding: 0 .15rem;
    border-radius: 3px;
}

.srch-result-meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    font-size: .75rem;
    color: #a89f8c;
}

.srch-result-meta code {
    font-family: var(--st-font-mono);
    color: #f8c974;
    font-size: .72rem;
}

.srch-result-score {
    font-family: var(--st-font-mono);
    font-size: .72rem;
    color: #8a8272;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   48. Wave 8 — Unified search: suggestions / autocomplete
   ------------------------------------------------------------------------- */
.srch-suggest {
    position: absolute;
    z-index: 40;
    margin-top: .35rem;
    width: 100%;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    box-shadow: 0 12px 32px rgba(60, 40, 15, 0.40);
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
}

.srch-suggest-group {
    padding: .5rem .75rem .25rem;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8a8272;
}

.srch-suggest-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    color: #efe6d6;
    font-size: .85rem;
    cursor: pointer;
    transition: background .12s ease;
}

.srch-suggest-item:hover,
.srch-suggest-item-active {
    background: rgba(245, 158, 11, 0.12);
    color: #efe6d6;
}

.srch-suggest-item-icon {
    color: #a89f8c;
    flex-shrink: 0;
}

.srch-suggest-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.srch-suggest-item-hint {
    margin-left: auto;
    font-size: .72rem;
    color: #8a8272;
    font-family: var(--st-font-mono);
    flex-shrink: 0;
}

/* ----------------------------------------------------------------------------
   49. Wave 8 — Unified search: analytics page
   ------------------------------------------------------------------------- */
.srch-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.srch-analytics-card {
    padding: 1rem 1.15rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.srch-analytics-title {
    color: #efe6d6;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.srch-analytics-sub {
    color: #a89f8c;
    font-size: .78rem;
    line-height: 1.5;
}

.srch-term-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .25rem;
}

.srch-term {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .4rem .55rem;
    border-radius: 6px;
    background: rgba(239, 230, 214, 0.02);
    border: 1px solid var(--st-color-border);
    font-size: .82rem;
}

.srch-term-q {
    color: #efe6d6;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.srch-term-count {
    color: #f8c974;
    font-family: var(--st-font-mono);
    font-size: .75rem;
    flex-shrink: 0;
}

.srch-term-bar {
    height: 4px;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.18);
    margin-top: .25rem;
    overflow: hidden;
}

.srch-term-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #a3b86c);
}

/* Zero-result queries (red accent) */
.srch-term-zero .srch-term-count {
    color: #f0bdbd;
}

.srch-term-zero .srch-term-bar > span {
    background: linear-gradient(90deg, #e08585, #c96868);
}

/* ----------------------------------------------------------------------------
   50. Wave 8 — Unified search: synonyms / filters admin
   ------------------------------------------------------------------------- */
.srch-rule-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.srch-rule {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .75rem 1rem;
    background: var(--st-color-card);
    border: 1px solid var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.srch-rule-terms {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    font-size: .85rem;
}

.srch-rule-term {
    display: inline-flex;
    padding: .12rem .5rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ddd2bc;
    font-size: .75rem;
}

.srch-rule-arrow {
    color: #8a8272;
    font-size: .8rem;
}

.srch-rule-meta {
    font-size: .75rem;
    color: #a89f8c;
    font-family: var(--st-font-mono);
}

.srch-rule-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .srch-rule {
        grid-template-columns: 1fr;
    }
    .srch-rule-actions {
        justify-content: flex-start;
    }
}

/* ----------------------------------------------------------------------------
   51. Wave 8 — Unified search: empty / no results
   ------------------------------------------------------------------------- */
.srch-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: #a89f8c;
    font-size: .9rem;
    background: var(--st-color-card);
    border: 1px dashed var(--st-color-border);
    border-radius: var(--st-radius-sm);
}

.srch-empty-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
    opacity: .7;
}

.srch-empty strong {
    display: block;
    color: #efe6d6;
    font-size: 1rem;
    margin-bottom: .35rem;
}

.srch-empty-hints {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: .85rem;
}

.srch-empty-hint {
    display: inline-flex;
    padding: .25rem .65rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ddd2bc;
    font-size: .78rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.srch-empty-hint:hover {
    background: rgba(245, 158, 11, 0.20);
    color: #efe6d6;
}

/* ----------------------------------------------------------------------------
   52. Wave 8 — Unified search: responsive
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .srch-bar {
        border-radius: var(--st-radius-sm);
        padding: .5rem .5rem .5rem .75rem;
    }
    .srch-bar-submit {
        padding: .5rem .75rem;
    }
    .srch-filter-row > *,
    .srch-scopes > * {
        flex: 1 1 auto;
    }
}

/* ============================================================================
   53. Full-bleed layout system — APPEND-ONLY
   ============================================================================
   Nothing above this line is modified. Every rule below lives in the `.fx-*`
   namespace, which does not appear anywhere in sections 1–52 — so applying
   this block cannot collide with, or silently restyle, any existing element.
   Existing markup keeps its current look until you add a class by hand.

   Usage:
     <section class="fx-band fx-band--tint">          full-width, chrome-free
     <div class="fx-bleed">…</div>                    break out of .main-wrapper
     <div class="card fx-strip">…</div>               strip a .card to the bone
     <ul class="fx-tiles fx-tiles--ruled">…</ul>      edge-to-edge, hairline ruled
   ============================================================================ */

/* ---------------------------------------------------------------------------
   53.1  Horizontal overflow guard
   ------------------------------------------------------------------------ */
html { overflow-x: hidden; }

@supports (overflow: clip) {
    html { overflow-x: clip; }
}

/* ---------------------------------------------------------------------------
   53.2  Bleed primitives — break out of any centred container
   ------------------------------------------------------------------------ */
.fx-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.fx-bleed--full {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

@supports (height: 100dvh) {
    .fx-bleed--full { min-height: 100dvh; }
}

/* ---------------------------------------------------------------------------
   53.3  Optional inner breathing room
   ------------------------------------------------------------------------ */
.fx-gutter {
    width: 100%;
    padding-inline: 1.25rem;
}

.fx-measure {
    width: 100%;
    max-width: 68ch;
    margin-inline: auto;
}

.fx-frame {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ---------------------------------------------------------------------------
   53.4  Flush utilities — no border, no padding, no space
   ------------------------------------------------------------------------ */
.fx-flush       { padding: 0 !important; }
.fx-flush-x     { padding-inline: 0 !important; }
.fx-flush-y     { padding-block: 0 !important; }
.fx-marginless  { margin: 0 !important; }
.fx-space-0     { gap: 0 !important; }
.fx-borderless  { border: 0 !important; }
.fx-radiusless  { border-radius: 0 !important; }
.fx-shadowless  { box-shadow: none !important; }

.fx-strip {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ---------------------------------------------------------------------------
   53.5  Band — the core full-width building block
   ------------------------------------------------------------------------ */
.fx-band {
    position: relative;
    isolation: isolate;
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.fx-band--tint {
    background:
        radial-gradient(at 0% 0%,
            rgba(245, 158, 11, 0.10) 0px, transparent 55%),
        radial-gradient(at 100% 100%,
            rgba(251, 146, 60, 0.08) 0px, transparent 55%);
}

.fx-band--deep {
    background: linear-gradient(180deg,
        rgba(26, 22, 17, 0.0) 0%,
        rgba(28, 23, 17, 0.85) 50%,
        rgba(26, 22, 17, 0.0) 100%);
}

.fx-band--edge {
    background-image:
        linear-gradient(to right,
            transparent,
            var(--st-color-border) 18%,
            var(--st-color-border) 82%,
            transparent),
        linear-gradient(to right,
            transparent,
            var(--st-color-border) 18%,
            var(--st-color-border) 82%,
            transparent);
    background-size: 100% 1px, 100% 1px;
    background-position: 0 0, 0 100%;
    background-repeat: no-repeat;
}

/* ---------------------------------------------------------------------------
   53.6  Hero — full-width, flush, centred
   ------------------------------------------------------------------------ */
.fx-hero {
    position: relative;
    isolation: isolate;
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    min-height: 72svh;
    display: grid;
    place-items: center;
    text-align: center;
    background:
        radial-gradient(at 50% 0%,
            rgba(245, 158, 11, 0.16) 0px, transparent 60%),
        radial-gradient(at 50% 100%,
            rgba(251, 146, 60, 0.10) 0px, transparent 60%);
}

@supports (height: 100dvh) {
    .fx-hero { min-height: 72dvh; }
}

.fx-hero > * {
    max-width: 68ch;
    padding-inline: 1.25rem;
}

.fx-hero-title {
    margin: 0;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(135deg, #efe6d6 0%, #f8c974 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fx-hero-lede {
    margin: 1rem 0 0 0;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--st-color-text-sub);
    line-height: 1.75;
}

/* ---------------------------------------------------------------------------
   53.7  Tiles — edge-to-edge grid, zero space
   ------------------------------------------------------------------------ */
.fx-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 0;
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    list-style: none;
}

.fx-tiles > * {
    margin: 0;
    padding: 2.25rem 1.5rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.fx-tiles--ruled {
    gap: 1px;
    background: var(--st-color-border-subtle);
}

.fx-tiles--ruled > * {
    background: var(--st-color-bg);
}

/* ---------------------------------------------------------------------------
   53.8  Marquee strip — full-bleed, flush, edge to edge
   ------------------------------------------------------------------------ */
.fx-marquee {
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(to right,
        transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(to right,
        transparent, #000 8%, #000 92%, transparent);
}

.fx-marquee-track {
    display: flex;
    flex-shrink: 0;
    gap: 2.5rem;
    padding-inline: 1.25rem;
    animation: fx-marquee 32s linear infinite;
    will-change: transform;
}

@keyframes fx-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------------------
   53.9  Motion preference
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .fx-marquee-track { animation: none; }
}

/* ---------------------------------------------------------------------------
   53.10  Print — neutralise every bleed so nothing is clipped on paper
   ------------------------------------------------------------------------ */
@media print {
    .fx-bleed,
    .fx-band,
    .fx-hero,
    .fx-tiles,
    .fx-marquee {
        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .fx-marquee-track { animation: none !important; }
}