/* ═══════════════════════════════════════════════════════════════════════
   TRATOK AURORA — Design System
   A premium, glass-morphic, gradient-rich design language for the entire
   Tratok ecosystem. Drop-in replacement for tratok_design_system.css.

   Aesthetic: aurora gradients, frosted glass, kinetic motion, generous
   whitespace, bold display typography, color as content.

   Loaded by: every Tratok page (via app_header.php).
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────  Imports  ───────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─────────────────────────  Tokens  ───────────────────────── */
:root {
    /* Brand spectrum — aurora */
    --aurora-1: #FF6B35;        /* coral */
    --aurora-2: #FF3D7F;        /* magenta */
    --aurora-3: #7C3AED;        /* violet */
    --aurora-4: #00D9A3;        /* mint */
    --aurora-5: #FFD23F;        /* amber */
    --aurora-6: #38BDF8;        /* sky */

    /* Surface — dark default */
    --bg-canvas:  #06080F;
    --bg-base:    #0A0E1A;
    --bg-raised:  #11162A;
    --bg-elevated:#171D33;
    --bg-hover:   #1F2742;

    /* Glass */
    --glass-1: rgba(255,255,255,0.04);
    --glass-2: rgba(255,255,255,0.06);
    --glass-3: rgba(255,255,255,0.10);
    --glass-border: rgba(255,255,255,0.08);
    --glass-border-hi: rgba(255,255,255,0.16);

    /* Ink */
    --ink-100: #F8FAFC;
    --ink-200: #E2E8F0;
    --ink-300: #CBD5E1;
    --ink-400: #94A3B8;
    --ink-500: #64748B;
    --ink-600: #475569;
    --ink-700: #334155;

    /* Semantic */
    --ok:    #10B981;
    --warn:  #F59E0B;
    --bad:   #EF4444;
    --info:  #3B82F6;

    /* Brand alias */
    --brand:        var(--aurora-1);
    --brand-2:      var(--aurora-2);
    --brand-soft:   rgba(255,107,53,0.14);
    --brand-glow:   rgba(255,107,53,0.40);

    /* Gradients */
    --grad-aurora: linear-gradient(135deg, #FF6B35 0%, #FF3D7F 35%, #7C3AED 70%, #38BDF8 100%);
    --grad-sunset: linear-gradient(135deg, #FF6B35 0%, #FFD23F 100%);
    --grad-ocean:  linear-gradient(135deg, #38BDF8 0%, #00D9A3 100%);
    --grad-violet: linear-gradient(135deg, #7C3AED 0%, #FF3D7F 100%);
    --grad-mint:   linear-gradient(135deg, #00D9A3 0%, #38BDF8 100%);
    --grad-text:   linear-gradient(135deg, #FF6B35 0%, #FF3D7F 50%, #7C3AED 100%);

    /* Radii */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-2xl:36px;
    --r-pill:999px;

    /* Shadow */
    --sh-sm:  0 1px 2px rgba(0,0,0,0.20);
    --sh-md:  0 8px 24px rgba(0,0,0,0.35);
    --sh-lg:  0 20px 60px rgba(0,0,0,0.45);
    --sh-xl:  0 30px 80px rgba(0,0,0,0.55);
    --sh-glow:0 0 60px rgba(255,107,53,0.25);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in:  cubic-bezier(0.55, 0, 0.65, 0.30);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 140ms;
    --t-mid:  260ms;
    --t-slow: 480ms;

    /* Sizing */
    --nav-h: 72px;
    --bottom-nav-h: 78px;
    --container: 1280px;
    --container-narrow: 880px;

    /* Layout */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    color-scheme: dark;
}

/* Compact topbar on phones — keeps brand + icons but removes vertical bloat. */
@media (max-width: 600px) {
    :root { --nav-h: 56px; }
}

/* Light theme override */
html[data-theme="light"] {
    --bg-canvas:  #FAF9F6;
    --bg-base:    #FFFFFF;
    --bg-raised:  #F4F3EE;
    --bg-elevated:#EAE8E0;
    --bg-hover:   #E0DDD2;

    --glass-1: rgba(0,0,0,0.03);
    --glass-2: rgba(0,0,0,0.05);
    --glass-3: rgba(0,0,0,0.08);
    --glass-border: rgba(0,0,0,0.08);
    --glass-border-hi: rgba(0,0,0,0.16);

    --ink-100: #0A0E1A;
    --ink-200: #1F2742;
    --ink-300: #334155;
    --ink-400: #475569;
    --ink-500: #64748B;
    --ink-600: #94A3B8;
    --ink-700: #CBD5E1;

    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-feature-settings: "ss01","cv11","cv02","cv03";
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-canvas);
    color: var(--ink-200);
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

/* Aurora ambience — subtle moving gradient mesh on canvas */
body::before {
    content: '';
    position: fixed;
    inset: -20% -10% auto auto;
    width: 70vmax;
    height: 70vmax;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,107,53,0.18), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(124,58,237,0.16), transparent 60%);
    filter: blur(60px);
    z-index: -2;
    pointer-events: none;
    animation: auroraDrift 28s ease-in-out infinite alternate;
}
body::after {
    content: '';
    position: fixed;
    inset: auto auto -20% -10%;
    width: 60vmax;
    height: 60vmax;
    background:
        radial-gradient(circle at 50% 50%, rgba(0,217,163,0.14), transparent 60%);
    filter: blur(70px);
    z-index: -2;
    pointer-events: none;
    animation: auroraDrift 36s ease-in-out -10s infinite alternate;
}
html[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 30% 30%, rgba(255,107,53,0.20), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(124,58,237,0.18), transparent 60%);
}
html[data-theme="light"] body::after {
    background: radial-gradient(circle at 50% 50%, rgba(56,189,248,0.18), transparent 60%);
}
@keyframes auroraDrift {
    0%   { transform: translate(0,0) rotate(0deg);   }
    50%  { transform: translate(-4%,3%) rotate(8deg); }
    100% { transform: translate(3%,-3%) rotate(-6deg);}
}
@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
}

img,svg,video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input,textarea,select { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }

/* ─────────────────────────  Typography  ───────────────────────── */
.t-display {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
h1,h2,h3,h4,h5 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--ink-100);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4.5vw + 1rem, 4.5rem); line-height: 1.05; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 2.4vw + 1rem, 3rem); }
h3 { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.85rem); }
h4 { font-size: clamp(1.05rem, 0.4vw + 1rem, 1.25rem); }

