@font-face {
    font-family: "Vazir";
    src: local("Vazir"), local("Vazir Regular"), url("../fonts/Vazir-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Vazir";
    src: local("Vazir Medium"), url("../fonts/Vazir-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Vazir";
    src: local("Vazir Bold"), url("../fonts/Vazir-Bold.woff2") format("woff2");
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}
:root {
    --world-bg: #343847;
    --panel: rgba(28, 31, 42, .76);
    --panel-strong: rgba(35, 39, 52, .92);
    --panel-border: rgba(255,255,255,.16);
    --text: #f8fafc;
    --muted: #c7cbd4;
    --accent: #d1ad68;
    --accent-2: #9eb7e5;
    --danger: #ff5d6c;
    --shadow: 0 18px 60px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
    background: var(--world-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}
html[lang="fa"] body,
html[lang="fa"] button,
html[lang="fa"] input,
html[lang="fa"] select,
html[lang="fa"] textarea {
    font-family: Vazir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}
button, input, select { font: inherit; }
button, select { color: inherit; }
button:disabled { opacity: .5; cursor: wait !important; }

#scene, #scene canvas, .label-layer { position: fixed; inset: 0; width: 100%; height: 100%; }
#scene canvas { display: block; touch-action:none; cursor:crosshair; }
.label-layer { pointer-events: none; overflow: hidden; }

.glass {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.topbar {
    position: fixed; z-index: 60; left: 20px; right: 20px; top: 16px;
    min-height: 66px; border-radius: 22px;
    display: grid; grid-template-columns: minmax(210px,.75fr) auto minmax(260px,.9fr);
    align-items: center; gap: 16px; padding: 10px 14px 10px 17px;
}
.brand { display:flex; align-items:center; gap:12px; min-width:0; }
.brand-mark {
    width:34px; height:34px; border-radius:11px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 48%, transparent);
    transform: rotate(10deg);
}
.brand strong { display:block; letter-spacing:.12em; font-size:14px; }
.brand small { color:var(--muted); font-size:11px; }

.market-switch { display:flex; padding:4px; border-radius:14px; background:rgba(255,255,255,.075); }
.market-switch button {
    min-width:72px; border:0; padding:9px 13px; border-radius:11px; background:transparent;
    cursor:pointer; color:var(--muted); transition:180ms ease;
}
.market-switch button:hover { color:var(--text); background:rgba(255,255,255,.05); }
.market-switch button.active {
    color:#fff; background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 78%,transparent),color-mix(in srgb,var(--accent-2) 58%,transparent));
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.15),0 7px 20px rgba(0,0,0,.18);
}

.search-shell { position:relative; justify-self:stretch; }
.search-shell input {
    width:100%; height:42px; border:1px solid rgba(255,255,255,.13); border-radius:13px; outline:none;
    color:var(--text); background:rgba(255,255,255,.075); padding-inline:40px 14px;
}
.search-shell input:focus { border-color:color-mix(in srgb,var(--accent) 68%,transparent); background:rgba(255,255,255,.095); }
.search-icon { position:absolute; z-index:2; inset-inline-start:14px; top:8px; color:var(--muted); font-size:21px; }
.search-results { position:absolute; inset-inline:0; top:49px; max-height:330px; overflow:auto; border-radius:15px; padding:7px; }
.search-result {
    width:100%; border:0; background:transparent; text-align:start; display:grid; grid-template-columns:1fr auto;
    gap:8px; padding:10px 11px; border-radius:10px; cursor:pointer;
}
.search-result:hover { background:rgba(255,255,255,.09); }
.search-result small { color:var(--muted); }
.search-empty { padding:14px; color:var(--muted); text-align:center; font-size:12px; }

.settings-dock {
    position:fixed; z-index:61; inset-inline-end:20px; top:96px; border-radius:18px; padding:9px;
    display:grid; gap:8px; width:min(318px,calc(100vw - 40px));
}
.language-switch { display:grid; grid-template-columns:repeat(6,1fr); gap:4px; }
.language-switch button {
    border:1px solid transparent; background:rgba(255,255,255,.055); border-radius:9px; cursor:pointer;
    padding:6px 4px; font-size:0; line-height:1; display:grid; place-items:center; min-height:38px;
}
.language-switch button:hover, .language-switch button.active { border-color:color-mix(in srgb,var(--accent) 60%,transparent); background:rgba(255,255,255,.12); }
.flag-icon { display:block; width:28px; height:20px; object-fit:cover; border-radius:4px; box-shadow:0 1px 5px rgba(0,0,0,.28); }
.theme-control { display:grid; grid-template-columns:auto 1fr; gap:8px; align-items:center; color:var(--muted); font-size:10px; }
.theme-control select {
    min-width:0; border:1px solid rgba(255,255,255,.11); border-radius:9px; background:rgba(255,255,255,.08);
    padding:7px 8px; outline:none; color:var(--text);
}
.theme-control option { color:#15171c; background:#f5f5f5; }
.sun-toggle {
    border:1px solid rgba(255,255,255,.11); border-radius:10px; background:rgba(255,205,85,.13); padding:7px 10px;
    display:flex; justify-content:center; gap:7px; cursor:pointer; font-size:11px;
}
.sun-toggle:hover { background:rgba(255,205,85,.2); }
.sun-toggle.off { filter:saturate(.3); opacity:.72; background:rgba(255,255,255,.04); }
.sun-icon { font-size:15px; }

.world-stats {
    position:fixed; z-index:61; inset-inline-start:20px; top:96px; display:flex; gap:1px; border-radius:16px; overflow:hidden;
}
.world-stats > div { min-width:92px; padding:9px 12px; background:rgba(255,255,255,.035); }
.world-stats span { display:block; font-weight:800; font-size:13px; }
.world-stats small { display:block; margin-top:2px; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }

.pause-flight {
    position: fixed;
    z-index: 27;
    inset-inline-end: 22px;
    top: 98px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
}
.pause-flight:hover { background: rgba(255,255,255,.16); }
.pause-flight[hidden] { display:none !important; }

.exit-explore-quick {
    position: fixed;
    z-index: 61;
    inset-inline-end: 72px;
    top: 98px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
    background: rgba(255,93,108,.18);
}
.exit-explore-quick:hover { background: rgba(255,93,108,.28); }
.exit-explore-quick[hidden] { display:none !important; }

.crosshair { position:fixed; z-index:10; left:50%; top:50%; width:28px; height:28px; transform:translate(-50%,-50%); pointer-events:none; }
.crosshair::before,.crosshair::after,.crosshair span::before,.crosshair span::after { content:""; position:absolute; background:rgba(255,255,255,.82); border-radius:2px; box-shadow:0 0 5px rgba(0,0,0,.3); }
.crosshair::before { width:6px; height:1px; left:0; top:13px; }.crosshair::after { width:6px; height:1px; right:0; top:13px; }
.crosshair span::before { width:1px; height:6px; top:0; left:13px; }.crosshair span::after { width:1px; height:6px; bottom:0; left:13px; }
.target-hint { position:fixed; z-index:14; left:50%; top:calc(50% + 30px); transform:translateX(-50%); border-radius:12px; padding:7px 10px; display:flex; gap:9px; align-items:center; pointer-events:none; }
.target-hint span { font-size:10px; color:var(--muted); }

.intro-layer {
    position:fixed; z-index:40; inset:0; display:grid; place-items:center;
    background:radial-gradient(circle at 50% 42%, transparent 0 16%, color-mix(in srgb,var(--world-bg) 42%,transparent) 54%, color-mix(in srgb,var(--world-bg) 88%,#000) 100%);
    transition:opacity .28s ease,visibility .28s ease;
}
.intro-layer.hidden { opacity:0; visibility:hidden; pointer-events:none; }
.intro-card { width:min(650px,calc(100vw - 36px)); border-radius:28px; padding:34px; }
.eyebrow { color:var(--accent); text-transform:uppercase; letter-spacing:.16em; font-size:11px; font-weight:800; }
.intro-card h1 { margin:10px 0; font-size:clamp(34px,6vw,67px); line-height:.96; letter-spacing:-.045em; }
.intro-card p { color:var(--muted); max-width:560px; line-height:1.72; }
.intro-market { display:flex; gap:7px; margin-top:17px; }
.intro-market button { border:1px solid rgba(255,255,255,.13); border-radius:11px; padding:8px 11px; background:rgba(255,255,255,.06); color:var(--muted); cursor:pointer; }
.intro-market button.active { color:#fff; border-color:color-mix(in srgb,var(--accent) 58%,transparent); background:color-mix(in srgb,var(--accent) 22%,transparent); }
.primary-button { margin-top:13px; border:0; border-radius:14px; padding:12px 18px; cursor:pointer; font-weight:800; background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; box-shadow:0 12px 34px color-mix(in srgb,var(--accent) 28%,transparent); }
.controls-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px 18px; margin-top:24px; color:var(--muted); font-size:11px; }
.controls-grid b,.helpbar b { font-weight:500; }
kbd { color:var(--text); background:rgba(255,255,255,.11); border:1px solid rgba(255,255,255,.12); border-radius:6px; padding:2px 5px; font:inherit; }

.detail-panel {
    position:fixed; z-index:68; inset-inline-end:20px; top:82px; bottom:28px;
    width:min(780px,calc(100vw - 40px)); border-radius:28px; padding:24px;
    overflow:auto; transform:translateX(calc(100% + 42px)); opacity:0;
    transition:.31s cubic-bezier(.2,.8,.2,1); background:var(--panel-strong);
    scrollbar-gutter:stable;
}
[dir="rtl"] .detail-panel { transform:translateX(calc(-100% - 42px)); }
.detail-panel.open { transform:translateX(0); opacity:1; }
.detail-actions { position:sticky; top:-8px; z-index:8; display:flex; align-items:center; justify-content:space-between; gap:8px; margin:-8px 0 10px; padding:8px 0; background:linear-gradient(to bottom,var(--panel-strong) 65%,transparent); backdrop-filter:blur(12px); }
.back-to-hall { border:1px solid color-mix(in srgb,var(--accent) 45%,rgba(255,255,255,.12)); border-radius:12px; padding:8px 11px; background:color-mix(in srgb,var(--accent) 14%,rgba(255,255,255,.05)); color:#fff; display:flex; align-items:center; gap:7px; cursor:pointer; }
.back-to-hall:hover { background:color-mix(in srgb,var(--accent) 24%,rgba(255,255,255,.08)); }
.back-to-hall b { font-size:11px; }
.icon-button { position:relative; flex:none; border:0; width:35px; height:35px; border-radius:11px; background:rgba(255,255,255,.09); cursor:pointer; font-size:22px; }
.detail-market { color:var(--accent); font-size:11px; font-weight:850; letter-spacing:.08em; }
.detail-panel h2 { direction:auto; font-size:clamp(34px,5vw,54px); line-height:1; margin:8px 0 4px; color:var(--accent); }
.detail-company { direction:auto; color:color-mix(in srgb,var(--accent) 72%,#fff); margin-bottom:16px; font-size:14px; }
.detail-hero { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0 0 18px; }
.hero-metric { position:relative; overflow:hidden; border:1px solid rgba(255,255,255,.10); border-radius:16px; padding:12px; background:linear-gradient(145deg,rgba(255,255,255,.065),rgba(255,255,255,.025)); min-width:0; }
.hero-metric::after { content:""; position:absolute; inset:auto -20% -55% 15%; height:90%; border-radius:50%; background:color-mix(in srgb,var(--accent) 20%,transparent); filter:blur(24px); pointer-events:none; }
.hero-metric span { position:relative; z-index:1; display:block; color:var(--muted); font-size:9px; line-height:1.35; }
.hero-metric strong { position:relative; z-index:1; display:block; margin-top:7px; direction:auto; font-size:13px; overflow-wrap:anywhere; color:var(--accent); }
.detail-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.detail-group { --section-accent:var(--accent); position:relative; overflow:hidden; border:1px solid rgba(255,255,255,.10); border-radius:19px; padding:14px; background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.018)); }
.detail-group::before { content:""; position:absolute; inset:0 0 auto 0; height:2px; background:linear-gradient(90deg,transparent,var(--section-accent),transparent); opacity:.9; }
.detail-group--1 { --section-accent:#8cc8ff; grid-column:1/-1; }
.detail-group--2 { --section-accent:#78d5c4; }
.detail-group--3 { --section-accent:#e7bf70; }
.detail-group--4 { --section-accent:#ff997a; grid-column:1/-1; }
.detail-group--5 { --section-accent:#b2a4ff; }
.detail-group--6 { --section-accent:#f188b8; }
.detail-group--7 { --section-accent:#80b7ff; }
.detail-group--8 { --section-accent:#f2d66f; }
.detail-group h3 { font-size:10px; letter-spacing:.08em; color:var(--section-accent); margin:0 0 10px; font-weight:900; }
.detail-group-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.detail-group--1 .detail-group-body { grid-template-columns:repeat(4,minmax(0,1fr)); }
.detail-group--4 .detail-group-body { grid-template-columns:repeat(3,minmax(0,1fr)); }
.detail-row { min-width:0; display:flex; flex-direction:column; justify-content:space-between; gap:5px; padding:9px 10px; border:1px solid rgba(255,255,255,.065); border-radius:12px; background:rgba(255,255,255,.028); }
.detail-row span { color:var(--muted); font-size:9.5px; line-height:1.45; }
.detail-row strong { direction:auto; text-align:start; font-size:11.5px; line-height:1.45; overflow-wrap:anywhere; color:var(--accent); font-weight:800; }
.detail-link { color:var(--accent); text-decoration:none; border-bottom:1px dashed color-mix(in srgb,var(--accent) 55%,transparent); }
.detail-link:hover { color:#fff; border-bottom-color:#fff; }
.sector-badge { display:inline-flex; align-items:center; gap:6px; color:var(--accent); }
.sector-badge i { width:9px; height:9px; border-radius:50%; box-shadow:0 0 9px currentColor; flex:none; }
.detail-loading { display:flex; align-items:center; gap:9px; color:var(--muted); padding:18px 0; }
.detail-error { color:#ffd6da; padding:14px 0; }

.flight-menu {
    position:fixed; z-index:46; left:50%; bottom:22px; transform:translateX(-50%);
    border-radius:18px; padding:7px; display:flex; gap:7px; align-items:center;
}
.flight-action { border:1px solid rgba(255,255,255,.12); border-radius:12px; padding:9px 12px; color:#fff; background:rgba(255,255,255,.07); display:flex; gap:7px; align-items:center; cursor:pointer; }
.flight-action:hover { background:rgba(255,255,255,.13); }
.flight-action b { font-size:11px; font-weight:700; }
.flight-action.primary-mini { background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 65%,transparent),color-mix(in srgb,var(--accent-2) 45%,transparent)); }

.mobile-flight-controls { position:fixed; z-index:28; inset:0; pointer-events:none; touch-action:none; }
.move-pad { position:absolute; pointer-events:auto; left:max(18px,env(safe-area-inset-left)); bottom:max(24px,env(safe-area-inset-bottom)); width:142px; height:142px; border-radius:50%; touch-action:none; }
.move-pad-ring { position:absolute; inset:10px; border-radius:50%; border:1px solid rgba(255,255,255,.26); background:radial-gradient(circle,rgba(255,255,255,.08),rgba(255,255,255,.025) 65%,rgba(255,255,255,.07)); box-shadow:inset 0 0 36px rgba(255,255,255,.05),0 10px 35px rgba(0,0,0,.25); backdrop-filter:blur(8px); }
.move-knob { position:absolute; left:50%; top:50%; margin:-26px 0 0 -26px; width:52px; height:52px; border-radius:50%; background:linear-gradient(145deg,var(--accent),var(--accent-2)); border:1px solid rgba(255,255,255,.42); box-shadow:0 8px 24px rgba(0,0,0,.28),0 0 24px color-mix(in srgb,var(--accent) 30%,transparent); transition:transform .04s linear; }
.mobile-flight-stack { position:absolute; pointer-events:auto; right:max(18px,env(safe-area-inset-right)); bottom:max(24px,env(safe-area-inset-bottom)); display:grid; gap:8px; }
.mobile-flight-button { width:62px; min-height:55px; border:1px solid rgba(255,255,255,.18); border-radius:16px; background:rgba(25,28,38,.63); color:#fff; box-shadow:0 10px 28px rgba(0,0,0,.22); backdrop-filter:blur(10px); touch-action:none; display:grid; place-items:center; padding:5px; }
.mobile-flight-button span { font-size:19px; line-height:1; }.mobile-flight-button small { font-size:8px; color:var(--muted); }.mobile-flight-button:active { transform:scale(.94); background:color-mix(in srgb,var(--accent) 30%,rgba(25,28,38,.72)); }
.mobile-flight-button.boost { border-color:color-mix(in srgb,var(--accent) 55%,transparent); }
.mobile-look-hint { position:absolute; pointer-events:none; left:50%; bottom:max(28px,env(safe-area-inset-bottom)); transform:translateX(-50%); border-radius:12px; padding:7px 10px; font-size:9px; color:var(--muted); white-space:nowrap; }

body[data-mode="lobby"] .crosshair, body[data-mode="detail"] .crosshair, body[data-mode="detail"] .target-hint { display:none; }
.loading {
    position:fixed; z-index:70; inset-inline-start:20px; bottom:56px; border-radius:13px; padding:9px 12px;
    display:flex; align-items:center; gap:9px; font-size:11px; pointer-events:none;
    width:max-content; max-width:min(72vw,560px); white-space:nowrap;
}
#loadingText { overflow:visible; text-overflow:clip; }
.spinner { width:16px; height:16px; border-radius:50%; border:2px solid rgba(255,255,255,.22); border-top-color:var(--accent); animation:spin .75s linear infinite; flex:none; }
@keyframes spin { to { transform:rotate(360deg); } }
.error-box { position:fixed; z-index:55; left:50%; top:50%; transform:translate(-50%,-50%); border-radius:16px; padding:12px 16px; color:#fff; background:color-mix(in srgb,var(--danger) 42%,var(--panel)); max-width:650px; }
.helpbar { position:fixed; z-index:15; left:50%; bottom:13px; transform:translateX(-50%); border-radius:13px; padding:7px 11px; display:flex; align-items:center; gap:14px; color:var(--muted); font-size:10px; white-space:nowrap; }

.year-label {
    transform:translate(-50%,-50%);
    color:rgba(255,255,255,.92);
    font-size:12px;
    font-weight:900;
    letter-spacing:.12em;
    text-shadow:0 1px 3px rgba(0,0,0,.6);
    border-radius:999px;
    padding:6px 10px;
    background:rgba(23,26,36,.58);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 10px 26px rgba(0,0,0,.2);
    opacity:0;
    transition:opacity .18s ease;
}
.sector-label { transform:translate(-50%,-50%); color:#fff; direction:auto; font-size:9px; white-space:nowrap; border-inline-start:3px solid var(--sector-color); padding:4px 7px; background:rgba(30,32,40,.45); border-radius:5px; }

@media (max-width:1100px) {
    .topbar { grid-template-columns:1fr auto; }
    .search-shell { grid-column:1/-1; }
    .settings-dock,.world-stats { top:145px; }
}
@media (max-width:760px) {
    .topbar { left:10px; right:10px; top:9px; }.brand small { display:none; }
    .pause-flight { inset-inline-end: 10px; top: 84px; }
    .exit-explore-quick { inset-inline-end: 58px; top: 84px; }
    .market-switch button { min-width:58px; padding-inline:8px; }
    .settings-dock { inset-inline-end:10px; width:235px; top:140px; }
    .world-stats { inset-inline-start:10px; top:140px; flex-direction:column; }.world-stats > div { min-width:76px; }
    .controls-grid { grid-template-columns:repeat(2,1fr); }.helpbar { display:none; }
    .detail-panel { inset-inline-end:8px; top:78px; bottom:8px; width:calc(100vw - 16px); padding:18px; border-radius:22px; }.detail-hero { grid-template-columns:repeat(2,minmax(0,1fr)); }.detail-sections { grid-template-columns:1fr; }.detail-group { grid-column:auto !important; }.detail-group-body,.detail-group--1 .detail-group-body,.detail-group--4 .detail-group-body { grid-template-columns:1fr; }
    .settings-dock { max-height:44vh; overflow:auto; }
    .mobile-look-hint { display:none; }
}

@media (pointer:coarse) {
    #scene canvas { cursor:default; }
    .pause-flight { top:auto; bottom:calc(182px + env(safe-area-inset-bottom)); inset-inline-end:18px; }
    .exit-explore-quick { top:auto; bottom:calc(182px + env(safe-area-inset-bottom)); inset-inline-end:70px; }
    .crosshair,.helpbar { display:none !important; }
    .target-hint { display:none !important; }
    .flight-menu { top:auto; bottom:182px; left:auto; right:18px; transform:none; }
    .flight-menu #resumeFlight { display:none !important; }
    .flight-action { padding:8px 10px; }
}

.offline-assets-warning {
    position: fixed;
    z-index: 9999;
    inset: 24px;
    margin: auto;
    width: min(680px, calc(100vw - 48px));
    height: max-content;
    padding: 20px 22px;
    border-radius: 18px;
    background: #201b20;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
    color: #fff;
    font-family: ui-sans-serif, system-ui, sans-serif;
}
.offline-assets-warning strong { display:block; margin-bottom:8px; font-size:17px; }
.offline-assets-warning span { color:#d8dbe3; }
.offline-assets-warning code { color:#ffd58a; }
.offline-assets-warning details { margin-top:14px; }
.offline-assets-warning pre { max-height:220px; overflow:auto; white-space:pre-wrap; color:#f2dede; font-size:11px; }

/* Lobby is a visual preview only. The WebGL scene must not receive mouse/touch
   input until Enter / Resume explicitly changes the state to explore. */
body[data-mode="lobby"] #scene,
body[data-mode="lobby"] #scene canvas,
body[data-mode="lobby"] .label-layer { pointer-events: none !important; }
body[data-mode="explore"] #scene,
body[data-mode="detail"] #scene { pointer-events: auto; }

.flag-fallback { display:grid; place-items:center; min-width:28px; height:20px; padding:0 4px; border-radius:4px; background:rgba(255,255,255,.12); font-size:9px; font-weight:800; letter-spacing:.03em; line-height:1; }

/* v0.10 real landing: lightweight first paint before any Three.js/world data. */
.landing-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    overflow: auto;
    background:
        radial-gradient(circle at 76% 38%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
        radial-gradient(circle at 18% 72%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 30%),
        linear-gradient(145deg, #222632 0%, #343847 52%, #252936 100%);
    color: var(--text);
    padding: 24px clamp(22px, 5vw, 76px) 38px;
}
.landing-page::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .24;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at center, #000 18%, transparent 78%);
}
.landing-header {
    position: relative;
    z-index: 3;
    max-width: 1480px;
    margin: 0 auto;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}
.landing-brand .brand-mark { width: 40px; height: 40px; }
.landing-language-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    background: rgba(18,21,30,.38);
    backdrop-filter: blur(14px);
}
.landing-language-switch button {
    width: 42px;
    height: 34px;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.landing-language-switch button:hover,
.landing-language-switch button.active {
    border-color: color-mix(in srgb, var(--accent) 62%, transparent);
    background: rgba(255,255,255,.09);
}
.landing-language-switch .flag-icon { width: 25px; height: 17px; }
.landing-main {
    position: relative;
    z-index: 2;
    max-width: 1480px;
    min-height: calc(100vh - 125px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    align-items: center;
    gap: clamp(32px, 7vw, 120px);
}
.landing-copy { max-width: 780px; padding: 58px 0 72px; }
.landing-copy h1 {
    margin: 14px 0 20px;
    max-width: 780px;
    font-size: clamp(48px, 7vw, 104px);
    line-height: .94;
    letter-spacing: -.055em;
}
[dir="rtl"] .landing-copy h1 { letter-spacing: -.025em; }
.landing-copy > p {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 1.5vw, 20px);
    line-height: 1.95;
}
.landing-stats {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    border-top: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.landing-stats article { padding: 18px 14px; border-inline-end: 1px solid rgba(255,255,255,.09); }
.landing-stats article:last-child { border-inline-end: 0; }
.landing-stats strong { display:block; font-size: clamp(22px,3vw,38px); font-weight:850; direction:ltr; unicode-bidi:isolate; }
.landing-stats small { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.landing-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:30px; }
.landing-enter,
.landing-reload {
    border: 0;
    border-radius: 15px;
    min-height: 50px;
    padding: 0 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    transition: transform .18s ease, filter .18s ease, background .18s ease;
}
.landing-enter {
    color: #fff;
    font-weight: 850;
    min-width: 182px;
    background: linear-gradient(135deg,var(--accent),var(--accent-2));
    box-shadow: 0 16px 42px color-mix(in srgb,var(--accent) 25%,transparent);
}
.landing-enter i { font-style:normal; font-size:21px; transition:transform .18s ease; }
[dir="rtl"] .landing-enter i { transform: rotate(180deg); }
.landing-enter:hover:not(:disabled) { transform: translateY(-2px); filter:brightness(1.08); }
.landing-reload {
    color: var(--text);
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.065);
}
.landing-reload:hover:not(:disabled) { background:rgba(255,255,255,.11); }
.landing-enter:disabled,.landing-reload:disabled { cursor:wait; opacity:.62; }
.landing-status { margin-top: 15px; color: color-mix(in srgb,var(--accent-2) 72%,#fff); font-size: 11px; min-height: 20px; }
.landing-status.error { color:#ff8c96; }
.landing-reload-help { display:block; max-width:640px; color:var(--muted); font-size:9px; line-height:1.7; margin-top:2px; }
.landing-visual {
    position: relative;
    width: min(42vw, 600px);
    aspect-ratio: 1;
    justify-self: end;
    display: grid;
    place-items: center;
}
.landing-core {
    position: relative;
    z-index: 3;
    width: 36%;
    aspect-ratio: 1;
    border-radius: 31% 69% 61% 39% / 42% 37% 63% 58%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, color-mix(in srgb,var(--accent) 88%,#fff), color-mix(in srgb,var(--accent-2) 70%,#111));
    box-shadow: 0 0 90px color-mix(in srgb,var(--accent) 32%,transparent), inset 0 0 0 1px rgba(255,255,255,.24);
    animation: landingFloat 7s ease-in-out infinite;
}
.landing-core::before,.landing-core::after {
    content:""; position:absolute; inset:-38%; border:1px solid rgba(255,255,255,.11); border-radius:50%; transform:rotate(18deg);
}
.landing-core::after { inset:-78%; border-color:color-mix(in srgb,var(--accent-2) 22%,transparent); transform:rotate(-26deg); }
.landing-core span { font-weight:900; font-size:clamp(24px,4vw,54px); letter-spacing:.08em; text-shadow:0 4px 18px rgba(0,0,0,.2); }
.landing-node { position:absolute; width:18px; height:18px; border-radius:6px; background:var(--accent); box-shadow:0 0 30px color-mix(in srgb,var(--accent) 52%,transparent); }
.node-a { top:17%; left:18%; transform:rotate(28deg); }
.node-b { right:10%; bottom:28%; width:13px; height:13px; background:var(--accent-2); }
.node-c { left:28%; bottom:9%; width:10px; height:10px; background:#fff; opacity:.7; }
.landing-orbit { position:fixed; pointer-events:none; border:1px solid rgba(255,255,255,.055); border-radius:50%; }
.landing-orbit-a { width:58vw; height:58vw; right:-23vw; top:-23vw; }
.landing-orbit-b { width:42vw; height:42vw; left:-20vw; bottom:-25vw; }
@keyframes landingFloat { 0%,100%{transform:translateY(0) rotate(-4deg)} 50%{transform:translateY(-18px) rotate(5deg)} }

@media (max-width: 900px) {
    .landing-main { grid-template-columns:1fr; min-height:auto; }
    .landing-copy { padding:70px 0 36px; }
    .landing-visual { width:min(78vw,460px); justify-self:center; margin-bottom:46px; }
    .landing-stats { grid-template-columns:repeat(2,1fr); }
    .landing-stats article:nth-child(2) { border-inline-end:0; }
    .landing-stats article:nth-child(-n+2) { border-bottom:1px solid rgba(255,255,255,.09); }
}
@media (max-width: 600px) {
    .landing-page { padding:18px 16px 28px; }
    .landing-header { align-items:flex-start; }
    .landing-brand small { display:none; }
    .landing-language-switch { max-width:58vw; overflow-x:auto; justify-content:flex-start; }
    .landing-language-switch button { flex:0 0 38px; width:38px; }
    .landing-copy { padding-top:54px; }
    .landing-copy h1 { font-size:clamp(42px,15vw,68px); }
    .landing-actions { align-items:stretch; }
    .landing-enter,.landing-reload { width:100%; }
}

/* v0.11 configurable landing cards, portable branding and interactive dense IPO blob. */
.brand-mark.brand-mark-image {
    overflow: hidden;
    padding: 0;
    transform: none;
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.brand-mark.brand-mark-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.landing-copy h1 { margin-bottom: 26px; }
.landing-stats {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.landing-stat-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.landing-stat-card > div { min-width: 0; grid-column: 2; }
.landing-stat-card > div:first-child:last-child { grid-column: 1 / -1; }
.landing-stat-card:only-child { max-width: 300px; }
.landing-stat-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
    flex: none;
}
.landing-stat-card strong {
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    font-variant-numeric: tabular-nums;
}
.landing-stat-card small { line-height: 1.45; }
.landing-status[hidden] { display: none !important; }
.landing-status { margin-top: 13px; }
.landing-visual {
    cursor: default;
    touch-action: none;
    isolation: isolate;
}
.landing-blob-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: block;
}
.landing-blob-label {
    position: relative;
    z-index: 4;
    pointer-events: none;
    font-weight: 950;
    font-size: clamp(24px,4vw,54px);
    letter-spacing: .08em;
    text-shadow: 0 4px 18px rgba(0,0,0,.28);
    user-select: none;
}
.landing-node { z-index: 5; pointer-events: none; }

@media (max-width: 900px) {
    .landing-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .landing-stats article:nth-child(2) { border-inline-end: 0; }
    .landing-stats article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.09); }
}
@media (max-width: 480px) {
    .landing-stats { grid-template-columns: 1fr; }
    .landing-stats article { border-inline-end: 0; border-bottom: 1px solid rgba(255,255,255,.09); }
    .landing-stats article:last-child { border-bottom: 0; }
}


/* v0.16 landing density: values never split; the grid drops to two/one columns instead. */
.landing-copy-no-eyebrow h1 { margin-top: 0; }
.landing-stats[data-columns] article { border-bottom: 0; }
.landing-stats[data-columns="1"] article { border-inline-end: 0; }
.landing-stats[data-columns="1"] article:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,.09); }
.landing-stats[data-columns="2"] article:nth-child(2n) { border-inline-end: 0; }
.landing-stats[data-columns="2"][data-rows="2"] article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.09); }
.landing-stats[data-columns="3"] article:last-child,
.landing-stats[data-columns="4"] article:last-child { border-inline-end: 0; }

/* v0.13 compact centered EXPO command bar. Settings are icon-first and open on demand. */
.sr-only {
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
}

.topbar {
    z-index: 90;
    left: 50%;
    right: auto;
    top: 18px;
    transform: translateX(-50%);
    width: min(980px, calc(100vw - 36px));
    min-height: 64px;
    border-radius: 21px;
    padding: 9px 11px 9px 15px;
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 14px;
    direction: ltr;
}
.topbar-brand {
    flex: 1 1 235px;
    max-width: 265px;
}
.topbar-brand .brand-mark { flex: none; }
.topbar .market-switch {
    flex: 0 0 auto;
    margin-inline-start: auto;
}
.topbar-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}
.topbar-control { position: relative; }
.topbar-icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255,255,255,.045);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.topbar-icon-button:hover,
.topbar-icon-button.active {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 52%, rgba(255,255,255,.14));
    background: color-mix(in srgb, var(--accent) 13%, rgba(255,255,255,.075));
}
.topbar-icon-button:active { transform: scale(.95); }
.topbar-icon-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.topbar-exit {
    margin-inline-start: 3px;
    color: #fff;
    background: rgba(255,93,108,.14);
    border-color: rgba(255,93,108,.16);
}
.topbar-exit:hover {
    background: rgba(255,93,108,.25);
    border-color: rgba(255,126,136,.35);
}

.appearance-toggle .appearance-icon-dark { display: none; }
.appearance-toggle.off .appearance-icon-light { display: none; }
.appearance-toggle.off .appearance-icon-dark { display: block; }
.appearance-toggle.off {
    filter: none;
    opacity: 1;
    background: rgba(126,157,221,.10);
}

.topbar-popover {
    position: absolute;
    z-index: 95;
    top: calc(100% + 11px);
    inset-inline-end: 0;
    min-width: 224px;
    padding: 8px;
    border-radius: 17px;
    background: var(--panel-strong);
    direction: ltr;
}
.topbar-popover-title {
    padding: 7px 9px 8px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .09em;
}
.theme-popover { width: 244px; }
.theme-menu-options { display: grid; gap: 4px; }
.theme-menu-item {
    width: 100%;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 7px 9px;
    background: transparent;
    color: var(--muted);
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    text-align: start;
    cursor: pointer;
}
.theme-menu-item:hover,
.theme-menu-item.active {
    color: var(--text);
    background: rgba(255,255,255,.075);
    border-color: rgba(255,255,255,.08);
}
.theme-menu-item i {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--theme-swatch);
    box-shadow: 0 0 12px color-mix(in srgb, var(--theme-swatch) 45%, transparent);
}
.theme-menu-item b {
    visibility: hidden;
    color: var(--accent-2);
    font-size: 12px;
}
.theme-menu-item.active b { visibility: visible; }

.language-popover {
    width: 268px;
    max-height: min(66vh, 520px);
    overflow: visible;
}
.language-menu-list {
    display: grid;
    gap: 4px;
    max-height: min(62vh, 480px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.language-menu-group { position: relative; }
.language-menu-item {
    width: 100%;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 7px 8px;
    background: transparent;
    color: var(--muted);
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 18px;
    align-items: center;
    gap: 8px;
    text-align: start;
    cursor: pointer;
}
.language-menu-item:hover,
.language-menu-item.active,
.language-group-trigger.active-group,
.language-group-trigger.submenu-open {
    color: var(--text);
    border-color: rgba(255,255,255,.08);
    background: color-mix(in srgb, var(--accent-2) 12%, rgba(255,255,255,.055));
}
.language-menu-flag {
    width: 30px;
    display: grid;
    place-items: center;
}
.language-menu-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.language-menu-chevron {
    font-size: 23px;
    line-height: 1;
    color: var(--muted);
    transform: translateY(-1px);
}
.language-selected-mark {
    visibility: hidden;
    color: var(--accent-2);
    font-weight: 800;
}
.language-menu-item.active .language-selected-mark { visibility: visible; }
.language-submenu {
    position: absolute;
    z-index: 98;
    top: 0;
    right: calc(100% + 9px);
    width: 268px;
    max-height: min(62vh, 480px);
    overflow-y: auto;
    padding: 8px;
    border-radius: 17px;
    background: var(--panel-strong);
}

.search-shell {
    position: absolute;
    z-index: 96;
    top: calc(100% + 11px);
    right: 0;
    width: min(330px, calc(100vw - 30px));
    padding: 7px;
    border-radius: 15px;
    background: var(--panel-strong);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.search-shell.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.search-shell input {
    width: 100%;
    height: 42px;
    padding-inline: 40px 12px;
    border-radius: 11px;
    background: rgba(255,255,255,.065);
}
.search-shell .search-icon {
    inset-inline-start: 16px;
    top: 17px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    line-height: 0;
}
.search-shell .search-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.search-shell .search-results {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 7px);
    max-height: 330px;
    padding: 7px;
    border-radius: 15px;
    background: var(--panel-strong);
}

/* Pointer release is resumed by clicking the world itself; the old Resume Flight control is intentionally gone. */
.flight-menu,
#resumeFlight,
.pause-flight,
.settings-dock { display: none !important; }

@media (max-width: 980px) {
    .topbar {
        width: min(860px, calc(100vw - 24px));
        gap: 9px;
        padding-inline: 10px;
    }
    .topbar-brand { flex-basis: 185px; max-width: 205px; }
    .topbar-brand small { display: none; }
    .market-switch button { min-width: 62px; padding-inline: 9px; }
    .topbar-icon-button { width: 38px; height: 38px; }
}

@media (max-width: 760px) {
    .topbar {
        left: 50%;
        right: auto;
        top: 8px;
        width: calc(100vw - 16px);
        min-height: 54px;
        border-radius: 18px;
        padding: 6px 7px;
        gap: 6px;
        transform: translateX(-50%);
    }
    .topbar-brand { flex: 0 0 auto; max-width: none; }
    .topbar-brand > div { display: none; }
    .topbar-brand .brand-mark { width: 34px; height: 34px; }
    .topbar .market-switch { margin-inline-start: 0; }
    .market-switch button { min-width: 48px; padding: 7px 6px; font-size: 10px; }
    .topbar-actions { gap: 2px; margin-inline-start: auto; }
    .topbar-icon-button { width: 35px; height: 35px; border-radius: 10px; }
    .topbar-icon-button svg { width: 19px; height: 19px; }
    .world-stats { top: 76px; inset-inline-start: 8px; }
    .world-stats > div { min-width: 72px; padding: 7px 9px; }
    .language-popover,
    .theme-popover { top: calc(100% + 8px); }
    .language-submenu {
        position: static;
        width: 100%;
        max-height: 250px;
        margin-top: 5px;
        padding: 5px;
        box-shadow: none;
        background: rgba(255,255,255,.035);
    }
}

@media (max-width: 470px) {
    .topbar { gap: 3px; }
    .topbar-brand { display: none; }
    .market-switch button { min-width: 44px; font-size: 9px; }
    .topbar-icon-button { width: 33px; height: 33px; }
    .language-popover { width: min(268px, calc(100vw - 24px)); right: -78px; }
    .theme-popover { right: -40px; }
    .search-shell { right: -43px; }
}

/* Keep the centered bar independent from document direction and let nested language menus escape scrolling panels. */
.topbar {
    left: 0;
    right: 0;
    margin-inline: auto;
    transform: none;
}
.language-menu-list {
    max-height: min(62vh, 480px);
    overflow-y: auto;
    overflow-x: hidden;
}
.language-submenu {
    position: fixed;
    right: auto;
    bottom: auto;
}
@media (max-width: 760px) {
    .topbar {
        left: 0;
        right: 0;
        margin-inline: auto;
        transform: none;
    }
    .language-submenu {
        position: static !important;
        left: auto !important;
        top: auto !important;
    }
}
@media (max-width: 1100px) and (min-width: 761px) {
    .world-stats { top: 94px; }
}


/* v0.14 direction-aware topbar + compact language labels. */
html[dir="rtl"] .topbar { direction: rtl; }
html[dir="ltr"] .topbar { direction: ltr; }
html[dir="rtl"] .topbar-brand { direction: rtl; text-align: right; }
html[dir="ltr"] .topbar-brand { direction: ltr; text-align: left; }
html[dir="rtl"] .topbar-actions { direction: rtl; }
html[dir="ltr"] .topbar-actions { direction: ltr; }

/* Language rows follow the active UI direction as a complete unit.
   LTR: flag -> label -> trailing state. RTL: flag on the right -> label -> trailing state on the left. */
html[dir="ltr"] .language-menu-item {
    direction: ltr;
    grid-template-columns: 34px minmax(0,1fr) 18px;
    text-align: left;
}
html[dir="rtl"] .language-menu-item {
    direction: rtl;
    grid-template-columns: 18px minmax(0,1fr) 34px;
    text-align: right;
}
.language-menu-name {
    direction: inherit;
    unicode-bidi: isolate;
    justify-self: stretch;
}
html[dir="ltr"] .language-menu-name {
    grid-column: 2;
    text-align: left;
}
html[dir="rtl"] .language-menu-name {
    grid-column: 2;
    text-align: right;
}
html[dir="ltr"] .language-menu-flag {
    grid-column: 1;
    justify-self: start;
}
html[dir="rtl"] .language-menu-flag {
    grid-column: 3;
    justify-self: end;
}
html[dir="ltr"] .language-menu-chevron,
html[dir="ltr"] .language-selected-mark {
    grid-column: 3;
    justify-self: end;
}
html[dir="rtl"] .language-menu-chevron,
html[dir="rtl"] .language-selected-mark {
    grid-column: 1;
    justify-self: start;
}
html[dir="rtl"] .language-menu-chevron {
    transform: translateY(-1px) scaleX(-1);
}

/* The old detached HUD duplicated information from the command bar and world itself. */
.world-stats { display: none !important; }

@media (max-width: 760px) {
    html[dir="rtl"] .topbar-actions { margin-inline-start: 0; margin-inline-end: auto; }
    html[dir="ltr"] .topbar-actions { margin-inline-start: auto; margin-inline-end: 0; }
}

/* v0.14.1: complete RTL/LTR language-row mirroring. */

/* v0.14.2: robust language rows and hierarchical landing languages. */
.language-menu-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    direction: inherit !important;
    text-align: start !important;
    grid-template-columns: none !important;
}
.language-menu-flag {
    flex: 0 0 30px;
    width: 30px;
    display: grid;
    place-items: center;
    grid-column: auto !important;
    justify-self: auto !important;
}
.language-menu-name {
    flex: 1 1 auto;
    min-width: 0;
    grid-column: auto !important;
    justify-self: auto !important;
    text-align: start !important;
    direction: inherit;
    unicode-bidi: plaintext;
}
.language-menu-chevron,
.language-selected-mark {
    flex: 0 0 18px;
    width: 18px;
    margin: 0;
    grid-column: auto !important;
    justify-self: auto !important;
    text-align: center;
}
html[dir="rtl"] .language-menu-chevron {
    transform: translateY(-1px) scaleX(-1);
}

/* Landing: root languages stay in the compact switch; child languages live under their parent. */
.landing-language-group-trigger { position: relative; }
.landing-language-caret {
    position: absolute;
    inset-inline-end: 2px;
    bottom: 0;
    font-size: 10px;
    line-height: 1;
    color: rgba(255,255,255,.72);
    pointer-events: none;
}
.landing-language-group-trigger.active-group,
.landing-language-group-trigger.submenu-open {
    border-color: color-mix(in srgb, var(--accent) 62%, transparent);
    background: rgba(255,255,255,.09);
}
.landing-language-submenu {
    position: fixed;
    z-index: 120;
    width: min(250px, calc(100vw - 20px));
    max-height: min(58vh, 430px);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 15px;
    background: rgba(22,28,42,.94);
    box-shadow: 0 18px 46px rgba(7,10,18,.3);
    backdrop-filter: blur(18px) saturate(125%);
    scrollbar-width: thin;
}
.landing-language-option {
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,.78);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    direction: inherit;
    text-align: start;
    cursor: pointer;
}
.landing-language-option:hover,
.landing-language-option.active {
    color: #fff;
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.08);
}
.landing-language-option-flag {
    flex: 0 0 30px;
    width: 30px;
    display: grid;
    place-items: center;
}
.landing-language-option-flag .flag-icon {
    width: 25px;
    height: 17px;
}
.landing-language-option-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
    direction: inherit;
    unicode-bidi: plaintext;
    font-size: 12px;
}
.landing-language-option-mark {
    flex: 0 0 18px;
    width: 18px;
    visibility: hidden;
    color: var(--accent-2);
    text-align: center;
    font-weight: 800;
}
.landing-language-option.active .landing-language-option-mark { visibility: visible; }


/* v0.15.0: the language picker follows the selected UI direction as one layout.
   In RTL the visual order is: flag at the right, localized label immediately after
   it toward the left, then the state/submenu indicator at the far left. */
html[dir="rtl"] .language-popover,
html[dir="rtl"] .language-submenu {
    direction: rtl !important;
}
html[dir="ltr"] .language-popover,
html[dir="ltr"] .language-submenu {
    direction: ltr !important;
}
.language-menu-item {
    direction: inherit !important;
    justify-content: flex-start;
}
.language-menu-name {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: calc(100% - 66px);
    text-align: start !important;
    direction: inherit !important;
    unicode-bidi: plaintext;
}
.language-menu-chevron,
.language-selected-mark {
    margin-inline-start: auto !important;
}
html[dir="rtl"] .language-menu-chevron {
    transform: translateY(-1px) scaleX(-1);
}

/* The landing hierarchy uses the same directional contract. */
html[dir="rtl"] .landing-language-submenu { direction: rtl; }
html[dir="ltr"] .landing-language-submenu { direction: ltr; }
.landing-language-option-name {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: calc(100% - 66px);
    direction: inherit !important;
    text-align: start !important;
    unicode-bidi: plaintext;
}
.landing-language-option-mark {
    margin-inline-start: auto;
}

/* Match the intended RTL group trigger: submenu chevron stays at the outer
   right edge, then flag, then localized label. Leaf rows remain flag -> label
   from the RTL start edge, with their selection mark at the opposite edge. */
html[dir="rtl"] .language-group-trigger .language-menu-chevron {
    order: -1;
    margin-inline: 0 !important;
}
html[dir="rtl"] .language-group-trigger .language-menu-flag { order: 0; }
html[dir="rtl"] .language-group-trigger .language-menu-name { order: 1; }
html[dir="ltr"] .language-group-trigger .language-menu-chevron {
    order: initial;
    margin-inline-start: auto !important;
}


/* v0.15.1: submenu panels are portaled to <body> so glass/backdrop-filter
   ancestors cannot redefine the coordinate system. Placement itself is
   calculated in app.js and mirrored for RTL/LTR. */
.language-submenu.language-submenu-portal {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 140;
    max-width: calc(100vw - 20px);
    max-height: min(62vh, 480px);
    overflow-y: auto;
}
@media (max-width: 760px) {
    .language-submenu.language-submenu-portal {
        position: fixed !important;
        right: auto !important;
        margin: 0 !important;
        max-height: min(46vh, 330px);
        padding: 8px;
        box-shadow: 0 18px 46px rgba(7,10,18,.3);
        background: var(--panel-strong);
    }
}

/* v0.16.1 landing stats: center value/title while preserving the active UI direction. */
.landing-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    direction: inherit;
}
.landing-stat-card > div {
    width: 100%;
    min-width: 0;
    grid-column: auto;
    text-align: center;
    direction: inherit;
}
.landing-stat-card:has(.landing-stat-icon) > div {
    padding-inline: 36px;
}
.landing-stat-card .landing-stat-icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
}
.landing-stat-card strong,
.landing-stat-card small {
    width: 100%;
    text-align: center;
    direction: inherit;
    unicode-bidi: isolate;
}

/* v0.18.0: centered Upcoming offering cards with local-calendar schedule and live progress. */
.landing-upcoming {
    position: relative;
    z-index: 3;
    max-width: 1480px;
    margin: 18px auto 0;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.105);
    border-radius: 18px;
    background: rgba(18,21,30,.34);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 42px rgba(6,8,14,.14);
}
.landing-upcoming-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
.landing-upcoming-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px color-mix(in srgb,var(--accent) 12%,transparent);
    flex: 0 0 auto;
}
.landing-upcoming-rail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    overflow: visible;
}
.landing-upcoming-card {
    position: relative;
    isolation: isolate;
    direction: inherit;
    display: grid;
    grid-template-columns: 74px minmax(0,1fr) minmax(190px,.72fr);
    align-items: center;
    gap: 18px;
    flex: 1 1 560px;
    width: min(100%, 720px);
    max-width: 720px;
    min-height: 148px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 17px;
    background: rgba(255,255,255,.045);
    overflow: hidden;
    transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.landing-upcoming-card.is-live {
    border-color: rgba(91,214,101,.30);
    box-shadow: inset 0 0 0 1px rgba(91,214,101,.035);
}
.landing-upcoming-card.is-finished { border-color: rgba(255,255,255,.07); }
.landing-upcoming-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -38px;
    top: -62px;
    width: 145px;
    height: 145px;
    border: 1px solid color-mix(in srgb,var(--accent-2) 14%,transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.landing-upcoming-progress {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.landing-upcoming-progress[hidden] { display: none !important; }
.landing-upcoming-progress > span {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(67,188,80,.12), rgba(67,188,80,.22));
    border-inline-end: 1px solid rgba(99,224,110,.42);
    transition: width .9s linear;
}
html[dir="rtl"] .landing-upcoming-progress > span {
    background: linear-gradient(270deg, rgba(67,188,80,.12), rgba(67,188,80,.22));
}
.landing-upcoming-shape {
    position: relative;
    z-index: 2;
    width: 70px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 28%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    overflow: hidden;
}
.landing-upcoming-shape img {
    width: 84%;
    height: 84%;
    display: block;
    object-fit: contain;
    object-position: center;
}
.landing-upcoming-content {
    position: relative;
    z-index: 2;
    min-width: 0;
    align-self: center;
}
.landing-upcoming-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.landing-upcoming-segment,
.landing-upcoming-market {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 850;
    white-space: nowrap;
}
.landing-upcoming-segment {
    color: color-mix(in srgb,var(--accent) 78%,#fff);
    background: color-mix(in srgb,var(--accent) 12%,transparent);
}
.landing-upcoming-market { color: var(--muted); background: rgba(255,255,255,.06); }
.landing-upcoming-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(21px,1.75vw,29px);
    font-weight: 900;
    line-height: 1.3;
}
.landing-upcoming-company {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
    color: var(--muted);
    font-size: clamp(11px,.9vw,14px);
    line-height: 1.55;
}
.landing-upcoming-dates {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 11px;
    color: var(--muted);
    font-size: clamp(10px,.8vw,13px);
    line-height: 1.5;
}
.landing-upcoming-dates span { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.landing-upcoming-dates b { color: var(--text); font-weight: 800; }
.landing-upcoming-dates time { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.landing-upcoming-timing {
    position: relative;
    z-index: 2;
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 9px;
    text-align: center;
}
.landing-upcoming-hero-date {
    display: block;
    max-width: 100%;
    color: var(--text);
    font-size: clamp(25px,2.05vw,34px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: .012em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}
.landing-upcoming-hero-date[hidden] { display: none !important; }
.landing-upcoming-countdown {
    color: var(--text);
    font-size: clamp(12px,1vw,16px);
    line-height: 1.5;
    font-weight: 850;
    white-space: nowrap;
    unicode-bidi: isolate;
}
.landing-upcoming-card.is-live .landing-upcoming-countdown { color: #75e57e; }
.landing-upcoming-card.is-finished .landing-upcoming-countdown { color: var(--muted); }
.landing-upcoming[hidden] { display: none !important; }
.landing-upcoming-card:only-child { flex-grow: 0; width: min(100%, 760px); max-width: 760px; }

@media (max-width: 760px) {
    .landing-upcoming { margin-top: 12px; padding: 9px; border-radius: 15px; }
    .landing-upcoming-card,
    .landing-upcoming-card:only-child {
        width: 100%;
        max-width: none;
        grid-template-columns: 58px minmax(0,1fr);
        gap: 12px;
        padding: 14px;
        min-height: 0;
    }
    .landing-upcoming-shape { width: 56px; }
    .landing-upcoming-timing {
        grid-column: 1 / -1;
        border-top: 1px solid rgba(255,255,255,.07);
        padding-top: 11px;
    }
    .landing-upcoming-hero-date { font-size: 24px; }
    .landing-upcoming-countdown { white-space: normal; }
    .landing-upcoming-dates { gap: 10px; }
}


/* v0.19: Landing appearance toggle + explicit Upcoming lifecycle states. */
.landing-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.landing-theme-toggle {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    color: var(--text);
    background: rgba(18,21,30,.38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.landing-theme-toggle:hover { transform: translateY(-1px); border-color: color-mix(in srgb,var(--accent) 55%,transparent); background: rgba(255,255,255,.08); }
.landing-theme-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-landing-theme="dark"] .landing-theme-icon-dark { display: none; }
html[data-landing-theme="light"] .landing-theme-icon-light { display: none; }

.landing-upcoming-status {
    max-width: 100%;
    color: var(--text);
    font-size: clamp(14px,1.08vw,18px);
    line-height: 1.45;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    unicode-bidi: isolate;
}
.landing-upcoming-secondary-status {
    max-width: 100%;
    margin-top: -2px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: clamp(11px,.86vw,14px);
    line-height: 1.35;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}
.landing-upcoming-secondary-status[hidden] { display: none !important; }
.landing-upcoming-secondary-status.is-allocation {
    color: #ffb34d;
    background: rgba(238,139,32,.12);
    border: 1px solid rgba(255,166,64,.22);
}
.landing-upcoming-secondary-status.is-concluded {
    color: color-mix(in srgb,var(--accent) 80%,#fff);
    background: color-mix(in srgb,var(--accent) 10%,transparent);
    border: 1px solid color-mix(in srgb,var(--accent) 22%,transparent);
}
.landing-upcoming-countdown[hidden] { display: none !important; }
.landing-upcoming-card.is-paused .landing-upcoming-status { color: color-mix(in srgb,var(--accent-2) 74%,var(--text)); }
.landing-upcoming-card.is-waiting-allocation { border-color: rgba(255,166,64,.28); }

/* Landing light mode is intentionally scoped to the landing layer. The 3D EXPO
   keeps its own existing appearance system and receives the preference through ipoExpoSun. */
html[data-landing-theme="light"] .landing-page {
    --text: #202838;
    --muted: #687386;
    --panel: rgba(255,255,255,.76);
    --panel-strong: rgba(255,255,255,.94);
    --panel-border: rgba(31,41,55,.13);
    color-scheme: light;
    background:
        radial-gradient(circle at 76% 38%, color-mix(in srgb,var(--accent) 16%,transparent), transparent 30%),
        radial-gradient(circle at 18% 72%, color-mix(in srgb,var(--accent-2) 18%,transparent), transparent 32%),
        linear-gradient(145deg,#f4f6fa 0%,#e8edf5 52%,#f8fafc 100%);
}
html[data-landing-theme="light"] .landing-page::after {
    opacity: .42;
    background-image: linear-gradient(rgba(42,51,68,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(42,51,68,.04) 1px,transparent 1px);
}
html[data-landing-theme="light"] .landing-language-switch,
html[data-landing-theme="light"] .landing-theme-toggle {
    border-color: rgba(37,45,61,.13);
    background: rgba(255,255,255,.72);
    box-shadow: 0 10px 30px rgba(73,86,108,.09);
}
html[data-landing-theme="light"] .landing-language-switch button:hover,
html[data-landing-theme="light"] .landing-language-switch button.active,
html[data-landing-theme="light"] .landing-language-group-trigger.active-group,
html[data-landing-theme="light"] .landing-language-group-trigger.submenu-open {
    background: rgba(42,51,68,.07);
}
html[data-landing-theme="light"] .landing-language-submenu {
    color: var(--text);
    border-color: rgba(37,45,61,.13);
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 48px rgba(57,68,88,.16);
}
html[data-landing-theme="light"] .landing-language-option:hover,
html[data-landing-theme="light"] .landing-language-option.active { background: rgba(42,51,68,.07); }
html[data-landing-theme="light"] .landing-upcoming {
    border-color: rgba(37,45,61,.12);
    background: rgba(255,255,255,.52);
    box-shadow: 0 16px 42px rgba(67,79,101,.09);
}
html[data-landing-theme="light"] .landing-upcoming-card {
    border-color: rgba(37,45,61,.11);
    background: rgba(255,255,255,.62);
    box-shadow: 0 10px 26px rgba(73,86,108,.06);
}
html[data-landing-theme="light"] .landing-upcoming-market { background: rgba(37,45,61,.06); }
html[data-landing-theme="light"] .landing-upcoming-shape { background: rgba(255,255,255,.7); border-color: rgba(37,45,61,.11); }
html[data-landing-theme="light"] .landing-upcoming-card::after { border-color: color-mix(in srgb,var(--accent-2) 24%,transparent); }
html[data-landing-theme="light"] .landing-stats { border-color: rgba(37,45,61,.13); }
html[data-landing-theme="light"] .landing-stats article { border-color: rgba(37,45,61,.10); }
html[data-landing-theme="light"] .landing-reload { border-color: rgba(37,45,61,.14); background: rgba(255,255,255,.62); }
html[data-landing-theme="light"] .landing-reload:hover:not(:disabled) { background: rgba(255,255,255,.9); }
html[data-landing-theme="light"] .landing-orbit { border-color: rgba(50,60,80,.07); }
html[data-landing-theme="light"] .landing-core::before,
html[data-landing-theme="light"] .landing-core::after { border-color: rgba(50,60,80,.10); }
html[data-landing-theme="light"] .landing-status { color: color-mix(in srgb,var(--accent-2) 75%,#283245); }

@media (max-width: 600px) {
    .landing-header-tools { max-width: 72vw; }
    .landing-theme-toggle { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
    .landing-upcoming-status,
    .landing-upcoming-secondary-status { white-space: normal; }
}

/* v0.20: Upcoming identity alignment, status surfaces, detail popover, and portal layering. */
.landing-upcoming-content,
.landing-upcoming-name,
.landing-upcoming-company,
.landing-upcoming-meta,
.landing-upcoming-dates {
    direction: inherit;
    text-align: start;
}
.landing-upcoming-meta,
.landing-upcoming-dates { justify-content: flex-start; }
.landing-upcoming-name,
.landing-upcoming-company {
    unicode-bidi: plaintext;
}

/* Status colors occupy the whole card after the live offering stage. */
.landing-upcoming-card.is-waiting-allocation {
    border-color: rgba(255,166,64,.34);
    background: linear-gradient(90deg, rgba(214,126,33,.18), rgba(255,166,64,.10));
    box-shadow: inset 0 0 0 1px rgba(255,166,64,.035), 0 10px 28px rgba(117,67,17,.08);
}
html[dir="rtl"] .landing-upcoming-card.is-waiting-allocation {
    background: linear-gradient(270deg, rgba(214,126,33,.18), rgba(255,166,64,.10));
}
.landing-upcoming-card.is-concluded {
    border-color: rgba(81,150,255,.34);
    background: linear-gradient(90deg, rgba(47,104,198,.20), rgba(89,151,255,.10));
    box-shadow: inset 0 0 0 1px rgba(81,150,255,.04), 0 10px 28px rgba(29,63,122,.09);
}
html[dir="rtl"] .landing-upcoming-card.is-concluded {
    background: linear-gradient(270deg, rgba(47,104,198,.20), rgba(89,151,255,.10));
}
.landing-upcoming-card.is-concluded .landing-upcoming-status,
.landing-upcoming-card.is-concluded .landing-upcoming-secondary-status { color: #9bc2ff; }
.landing-upcoming-card.is-waiting-allocation .landing-upcoming-status,
.landing-upcoming-card.is-waiting-allocation .landing-upcoming-secondary-status { color: #ffbd68; }

.landing-upcoming-info-button {
    position: absolute;
    z-index: 5;
    inset-block-end: 10px;
    inset-inline-end: 10px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(17,21,31,.28);
    cursor: pointer;
    transition: transform .16s ease, color .16s ease, background .16s ease, border-color .16s ease;
}
.landing-upcoming-info-button:hover {
    transform: translateY(-1px);
    color: var(--text);
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.22);
}
.landing-upcoming-info-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.landing-upcoming-details-popover {
    position: fixed;
    z-index: 2300;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    color: var(--text);
    background: rgba(22,27,39,.975);
    box-shadow: 0 22px 62px rgba(5,8,15,.38);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    direction: inherit;
}
.landing-upcoming-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 9px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.landing-upcoming-details-header strong {
    font-size: 13px;
    font-weight: 900;
}
.landing-upcoming-details-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.landing-upcoming-details-close:hover { color: var(--text); background: rgba(255,255,255,.07); }
.landing-upcoming-details-body { display: grid; gap: 0; }
.landing-upcoming-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, .9fr);
    align-items: center;
    gap: 16px;
    min-height: 44px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255,255,255,.065);
}
.landing-upcoming-detail-row:last-child { border-bottom: 0; }
.landing-upcoming-detail-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-align: start;
}
.landing-upcoming-detail-value {
    min-width: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
    text-align: end;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
.landing-upcoming-detail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb,var(--accent) 30%,transparent);
    border-radius: 9px;
    color: color-mix(in srgb,var(--accent) 82%,#fff);
    background: color-mix(in srgb,var(--accent) 10%,transparent);
    text-decoration: none;
    white-space: nowrap;
}
.landing-upcoming-detail-action:hover { background: color-mix(in srgb,var(--accent) 16%,transparent); }

/* Portaling the landing submenu to body keeps it above a populated Upcoming board. */
.landing-language-submenu.landing-language-submenu-portal {
    z-index: 2400 !important;
    margin: 0 !important;
}

html[data-landing-theme="light"] .landing-upcoming-card.is-waiting-allocation {
    border-color: rgba(194,111,27,.26);
    background: linear-gradient(90deg, rgba(255,183,92,.20), rgba(255,224,184,.42));
}
html[data-landing-theme="light"][dir="rtl"] .landing-upcoming-card.is-waiting-allocation {
    background: linear-gradient(270deg, rgba(255,183,92,.20), rgba(255,224,184,.42));
}
html[data-landing-theme="light"] .landing-upcoming-card.is-concluded {
    border-color: rgba(54,113,205,.25);
    background: linear-gradient(90deg, rgba(104,158,239,.20), rgba(204,224,255,.46));
}
html[data-landing-theme="light"][dir="rtl"] .landing-upcoming-card.is-concluded {
    background: linear-gradient(270deg, rgba(104,158,239,.20), rgba(204,224,255,.46));
}
html[data-landing-theme="light"] .landing-upcoming-info-button {
    color: #596579;
    border-color: rgba(37,45,61,.13);
    background: rgba(255,255,255,.58);
}
html[data-landing-theme="light"] .landing-upcoming-details-popover {
    color: var(--text);
    border-color: rgba(37,45,61,.14);
    background: rgba(255,255,255,.985);
    box-shadow: 0 22px 58px rgba(57,68,88,.20);
}
html[data-landing-theme="light"] .landing-upcoming-details-header,
html[data-landing-theme="light"] .landing-upcoming-detail-row { border-color: rgba(37,45,61,.10); }
html[data-landing-theme="light"] .landing-upcoming-details-close:hover { background: rgba(37,45,61,.06); }

@media (max-width: 760px) {
    .landing-upcoming-detail-row { grid-template-columns: 1fr; gap: 4px; }
    .landing-upcoming-detail-value { text-align: start; }
    .landing-upcoming-info-button { inset-block-end: 9px; inset-inline-end: 9px; }
}


/* v0.21: light-mode contrast, bidi-correct identity, and over-card detail glass. */
.landing-upcoming-name,
.landing-upcoming-company {
    unicode-bidi: isolate;
    direction: inherit;
    text-align: start;
}

/* The symbol is Persian text in many records, but in an LTR interface it still
   belongs to the LTR identity block next to the company logo. */
html[dir="ltr"] .landing-upcoming-name,
html[dir="ltr"] .landing-upcoming-company {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}
html[dir="rtl"] .landing-upcoming-name,
html[dir="rtl"] .landing-upcoming-company {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: right;
}

.landing-upcoming-details-popover {
    background: rgba(18, 23, 34, .82);
    border-color: rgba(255,255,255,.18);
    box-shadow: 0 22px 70px rgba(4,8,18,.42), 0 0 0 1px rgba(255,255,255,.035) inset;
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
}

html[data-landing-theme="light"] .landing-page .landing-upcoming-name,
html[data-landing-theme="light"] .landing-page .landing-upcoming-company,
html[data-landing-theme="light"] .landing-page .landing-upcoming-dates,
html[data-landing-theme="light"] .landing-page .landing-upcoming-dates b,
html[data-landing-theme="light"] .landing-page .landing-upcoming-status,
html[data-landing-theme="light"] .landing-page .landing-upcoming-countdown,
html[data-landing-theme="light"] .landing-page .landing-upcoming-hero-date {
    color: #202838;
}
html[data-landing-theme="light"] .landing-page .landing-upcoming-company,
html[data-landing-theme="light"] .landing-page .landing-upcoming-dates,
html[data-landing-theme="light"] .landing-page .landing-upcoming-market,
html[data-landing-theme="light"] .landing-page .landing-upcoming-heading {
    color: #5b6678;
}
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-live .landing-upcoming-countdown,
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-live .landing-upcoming-status {
    color: #23773a;
}
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-concluded .landing-upcoming-status,
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-concluded .landing-upcoming-secondary-status {
    color: #245ca8;
}
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-waiting-allocation .landing-upcoming-status,
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-waiting-allocation .landing-upcoming-secondary-status {
    color: #9a550c;
}

/* Portaled language submenus live under body, outside .landing-page, so they need
   explicit light-theme ink instead of inheriting the dark EXPO --text token. */
html[data-landing-theme="light"] .landing-language-submenu,
html[data-landing-theme="light"] .landing-language-submenu .landing-language-option,
html[data-landing-theme="light"] .landing-language-submenu .landing-language-option-name,
html[data-landing-theme="light"] .landing-language-submenu .landing-language-option-mark {
    color: #202838;
}
html[data-landing-theme="light"] .landing-language-submenu .landing-language-option:hover,
html[data-landing-theme="light"] .landing-language-submenu .landing-language-option.active {
    color: #151c28;
    background: rgba(42,51,68,.075);
}

/* The detail popover is also portaled to body. Give it explicit light-mode
   colors and a translucent soft-glass surface. */
html[data-landing-theme="light"] .landing-upcoming-details-popover {
    color: #202838;
    background: rgba(255,255,255,.88);
    border-color: rgba(37,45,61,.16);
    box-shadow: 0 22px 64px rgba(57,68,88,.24), 0 0 0 1px rgba(255,255,255,.58) inset;
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
}
html[data-landing-theme="light"] .landing-upcoming-details-header strong,
html[data-landing-theme="light"] .landing-upcoming-detail-value {
    color: #202838;
}
html[data-landing-theme="light"] .landing-upcoming-detail-label,
html[data-landing-theme="light"] .landing-upcoming-details-close {
    color: #647086;
}
html[data-landing-theme="light"] .landing-upcoming-detail-action {
    color: #7d271f;
    border-color: rgba(179,36,28,.24);
    background: rgba(179,36,28,.065);
}

/* v0.22: segmented Upcoming sets. Two-card grid keeps odd trailing cards at
   inline-start (left in LTR, right in RTL) instead of centering them. */
.landing-upcoming-segment-group {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.landing-upcoming-segment-group:first-of-type { margin-top: 0; }
.landing-upcoming-segment-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}
.landing-upcoming-segment-heading span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding-inline: 6px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255,255,255,.055);
    font-variant-numeric: tabular-nums;
}
.landing-upcoming-segment-group .landing-upcoming-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    justify-content: stretch;
    align-items: stretch;
    overflow: visible;
}
.landing-upcoming-segment-group .landing-upcoming-card {
    width: 100%;
    max-width: none;
    min-width: 0;
}
.landing-upcoming-segment-group.is-single .landing-upcoming-card {
    grid-column: 1 / -1;
    width: min(100%, 760px);
    justify-self: center;
}
html[data-landing-theme="light"] .landing-upcoming-segment-heading span {
    color: #202838;
    background: rgba(37,45,61,.065);
}
@media (max-width: 980px) {
    .landing-upcoming-segment-group .landing-upcoming-rail { grid-template-columns: 1fr; }
    .landing-upcoming-segment-group.is-single .landing-upcoming-card { grid-column: auto; width: 100%; }
}

/* v0.22.1: clearer segment grouping and dark-mode logo backlight. */
.landing-upcoming-segment-group[data-upcoming-segment-group="IPO"] { --upcoming-segment-color: #d9b66f; }
.landing-upcoming-segment-group[data-upcoming-segment-group="Fund"] { --upcoming-segment-color: #58c99a; }
.landing-upcoming-segment-group[data-upcoming-segment-group="Bond"] { --upcoming-segment-color: #72a8ff; }
.landing-upcoming-segment-group[data-upcoming-segment-group="Commodity"] { --upcoming-segment-color: #e49a55; }

.landing-upcoming-segment-heading {
    gap: 10px;
    padding-block: 2px 4px;
    font-size: 15px;
}
.landing-upcoming-segment-heading strong {
    color: var(--upcoming-segment-color, var(--text));
    font-size: clamp(16px, 1.15vw, 19px);
    font-weight: 900;
    line-height: 1.25;
}
.landing-upcoming-segment-heading span {
    min-width: 28px;
    height: 28px;
    padding-inline: 8px;
    color: var(--upcoming-segment-color, var(--text));
    background: color-mix(in srgb, var(--upcoming-segment-color, var(--accent)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--upcoming-segment-color, var(--accent)) 34%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--upcoming-segment-color, var(--accent)) 7%, transparent) inset;
    font-size: 12px;
    font-weight: 900;
}

.landing-upcoming-card[data-segment="IPO"] { --upcoming-card-segment-color: #d9b66f; }
.landing-upcoming-card[data-segment="Fund"] { --upcoming-card-segment-color: #58c99a; }
.landing-upcoming-card[data-segment="Bond"] { --upcoming-card-segment-color: #72a8ff; }
.landing-upcoming-card[data-segment="Commodity"] { --upcoming-card-segment-color: #e49a55; }
.landing-upcoming-card .landing-upcoming-segment {
    color: var(--upcoming-card-segment-color, color-mix(in srgb,var(--accent) 78%,#fff));
    background: color-mix(in srgb, var(--upcoming-card-segment-color, var(--accent)) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--upcoming-card-segment-color, var(--accent)) 30%, transparent);
}

html:not([data-landing-theme="light"]) .landing-upcoming-shape {
    background:
        radial-gradient(circle at 50% 46%, rgba(255,255,255,.20) 0%, rgba(255,255,255,.105) 42%, rgba(255,255,255,.045) 72%, rgba(255,255,255,.025) 100%);
    border-color: rgba(255,255,255,.14);
    box-shadow:
        inset 0 0 18px rgba(255,255,255,.055),
        0 0 22px rgba(255,255,255,.10),
        0 8px 24px rgba(0,0,0,.16);
}
html:not([data-landing-theme="light"]) .landing-upcoming-shape img {
    filter: drop-shadow(0 0 6px rgba(255,255,255,.16));
}

html[data-landing-theme="light"] .landing-upcoming-segment-heading strong {
    color: color-mix(in srgb, var(--upcoming-segment-color, #202838) 84%, #202838);
}
html[data-landing-theme="light"] .landing-upcoming-segment-heading span {
    color: color-mix(in srgb, var(--upcoming-segment-color, #202838) 82%, #202838);
    background: color-mix(in srgb, var(--upcoming-segment-color, #202838) 12%, #fff);
    border-color: color-mix(in srgb, var(--upcoming-segment-color, #202838) 28%, transparent);
}
html[data-landing-theme="light"] .landing-upcoming-card .landing-upcoming-segment {
    color: color-mix(in srgb, var(--upcoming-card-segment-color, #202838) 80%, #202838);
    background: color-mix(in srgb, var(--upcoming-card-segment-color, #202838) 11%, #fff);
    border-color: color-mix(in srgb, var(--upcoming-card-segment-color, #202838) 25%, transparent);
}


/* Active IPO allocation: yellow progress state, distinct from the orange waiting state. */
.landing-upcoming-card.is-allocating {
    border-color: rgba(242,199,52,.54);
    background: linear-gradient(90deg, rgba(192,150,24,.18), rgba(244,203,69,.10));
    box-shadow: inset 0 0 0 1px rgba(245,210,74,.09), 0 10px 28px rgba(134,97,8,.10);
}
html[dir="rtl"] .landing-upcoming-card.is-allocating {
    background: linear-gradient(270deg, rgba(192,150,24,.18), rgba(244,203,69,.10));
}
.landing-upcoming-card.is-allocating .landing-upcoming-progress > span {
    background: linear-gradient(90deg, rgba(235,184,30,.18), rgba(247,207,65,.32));
    border-inline-end-color: rgba(255,221,99,.75);
}
html[dir="rtl"] .landing-upcoming-card.is-allocating .landing-upcoming-progress > span {
    background: linear-gradient(270deg, rgba(235,184,30,.18), rgba(247,207,65,.32));
}
.landing-upcoming-card.is-allocating .landing-upcoming-status,
.landing-upcoming-card.is-allocating .landing-upcoming-countdown { color: #f9d55a; }
html[data-landing-theme="light"] .landing-upcoming-card.is-allocating {
    border-color: rgba(182,137,14,.48);
    background: linear-gradient(90deg, rgba(250,202,70,.22), rgba(255,235,162,.40));
}
html[data-landing-theme="light"][dir="rtl"] .landing-upcoming-card.is-allocating {
    background: linear-gradient(270deg, rgba(250,202,70,.22), rgba(255,235,162,.40));
}
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-allocating .landing-upcoming-status,
html[data-landing-theme="light"] .landing-page .landing-upcoming-card.is-allocating .landing-upcoming-countdown {
    color: #825b00;
}