.t-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-400);
}
.t-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--aurora-1), transparent);
}

.t-gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.t-gradient-text-ocean { background: var(--grad-ocean); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.t-gradient-text-sunset{ background: var(--grad-sunset);-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.t-gradient-text-mint  { background: var(--grad-mint);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.t-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "tnum","zero"; }

/* ─────────────────────────  Layout primitives  ───────────────────────── */
.t-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.t-container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }
.t-section { padding: clamp(28px, 5vw, 72px) 0; position: relative; }
.t-section-tight { padding: clamp(14px, 2.5vw, 28px) 0; }

/* On phones the fixed topbar already eats 72px of viewport. Don't pile
   extra margin on the first content section. */
@media (max-width: 600px) {
    .t-app-main > .t-section-tight:first-child,
    .t-app-main .t-container > .t-section-tight:first-child,
    .t-app-main .t-container-narrow > .t-section-tight:first-child {
        padding-top: 4px;
    }
    .t-app-main > .t-section:first-child,
    .t-app-main .t-container > .t-section:first-child,
    .t-app-main .t-container-narrow > .t-section:first-child {
        padding-top: 8px;
    }
}
.t-stack > * + * { margin-top: var(--gap, 16px); }
.t-grid { display: grid; gap: var(--gap, 16px); }
.t-row { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }

.t-app-shell {
    display: flex;
    min-height: 100svh;
    padding-top: var(--safe-top);
}
.t-app-main {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 8px;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
}
@media (max-width: 600px) {
    .t-app-main { padding-top: 0; }
}
@media (min-width: 1024px) {
    .t-app-main { padding-bottom: 24px; }
}

/* ─────────────────────────  Glass surfaces  ───────────────────────── */
.t-card {
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 20px;
    transition: transform var(--t-mid) var(--ease-out), border-color var(--t-mid), box-shadow var(--t-mid);
    position: relative;
}
.t-card:hover {
    border-color: var(--glass-border-hi);
}

.t-glass {
    background: linear-gradient(180deg, var(--glass-2), var(--glass-1));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
}

.t-card-glow {
    position: relative;
    overflow: hidden;
}
.t-card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, rgba(255,107,53,0.4) 50%, transparent 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--t-mid);
    pointer-events: none;
}
.t-card-glow:hover::before { opacity: 1; }

.t-bento {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(12, 1fr);
}
.t-bento > * { grid-column: span 12; }
@media (min-width: 768px) {
    .t-bento > .t-bento-half { grid-column: span 6; }
    .t-bento > .t-bento-third { grid-column: span 4; }
    .t-bento > .t-bento-two-thirds { grid-column: span 8; }
    .t-bento > .t-bento-quarter { grid-column: span 3; }
}

/* ─────────────────────────  Buttons  ───────────────────────── */
.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-mid), background-color var(--t-mid), border-color var(--t-mid);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}
.t-btn:active { transform: scale(0.97); }
.t-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.t-btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3D7F 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(255,107,53,0.32), inset 0 1px 0 rgba(255,255,255,0.20);
}
.t-btn-primary:hover { box-shadow: 0 14px 36px rgba(255,107,53,0.42), inset 0 1px 0 rgba(255,255,255,0.25); transform: translateY(-2px); }

.t-btn-aurora {
    background: var(--grad-aurora);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 10px 30px rgba(124,58,237,0.30);
    animation: auroraShift 8s ease infinite;
}
.t-btn-aurora:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(124,58,237,0.42); }
@keyframes auroraShift {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}

.t-btn-glass {
    background: var(--glass-2);
    color: var(--ink-100);
    border-color: var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.t-btn-glass:hover { background: var(--glass-3); border-color: var(--glass-border-hi); transform: translateY(-2px); }

.t-btn-ghost {
    background: transparent;
    color: var(--ink-200);
    border-color: var(--glass-border);
}
.t-btn-ghost:hover { background: var(--glass-1); }

.t-btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.t-btn-lg { padding: 16px 28px; font-size: 1.05rem; }
.t-btn-block { width: 100%; }
.t-btn-pill-icon {
    width: 42px; height: 42px; padding: 0;
    border-radius: 50%;
    background: var(--glass-2); border: 1px solid var(--glass-border); color: var(--ink-200);
}
.t-btn-pill-icon:hover { background: var(--glass-3); color: var(--ink-100); }

/* ─────────────────────────  Form  ───────────────────────── */
.t-field { display: flex; flex-direction: column; gap: 6px; }
.t-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-400); letter-spacing: 0.04em; text-transform: uppercase; }
.t-input,
.t-textarea,
.t-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    color: var(--ink-100);
    font-size: 0.95rem;
    transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
}
.t-input::placeholder, .t-textarea::placeholder { color: var(--ink-500); }
.t-input:hover, .t-textarea:hover, .t-select:hover { border-color: var(--glass-border-hi); }
.t-input:focus, .t-textarea:focus, .t-select:focus {
    border-color: var(--brand);
    background: var(--bg-raised);
    box-shadow: 0 0 0 4px rgba(255,107,53,0.12);
}
.t-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.t-field-icon { position: relative; }
.t-field-icon .t-input { padding-left: 44px; }
.t-field-icon i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }

.t-checkbox, .t-radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.t-checkbox input, .t-radio input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ─────────────────────────  Pills, chips, badges  ───────────────────────── */
.t-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--glass-2);
    border: 1px solid var(--glass-border);
    color: var(--ink-300);
    font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}
.t-chip:hover { background: var(--glass-3); color: var(--ink-100); }
.t-chip.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.t-pill-gradient {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, rgba(255,107,53,0.18), rgba(124,58,237,0.18));
    border: 1px solid rgba(255,107,53,0.22);
    font-size: 0.78rem; font-weight: 600;
    color: var(--ink-100);
}

.t-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px;
    background: var(--brand);
    color: #fff;
    font-size: 0.7rem; font-weight: 700;
    border-radius: var(--r-pill);
    min-width: 20px;
}

/* ─────────────────────────  Header / top nav  ───────────────────────── */
.t-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 90;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(10,14,26,0.65);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--glass-border);
    transition: background-color var(--t-mid);
}
html[data-theme="light"] .t-topbar { background: rgba(255,255,255,0.75); }

.t-topbar-inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.t-brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--ink-100);
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}
/* Brand lock-up: real logo.webp, contained in a transparent square. */
.t-brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.t-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.t-nav-links { display: none; gap: 6px; align-items: center; }
@media (min-width: 1024px) { .t-nav-links { display: inline-flex; } }
.t-nav-link {
    padding: 8px 14px;
    border-radius: var(--r-pill);
    color: var(--ink-300);
    font-size: 0.92rem; font-weight: 500;
    transition: color var(--t-fast), background-color var(--t-fast);
}
.t-nav-link:hover { color: var(--ink-100); background: var(--glass-1); }
.t-nav-link.is-active { color: var(--ink-100); background: var(--glass-2); }

.t-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.t-icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-300);
    background: transparent;
    border: 1px solid transparent;
    transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
    position: relative;
}
.t-icon-btn:hover { background: var(--glass-2); color: var(--ink-100); }
.t-icon-btn:active { transform: scale(0.92); }
.t-icon-btn .t-badge {
    position: absolute;
    top: 4px; right: 4px;
    transform: translate(35%,-35%);
}
.t-icon-btn-dot::after {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 2px var(--bg-base);
}

.t-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 2px solid var(--glass-border);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    color: var(--ink-100);
    flex-shrink: 0;
}
.t-avatar img { width: 100%; height: 100%; object-fit: cover; }
.t-avatar-sm { width: 30px; height: 30px; font-size: 0.7rem; }
.t-avatar-lg { width: 56px; height: 56px; font-size: 1.05rem; }
.t-avatar-xl { width: 96px; height: 96px; font-size: 1.6rem; border-width: 3px; }
.t-avatar-ring { box-shadow: 0 0 0 3px var(--bg-canvas), 0 0 0 5px var(--brand); }

/* ─────────────────────────  Bottom nav (mobile)  ───────────────────────── */
.t-bottom-nav {
    position: fixed;
    bottom: calc(12px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: rgba(10,14,26,0.78);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-pill);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow: 0 18px 48px rgba(0,0,0,0.45);
    width: calc(100% - 24px);
    max-width: 460px;
    justify-content: space-between;
}
html[data-theme="light"] .t-bottom-nav { background: rgba(255,255,255,0.85); }
@media (min-width: 1024px) {
    .t-bottom-nav { display: none; }
}

.t-bottom-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 999px;
    color: var(--ink-400);
    font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.04em;
    transition: all var(--t-fast) var(--ease-out);
    position: relative;
    text-align: center;
}
.t-bottom-nav__item i { font-size: 18px; }
.t-bottom-nav__item:hover { color: var(--ink-100); }
.t-bottom-nav__item.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    box-shadow: 0 8px 20px rgba(255,61,127,0.36);
    transform: translateY(-3px);
}
.t-bottom-nav__item.is-active span { font-weight: 700; }
.t-bottom-nav__badge {
    position: absolute;
    top: 2px; right: 14px;
    background: var(--bad);
    color: #fff;
    font-size: 0.62rem; font-weight: 700;
    border-radius: 99px;
    padding: 2px 5px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-base);
}
.t-bottom-nav__badge--dot { width: 8px; height: 8px; padding: 0; min-width: 0; right: 18px; top: 6px; }

/* ─────────────────────────  Sidebar (desktop)  ─────────────────────────
   Fixed-position so it sits at the true left edge of the viewport, regardless
   of any body padding. Body's `padding-left` then offsets the main content
   beside it.
*/
.t-sidebar {
    display: none;
    flex-direction: column;
    width: 240px;
    padding: calc(var(--nav-h) + 18px) 14px 18px;
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--bg-base);
    z-index: 50;
}
@media (min-width: 1280px) {
    .t-sidebar { display: flex; }
}
.t-sidebar__group { margin-bottom: 24px; }
.t-sidebar__title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-500);
    padding: 0 12px;
    margin-bottom: 8px;
    font-weight: 700;
}
.t-sidebar__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: var(--r-md);
    color: var(--ink-300);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--t-fast);
    border: 1px solid transparent;
}
.t-sidebar__item i { width: 20px; text-align: center; opacity: 0.85; }
.t-sidebar__item:hover { background: var(--glass-1); color: var(--ink-100); }
.t-sidebar__item.is-active {
    background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(124,58,237,0.10));
    color: var(--ink-100);
    border-color: rgba(255,107,53,0.25);
}
.t-sidebar__item.is-active i { color: var(--brand); opacity: 1; }
.t-sidebar__item .t-badge { margin-left: auto; }

/* ─────────────────────────  Hero  ─────────────────────────
   Top padding is intentionally tight — the topbar already adds nav height
   above. Bottom padding still generous so the hero feels like a hero.
*/
.t-hero {
    position: relative;
    padding: clamp(24px, 4vw, 56px) 0 clamp(40px, 7vw, 80px);
    overflow: hidden;
}
.t-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--glass-2);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-size: 0.78rem; font-weight: 600; color: var(--ink-200);
    margin-bottom: 24px;
}
.t-hero-eyebrow .t-dot {
    width: 8px; height: 8px; background: var(--aurora-4); border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(0,217,163,0.18);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 4px rgba(0,217,163,0.18); }
    50%     { box-shadow: 0 0 0 8px rgba(0,217,163,0.05); }
}
.t-hero h1 {
    font-size: clamp(2.2rem, 5.6vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink-100);
    margin-bottom: 22px;
    max-width: 18ch;
}
.t-hero .t-hero-sub {
    font-size: clamp(1rem, 0.4vw + 0.95rem, 1.2rem);
    color: var(--ink-300);
    line-height: 1.55;
    max-width: 56ch;
    margin-bottom: 36px;
}
.t-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─────────────────────────  Search command  ───────────────────────── */
.t-search-shell {
    background: linear-gradient(180deg, var(--glass-3), var(--glass-1));
    border: 1px solid var(--glass-border-hi);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: var(--r-2xl);
    padding: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.40);
    position: relative;
    /* Lift the entire shell (and its absolutely-positioned autocomplete
       descendants) above later sibling sections like Trending Getaways.
       Without this, the shell's backdrop-filter stacking context confines
       the overlay's z-index to "above siblings within the shell" only,
       and later DOM siblings paint over it in the root context. */
    z-index: 50;
}
.t-search-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
    background: var(--glass-1);
    border-radius: var(--r-pill);
}
.t-search-tabs::-webkit-scrollbar { display: none; }
.t-search-tab {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    color: var(--ink-300);
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.t-search-tab i { font-size: 14px; }
.t-search-tab:hover { color: var(--ink-100); }
.t-search-tab.is-active {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    color: #fff;
    box-shadow: 0 8px 22px rgba(255,107,53,0.35);
}

.t-search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
}
@media (min-width: 768px) {
    .t-search-row { grid-template-columns: 1.4fr 1fr 1fr auto; }
}
@media (min-width: 1024px) {
    /* When the form has 5 cells (destination + check-in + check-out + small + small),
       give the destination more room and let dates / selects share equally. */
    .search-pane__row { grid-template-columns: 1.6fr 1fr 1fr 0.9fr 0.7fr auto; }
}
.t-search-cell {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    transition: border-color var(--t-fast), background-color var(--t-fast);
    min-height: 64px;
}
.t-search-cell:focus-within { border-color: var(--brand); background: var(--bg-elevated); }
.t-search-cell:hover { border-color: var(--glass-border-hi); }
.t-search-cell i { color: var(--brand); font-size: 16px; flex-shrink: 0; }
.t-search-cell label { display: block; font-size: 0.68rem; color: var(--ink-400); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.t-search-cell input,
.t-search-cell select {
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--ink-100);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}
/* Native date input — show picker indicator in brand color, hide spinners */
.t-search-cell input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: invert(1);
    transition: opacity var(--t-fast);
}
.t-search-cell input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
html[data-theme="light"] .t-search-cell input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
.t-search-cell input[type="date"]:not(:focus):placeholder-shown,
.t-search-cell input[type="date"]:invalid {
    color: var(--ink-500);
}
.t-search-cell select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 14px;
    padding-right: 18px;
}
.t-search-cell select option { background: var(--bg-raised); color: var(--ink-100); }
.t-search-cell--date { min-width: 0; }
.t-search-cell--small { max-width: 160px; }
@media (max-width: 767px) {
    .t-search-cell--small { max-width: none; }
}
.t-search-submit {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    color: #fff;
    border-radius: var(--r-md);
    padding: 18px 28px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 0;
    cursor: pointer;
    box-shadow: 0 14px 40px rgba(255,107,53,0.36);
    transition: transform var(--t-fast), box-shadow var(--t-mid);
}
.t-search-submit:hover { transform: translateY(-2px); box-shadow: 0 22px 56px rgba(255,107,53,0.50); }

/* Suggestions overlay used by app_index */
.suggestions-list {
    list-style: none;
    margin: 0; padding: 6px;
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    max-height: 320px;
    overflow-y: auto;
}
.suggestions-list li {
    padding: 10px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--ink-200);
    transition: background-color var(--t-fast);
}
.suggestions-list li:hover { background: var(--glass-2); }
.suggestion-content { display: flex; align-items: center; gap: 12px; }
.suggestion-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); border-radius: var(--r-sm); }
.suggestion-text { display: flex; flex-direction: column; gap: 2px; }
.suggestion-main { font-weight: 600; color: var(--ink-100); font-size: 0.9rem; }
.suggestion-sub { font-size: 0.75rem; color: var(--ink-500); }
.no-results { color: var(--ink-500); padding: 12px; text-align: center; }

/* ─────────────────────────  Stat tile  ───────────────────────── */
.t-stat {
    background: linear-gradient(180deg, var(--glass-2), var(--glass-1));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 20px;
    transition: transform var(--t-mid) var(--ease-out), border-color var(--t-fast);
}
.t-stat:hover { transform: translateY(-4px); border-color: var(--glass-border-hi); }
.t-stat__label { font-size: 0.74rem; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.t-stat__value { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.6rem, 2.5vw, 2.4rem); font-weight: 700; color: var(--ink-100); margin-top: 8px; line-height: 1; letter-spacing: -0.02em; }
.t-stat__delta { font-size: 0.78rem; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.t-stat__delta.up { color: var(--ok); }
.t-stat__delta.down { color: var(--bad); }

/* ─────────────────────────  Friend pile (renderFriendPile)  ─────────────────────────
   Used by friends-from-city banners on search pages and "you both know" cards.
   Without these rules the imgs render at native pixel size — i.e. full-size
   avatars stack vertically and dwarf the page.
*/
.t-friend-pile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--ink-300);
}
.t-friend-pile__avatars {
    display: inline-flex;
    flex-shrink: 0;
}
.t-friend-pile__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-canvas);
    margin-left: -8px;
    background: var(--bg-elevated);
    flex-shrink: 0;
}
.t-friend-pile__avatar:first-child { margin-left: 0; }
.t-friend-pile__avatar--more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ─────────────────────────  Result card / property card  ───────────────────────── */
.t-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 640px)  { .t-result-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .t-result-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1440px) { .t-result-grid { grid-template-columns: repeat(4, 1fr); } }

.t-result-card {
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform var(--t-mid) var(--ease-out), border-color var(--t-fast), box-shadow var(--t-mid);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.t-result-card:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border-hi);
    box-shadow: 0 24px 60px rgba(0,0,0,0.40);
}
.t-result-card__media {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-elevated);
}
.t-result-card__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--t-slow) var(--ease-out);
}
.t-result-card:hover .t-result-card__media img { transform: scale(1.08); }
.t-result-card__media::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}
.t-result-card__chips {
    position: absolute;
    top: 12px; left: 12px; right: 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.t-result-card__heart {
    width: 36px; height: 36px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform var(--t-fast);
}
.t-result-card__heart:hover { transform: scale(1.15); }
.t-result-card__heart.is-active { color: var(--bad); }
.t-result-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.t-result-card__title { font-size: 1rem; font-weight: 700; color: var(--ink-100); display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.t-result-card__loc { font-size: 0.82rem; color: var(--ink-400); display: inline-flex; align-items: center; gap: 6px; }
.t-result-card__rating { font-size: 0.78rem; color: var(--ink-200); display: inline-flex; align-items: center; gap: 4px; }
.t-result-card__rating .star { color: var(--aurora-5); }
.t-result-card__price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--ink-100); margin-top: auto; }
.t-result-card__price small { color: var(--ink-500); font-size: 0.72rem; font-weight: 500; margin-left: 4px; }

/* ─────────────────────────  Toasts  ───────────────────────── */
.t-toast-wrap {
    position: fixed;
    top: calc(var(--nav-h) + 20px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.t-toast {
    pointer-events: auto;
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-radius: var(--r-md);
    padding: 14px 18px;
    box-shadow: var(--sh-lg);
    min-width: 280px;
    max-width: 360px;
    display: flex;
    gap: 12px;
    align-items: start;
    animation: toastIn 320ms var(--ease-out);
}
.t-toast i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.t-toast.success i { color: var(--ok); }
.t-toast.error i { color: var(--bad); }
.t-toast.warning i { color: var(--warn); }
.t-toast.info i { color: var(--info); }
.t-toast strong { display: block; color: var(--ink-100); margin-bottom: 2px; font-size: 0.92rem; }
.t-toast span { font-size: 0.84rem; color: var(--ink-400); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ─────────────────────────  Modal / overlay  ───────────────────────── */
.t-modal-bg {
    position: fixed; inset: 0;
    background: rgba(6,8,15,0.72);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
}
.t-modal-bg.is-open { display: flex; }
.t-modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 28px;
    box-shadow: var(--sh-xl);
    animation: modalIn 320ms var(--ease-spring);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─────────────────────────  Footer  ───────────────────────── */
.t-footer {
    margin-top: 80px;
    padding: 56px 24px 36px;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.20));
    color: var(--ink-400);
    font-size: 0.88rem;
}
.t-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    gap: 36px;
}
@media (min-width: 768px) {
    .t-footer-inner { grid-template-columns: 1.4fr repeat(3, 1fr); }
}
.t-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-200); margin-bottom: 14px; font-family: 'Inter', sans-serif; font-weight: 700; }
.t-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.t-footer a { color: var(--ink-400); transition: color var(--t-fast); }
.t-footer a:hover { color: var(--ink-100); }
.t-footer-bottom {
    max-width: var(--container);
    margin: 36px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    color: var(--ink-500);
    font-size: 0.8rem;
}
.t-footer-social { display: flex; gap: 8px; }
.t-footer-social a {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--glass-2);
    border: 1px solid var(--glass-border);
}

/* ─────────────────────────  Scroll reveal  ───────────────────────── */
[data-tratok-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
[data-tratok-reveal].is-visible { opacity: 1; transform: none; }

/* ─────────────────────────  Predictive search overlay  ─────────────────────────
   Shared autocomplete styling used by every page (app_index + every results page).
   Targets the new class AND every concrete ID so it overrides the legacy
   tratok_design_system.css rules on the same IDs. */
.suggestions-overlay,
#suggestions, #suggestions-air-depart, #suggestions-air-return,
#suggestions-activity, #suggestions-car {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin: 8px 0 0 0;
    display: none;
    z-index: 1000;
    background: #11162A;
    border: 1px solid var(--glass-border-hi);
    border-radius: var(--r-md);
    box-shadow: 0 18px 48px rgba(0,0,0,0.55);
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
}
html[data-theme="light"] .suggestions-overlay,
html[data-theme="light"] #suggestions,
html[data-theme="light"] #suggestions-air-depart,
html[data-theme="light"] #suggestions-air-return,
html[data-theme="light"] #suggestions-activity,
html[data-theme="light"] #suggestions-car { background: #FFFFFF; }

.suggestions-overlay.is-open,
#suggestions.is-open, #suggestions-air-depart.is-open, #suggestions-air-return.is-open,
#suggestions-activity.is-open, #suggestions-car.is-open {
    display: block !important;
    animation: sgSlideDown 0.18s ease;
}

@keyframes sgSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Slim, themed scrollbar. */
.suggestions-overlay::-webkit-scrollbar,
#suggestions::-webkit-scrollbar, #suggestions-air-depart::-webkit-scrollbar, #suggestions-air-return::-webkit-scrollbar,
#suggestions-activity::-webkit-scrollbar, #suggestions-car::-webkit-scrollbar { width: 6px; }
.suggestions-overlay::-webkit-scrollbar-track,
#suggestions::-webkit-scrollbar-track, #suggestions-air-depart::-webkit-scrollbar-track, #suggestions-air-return::-webkit-scrollbar-track,
#suggestions-activity::-webkit-scrollbar-track, #suggestions-car::-webkit-scrollbar-track { background: transparent; }
.suggestions-overlay::-webkit-scrollbar-thumb,
#suggestions::-webkit-scrollbar-thumb, #suggestions-air-depart::-webkit-scrollbar-thumb, #suggestions-air-return::-webkit-scrollbar-thumb,
#suggestions-activity::-webkit-scrollbar-thumb, #suggestions-car::-webkit-scrollbar-thumb { background: var(--glass-3); border-radius: 99px; }
.suggestions-overlay { scrollbar-width: thin; scrollbar-color: var(--glass-3) transparent; }

.suggestions-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
    max-height: none;
    overflow: visible;
}
.suggestions-list li {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--ink-200);
    font-size: 0.92rem;
    transition: background-color var(--t-fast), padding-left var(--t-fast), color var(--t-fast);
    border-radius: 8px;
    margin: 0 6px;
    background: transparent;
}
.suggestions-list li:hover,
.suggestions-list li.is-focused,
.suggestions-list li.focused {
    background: var(--brand-soft);
    color: var(--ink-100);
    padding-left: 18px;
}
.suggestions-list .no-results,
.suggestions-list .suggestions-loading {
    padding: 14px;
    text-align: center;
    color: var(--ink-500);
    font-size: 0.85rem;
    cursor: default;
    background: transparent;
}
.suggestions-list .no-results:hover,
.suggestions-list .suggestions-loading:hover {
    background: transparent;
    padding-left: 14px;
    color: var(--ink-500);
}
.suggestion-content { display: flex; align-items: center; gap: 12px; }
.suggestion-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--glass-2);
    color: var(--brand);
    font-size: 14px;
    flex-shrink: 0;
}
.suggestion-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suggestion-main { font-weight: 600; color: var(--ink-100); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-sub  { font-size: 0.78rem; color: var(--ink-400); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Skeleton loader */
.t-skel {
    background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-hover) 50%, var(--bg-elevated) 100%);
    background-size: 200% 100%;
    border-radius: var(--r-sm);
    animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─────────────────────────  Custom calendar (shared)  ─────────────────────────
   Used by app_index.php and every results-page edit modal. The overlay HTML
   itself ships via `app_calendar.php`; the JS lives in `js/tratok-calendar.js`. */
.date-trigger { cursor: pointer; user-select: none; }
.date-trigger:hover { border-color: var(--glass-border-hi); }
.date-trigger .dt-text {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.date-trigger .dt-text.dt-placeholder { color: var(--ink-500); font-weight: 500; }

.cal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(6,8,15,0.78);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.cal-overlay.is-open { display: flex; }
.cal-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--bg-raised);
    border: 1px solid var(--glass-border-hi);
    border-radius: var(--r-xl);
    padding: 24px 22px 22px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sh-xl);
    animation: calPop 280ms var(--ease-spring);
}
@keyframes calPop { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-head .cal-title { font-size: 1.05rem; font-weight: 700; color: var(--ink-100); font-family: 'Space Grotesk', sans-serif; }
.cal-head .t-icon-btn { width: 32px; height: 32px; }

.cal-sel { display: flex; gap: 10px; margin-bottom: 18px; }
.cal-sel-box {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    text-align: left;
    transition: border-color var(--t-fast), background-color var(--t-fast);
}
.cal-sel-box.is-active {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.10);
}
.cal-sel-label { font-size: 0.66rem; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.08em; }
.cal-sel-val { font-size: 0.92rem; font-weight: 700; color: var(--ink-100); margin-top: 2px; font-family: 'Space Grotesk', sans-serif; }

.cal-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month span { font-size: 0.95rem; font-weight: 700; color: var(--ink-100); font-family: 'Space Grotesk', sans-serif; }
.cal-month button { background: transparent; border: 1px solid var(--glass-border); color: var(--ink-300); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--t-fast); }
.cal-month button:hover:not(:disabled) { background: var(--glass-2); color: var(--ink-100); border-color: var(--glass-border-hi); }
.cal-month button:disabled { opacity: 0.3; cursor: default; }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 0.66rem; font-weight: 700; color: var(--ink-500); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.06em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
    text-align: center;
    padding: 11px 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink-200);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color var(--t-fast), color var(--t-fast);
    border: 0;
    background: transparent;
}
.cal-day:hover:not(.disabled):not(.empty):not(.start):not(.end) { background: var(--glass-2); }
.cal-day.empty, .cal-day.disabled { cursor: default; }
.cal-day.disabled { color: var(--ink-700); }
.cal-day.today { color: var(--aurora-4); font-weight: 800; }
.cal-day.start, .cal-day.end {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    color: #fff;
    box-shadow: 0 6px 20px rgba(255,107,53,0.36);
}
.cal-day.start { border-radius: 10px 0 0 10px; }
.cal-day.end   { border-radius: 0 10px 10px 0; }
.cal-day.start.end { border-radius: 10px; }
.cal-day.in-range {
    background: var(--brand-soft);
    color: var(--ink-100);
    border-radius: 0;
}

.cal-done {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    color: #fff;
    border: 0;
    border-radius: var(--r-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform var(--t-fast), box-shadow var(--t-mid), filter var(--t-fast);
    box-shadow: 0 14px 36px rgba(255,107,53,0.36);
}
.cal-done:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 44px rgba(255,107,53,0.46); }
.cal-done:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

/* ─────────────────────────  Mobile only / desktop only  ───────────────────────── */
.t-mobile-only { display: block; }
.t-desktop-only { display: none; }
@media (min-width: 1024px) {
    .t-mobile-only { display: none; }
    .t-desktop-only { display: block; }
}

/* ─────────────────────────  Helpers  ───────────────────────── */
.t-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 32px 0;
}
.t-noise {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.t-link { color: var(--brand); font-weight: 600; }
.t-link:hover { text-decoration: underline; }

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

/* Focus ring */
*:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}
button:focus-visible { outline-offset: 4px; }

/* Print */
@media print {
    .t-topbar, .t-bottom-nav, .t-sidebar, .t-footer { display: none !important; }
    body { color: #000; background: #fff; }
}

/* Accessibility — reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Tara floating widget — placeholder slot, can be themed */
.t-tara-fab {
    position: fixed;
    bottom: calc(110px + var(--safe-bottom));
    right: 16px;
    z-index: 70;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--grad-aurora);
    background-size: 200% 200%;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 18px 40px rgba(124,58,237,0.40);
    animation: auroraShift 8s ease infinite;
    transition: transform var(--t-fast);
}
.t-tara-fab:hover { transform: scale(1.08); }
/* On desktop, the Tara icon already lives in the header — hide the
   floating duplicate so the page chrome stays focused. */
@media (min-width: 1024px) {
    .t-tara-fab { display: none !important; }
}

/* Story strip */
.t-stories {
    display: flex;
    gap: 14px;
    padding: 8px 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
.t-stories::-webkit-scrollbar { display: none; }
.t-story {
    flex: 0 0 76px;
    scroll-snap-align: start;
    /* `<span>` ring + `<span>` name need a real flex container to stack —
       buttons & anchors default to inline behaviour, which makes the inner
       ring inline too (width/height ignored, the avatar collapses to its
       natural ratio → ovals). */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 4px 2px;
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--t-fast);
}
.t-story:hover  { transform: translateY(-2px); }
.t-story:active { transform: scale(0.96); }
.t-story:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 4px;
    border-radius: var(--r-md);
}

.t-story-ring {
    /* `inline-grid` is what actually makes width/height honor — a default
       `<span>` ignores both because it's an inline box. */
    display: inline-grid;
    place-items: center;
    width: 72px; height: 72px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    padding: 3px;
    background: var(--grad-aurora);
    background-size: 200% 200%;
    animation: auroraShift 6s ease infinite;
    box-shadow: 0 8px 22px rgba(124,58,237,0.28), 0 0 0 1px rgba(255,255,255,0.05);
    transition: box-shadow var(--t-mid), transform var(--t-mid);
}
.t-story:hover .t-story-ring {
    box-shadow: 0 14px 30px rgba(255,61,127,0.42), 0 0 0 1px rgba(255,255,255,0.08);
}
.t-story--seen .t-story-ring,
.t-story-ring[style*="--glass-3"] {
    background: var(--glass-3) !important;
    animation: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.t-story-ring img {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-canvas);
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
    background: var(--bg-elevated);
}
html[data-theme="light"] .t-story-ring img { border-color: var(--bg-base); }

.t-story-name {
    font-size: 0.74rem;
    color: var(--ink-300);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 72px;
    text-align: center;
}
.t-story--seen .t-story-name { color: var(--ink-500); font-weight: 500; }

/* ─────────────────────────  Story viewer (full-screen)  ─────────────────────────
   Rendered by js/tratok-ui.js inside <body> when a story button is clicked.
   Without these rules the viewer was inserted into the DOM but had no styling
   (display:block from the user-agent default → invisible since it has no size),
   so clicks appeared to do nothing. */
.t-story-viewer {
    position: fixed; inset: 0;
    z-index: 1100;
    background: var(--bg-canvas);
    display: none;
    flex-direction: column;
    animation: tStoryFadeIn 0.2s var(--ease-out) both;
}
.t-story-viewer.is-open { display: flex; }
@keyframes tStoryFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Progress segments at the top */
.t-story-viewer__progress {
    display: flex; gap: 4px;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 6px;
    z-index: 2;
}
.t-story-viewer__bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.22);
    border-radius: 99px;
    overflow: hidden;
}
.t-story-viewer__bar-fill {
    width: 0%;
    height: 100%;
    background: #FFFFFF;
    border-radius: 99px;
}
.t-story-viewer__bar.is-done .t-story-viewer__bar-fill { width: 100%; }

/* Author row */
.t-story-viewer__head {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 16px 12px;
    z-index: 2;
}
.t-story-viewer__avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-elevated);
    border: 2px solid rgba(255,255,255,0.18);
    flex-shrink: 0;
    aspect-ratio: 1/1;
}
.t-story-viewer__user {
    font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
    font-size: 0.92rem; font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
}
.t-story-viewer__time {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.66);
    margin-top: 2px;
}
.t-story-viewer__close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #FFFFFF;
    border: 0;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color var(--t-fast);
    -webkit-tap-highlight-color: transparent;
}
.t-story-viewer__close:hover { background: rgba(255,255,255,0.22); }

/* Media surface */
.t-story-viewer__media {
    flex: 1;
    min-height: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
    background: #000;
}
.t-story-viewer__media img,
.t-story-viewer__media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Invisible tap zones — left half = prev, right half = next.
   Sit on top of the media but below the header (which has z-index:2). */
.t-story-viewer__nav {
    position: absolute;
    left: 0; right: 0;
    top: calc(env(safe-area-inset-top, 0px) + 64px); /* below progress + head */
    bottom: 0;
    display: flex;
    z-index: 1;
}
.t-story-viewer__nav-zone {
    flex: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* RTL */
html[dir="rtl"] .t-eyebrow::before { background: linear-gradient(-90deg, var(--aurora-1), transparent); }
html[dir="rtl"] .t-bottom-nav__badge { right: auto; left: 14px; }
