/* qairawan-twin · MARCO identity (tokens from MarcoCMS marco/css/tokens.css, dark theme) */
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("/brand/fonts/Cairo-Regular.ttf") format("truetype"); }
@font-face { font-family: "Cairo"; font-weight: 500; font-display: swap; src: url("/brand/fonts/Cairo-Medium.ttf") format("truetype"); }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("/brand/fonts/Cairo-Bold.ttf") format("truetype"); }

:root {
  --accent: #E75B3D; --accent-hi: #FF6B4A; --accent-soft: rgba(231, 91, 61, .14); --accent-line: rgba(231, 91, 61, .32);
  --ok: #5ECD89; --info: #7DA8FF; --warn: #FFC85E; --danger: #F1416C; --plum: #B79CFF;
  --bg: #16161B; --bg-rail: #1B1B22; --bg-card: #232329; --bg-card-2: #2A2A33; --bg-input: #1F1F26; --bg-soft: #1E1E25;
  --line: rgba(255, 255, 255, .06); --line-2: rgba(255, 255, 255, .10); --line-3: rgba(255, 255, 255, .18);
  --fg: #fff; --fg-2: #C8C8D0; --fg-muted: #8A8A95; --fg-dim: #5E5E68;
  --glass: rgba(27, 27, 34, .78); --glass-line: rgba(255, 255, 255, .09);
  --shadow-lift: 0 10px 25px rgba(0, 0, 0, .40); --shadow-pop: 0 18px 50px rgba(0, 0, 0, .55);
  --r-1: 8px; --r-2: 12px; --r-3: 14px; --r-4: 18px; --pill: 999px;
  --font: "Cairo", system-ui, sans-serif;
  --top-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 8px; }

/* ── screens ─────────────────────────────────────────────────────────── */
.screen { position: fixed; inset: 0; transition: opacity .6s ease, transform .6s ease; }
.screen.off { opacity: 0; pointer-events: none; transform: scale(1.02); }
.glow::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(900px circle at 85% -10%, rgba(231,91,61,.18), transparent 50%), radial-gradient(600px circle at 15% 110%, rgba(231,91,61,.10), transparent 50%); }
.brandrow { display: flex; align-items: center; justify-content: center; gap: 22px; }
.brandrow .sep { width: 1px; height: 46px; background: var(--line-3); }
.logo-marco { height: 56px; } .logo-moc { height: 50px; }

/* gate */
#gate { display: grid; place-items: center; padding: 24px 16px; }
#gate .doors { position: absolute; inset: 0; pointer-events: none; display: flex; z-index: 3; }
#gate .doors i { flex: 1; background: linear-gradient(90deg, #1b1b22, #24242c); border-inline: 1px solid var(--line-2); transform: translateX(0); transition: transform 1s cubic-bezier(.7,0,.2,1); }
#gate.opening .doors i:first-child { transform: translateX(105%); } #gate.opening .doors i:last-child { transform: translateX(-105%); }
#gate .doors { opacity: 0; } #gate.opening .doors { opacity: 1; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-lift); }
.login { position: relative; z-index: 2; width: 100%; max-width: 440px; padding: 36px 36px 28px; }
.login h1 { font-size: 20px; margin: 22px 0 4px; text-align: center; }
.login .sub { text-align: center; color: var(--fg-muted); font-size: 13px; margin: 0 0 22px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--fg-2); margin-bottom: 6px; font-weight: 500; }
.field .in { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--line-2); border-radius: var(--r-2); padding: 0 12px; height: 46px; transition: border-color .2s, box-shadow .2s; }
.field .in:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input { flex: 1; background: none; border: 0; outline: 0; font-size: 14.5px; height: 100%; }
.field svg { color: var(--fg-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--bg-card-2); font-size: 14px; font-weight: 600; transition: background .2s, transform .1s, border-color .2s; }
.btn:hover { background: #33333d; } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(231,91,61,.35); }
.btn.primary:hover { background: var(--accent-hi); }
.btn.wide { width: 100%; height: 48px; font-size: 15px; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin: 4px 0 8px; text-align: center; }
.foot { text-align: center; color: var(--fg-dim); font-size: 11.5px; margin-top: 18px; }

/* warehouses */
#halls { overflow-y: auto; padding: 0 0 40px; }
.halls-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; position: relative; z-index: 2; }
.halls-top .brandrow { justify-content: flex-start; gap: 16px; } .halls-top .logo-marco { height: 40px; } .halls-top .logo-moc { height: 36px; } .halls-top .sep { height: 32px; }
.halls-head { text-align: center; position: relative; z-index: 2; margin: 18px 16px 26px; }
.halls-head h2 { font-size: 30px; margin: 0 0 6px; } .halls-head p { color: var(--fg-muted); margin: 0; }
.halls-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hall { position: relative; padding: 20px; border-radius: var(--r-4); background: var(--bg-card); border: 1px solid var(--line); opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s, border-color .2s, background .2s; }
.hall.in { opacity: 1; transform: none; }
.hall .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft); color: var(--fg-muted); margin-bottom: 14px; }
.hall .ic svg { width: 22px; height: 22px; }
.hall .city { font-size: 12px; color: var(--fg-muted); } .hall h3 { font-size: 17px; margin: 2px 0 12px; line-height: 1.5; }
.hall .lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-dim); }
.hall.active { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 26px 28px; cursor: pointer;
  background: linear-gradient(135deg, rgba(231,91,61,.16), rgba(231,91,61,.04) 60%), var(--bg-card); border-color: var(--accent-line); }
.hall.active:hover { border-color: var(--accent); }
.hall.active .ic { background: var(--accent); color: #fff; }
.hall.active h3 { font-size: 24px; margin-bottom: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px 14px; min-width: 110px; }
.stat b { display: block; font-size: 20px; } .stat span { font-size: 12px; color: var(--fg-muted); }

/* ── the warehouse ───────────────────────────────────────────────────── */
#world { background: #0e0e12; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#c.grab { cursor: grabbing; } #c.point { cursor: pointer; }
.hud { position: absolute; z-index: 5; transition: opacity .5s; }
.hud-off .hud { opacity: 0; pointer-events: none; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: var(--shadow-lift); }

.topbar { top: 12px; inset-inline: 12px; height: var(--top-h); border-radius: var(--r-4); display: flex; align-items: center; gap: 14px; padding: 0 14px; }
.topbar .brandrow { gap: 12px; flex: none; } .topbar .logo-marco { height: 34px; } .topbar .logo-moc { height: 30px; } .topbar .sep { height: 28px; }
.topbar .title { flex: none; line-height: 1.25; } .topbar .title b { display: block; font-size: 15px; } .topbar .title span { font-size: 11.5px; color: var(--fg-muted); }
.search { position: relative; flex: 1; max-width: 560px; margin-inline: auto; }
.search .in { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--pill); background: rgba(0,0,0,.28); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; }
.search .in:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 14px; }
.search kbd { font-family: var(--font); font-size: 11px; color: var(--fg-muted); border: 1px solid var(--line-3); border-radius: 6px; padding: 0 6px; }
.results { position: absolute; top: 52px; inset-inline: 0; max-height: min(62vh, 520px); overflow-y: auto; border-radius: var(--r-3); padding: 6px; }
.results .grp { font-size: 11.5px; color: var(--fg-muted); padding: 8px 10px 4px; font-weight: 600; }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.res:hover, .res.on { background: var(--accent-soft); }
.res .ri { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-soft); color: var(--fg-2); flex: none; overflow: hidden; }
.res .ri img { width: 100%; height: 100%; object-fit: cover; }
.res .rt { flex: 1; min-width: 0; } .res .rt b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .rt span { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.res .go { color: var(--accent); opacity: 0; } .res:hover .go, .res.on .go { opacity: 1; }
.empty-res { padding: 16px; color: var(--fg-muted); font-size: 13px; text-align: center; }
.tools { display: flex; gap: 6px; flex: none; }
.tbtn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); transition: background .2s, border-color .2s, color .2s; }
.tbtn.off { color: var(--fg-dim); }
.tbtn:hover { background: rgba(255,255,255,.09); } .tbtn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.tbtn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: 48px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; padding: 5px 9px; border-radius: 8px; background: #000; color: #fff; pointer-events: none; z-index: 9; }
.floorsw { display: flex; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); height: 42px; }
.floorsw button { border: 0; background: none; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.floorsw button.on { background: var(--accent); color: #fff; }

.crumbs { top: calc(var(--top-h) + 22px); inset-inline-start: 14px; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: var(--pill); font-size: 12.5px; max-width: calc(100vw - 460px); overflow: hidden; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); color: var(--fg-2); text-decoration: none; cursor: pointer; white-space: nowrap; }
.crumbs a:hover { background: rgba(255,255,255,.07); color: #fff; } .crumbs a.cur { color: #fff; background: var(--accent-soft); }
.crumbs .chev { color: var(--fg-dim); }

/* side panel (the start side = right in RTL) */
.panel { top: calc(var(--top-h) + 22px); bottom: 84px; inset-inline-end: 14px; width: 420px; max-width: calc(100vw - 28px); border-radius: var(--r-4); display: flex; flex-direction: column; transform: translateX(-12px); opacity: 0; pointer-events: none; transition: transform .35s ease, opacity .35s ease; }
.panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ph { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.ph .kind { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent-hi); font-weight: 600; }
.ph h3 { margin: 6px 0 2px; font-size: 20px; display: flex; align-items: center; gap: 10px; } .ph .meta { color: var(--fg-muted); font-size: 12.5px; }
.ph { position: relative; } .ph .x { position: absolute; top: 12px; inset-inline-end: 12px; }
.panel .x, .viewer .x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); display: grid; place-items: center; }
.panel .x:hover, .viewer .x:hover { background: rgba(255,255,255,.1); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px; }
.fact { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px 10px; }
.fact b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fact b.txt { font-size: 13px; font-weight: 600; padding-top: 3px; } .fact span { font-size: 11.5px; color: var(--fg-muted); }
.pb { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.sec { font-size: 12px; color: var(--fg-muted); font-weight: 600; margin: 12px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.filter { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--r-2); background: var(--bg-input); border: 1px solid var(--line-2); margin: 4px 0 10px; }
.filter input { flex: 1; border: 0; outline: 0; background: none; font-size: 13px; }
.boxrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-2); background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; transition: border-color .2s, background .2s; }
.boxrow:hover { border-color: var(--accent-line); background: var(--bg-card-2); }
.boxrow .bi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(231,91,61,.12); color: var(--accent-hi); flex: none; }
.boxrow .bt { flex: 1; min-width: 0; } .boxrow b { font-size: 14px; } .boxrow span { display: block; font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boxrow .cnt { font-size: 12px; color: var(--fg-2); background: rgba(255,255,255,.06); border-radius: var(--pill); padding: 2px 10px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc { position: relative; border-radius: var(--r-2); overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, transform .15s; }
.pc:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.pc.hit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pc .img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; }
.pc .img img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; } .pc .img img.ok { opacity: 1; }
.pc .img .noimg { color: #999; } .pc .cap { padding: 6px 7px; font-size: 11px; line-height: 1.35; }
.pc .cap b { display: block; font-size: 11px; font-weight: 600; direction: ltr; text-align: right; } .pc .cap span { color: var(--fg-muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin: 12px auto 0; display: flex; }
.note { font-size: 12px; color: var(--fg-muted); background: var(--bg-soft); border-radius: var(--r-2); padding: 10px 12px; margin-top: 10px; display: flex; gap: 8px; }

/* minimap + hint + ask */
.minimap { bottom: 14px; inset-inline-start: 14px; border-radius: var(--r-3); padding: 8px; }
.minimap .mh { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--fg-muted); padding: 0 4px 6px; }
.minimap canvas { display: block; width: 260px; height: 190px; border-radius: 10px; cursor: crosshair; }
.hint { bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; padding: 9px 16px; border-radius: var(--pill); font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.hint span { display: inline-flex; align-items: center; gap: 6px; } .hint svg { color: var(--accent-hi); }
.askfab { bottom: 16px; inset-inline-end: 14px; height: 52px; padding: 0 20px 0 16px; border-radius: var(--pill); border: 0; background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 28px rgba(231,91,61,.45); transition: transform .15s, background .2s; }
.askfab:hover { background: var(--accent-hi); transform: translateY(-2px); } .askfab svg { width: 22px; height: 22px; }
.tip { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); border-radius: var(--r-4); padding: 22px 22px 18px; text-align: center; }
.tip h4 { margin: 0 0 4px; font-size: 18px; } .tip p { margin: 0 0 16px; color: var(--fg-muted); font-size: 13.5px; }
.tipgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; text-align: start; }
.tipgrid div { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-2); background: var(--bg-soft); font-size: 13px; }
.tipgrid svg { color: var(--accent-hi); width: 22px; height: 22px; }
.hover-tag { position: fixed; z-index: 6; pointer-events: none; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; transform: translate(14px, 14px); white-space: nowrap; }
.hover-tag b { font-weight: 700; } .hover-tag span { color: var(--fg-muted); }
.toast { top: calc(var(--top-h) + 70px); left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: var(--pill); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.toast svg { color: var(--ok); }

/* live link with MARCO */
.live { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); }
.live.ok { color: var(--ok); } .live.ok i { background: var(--ok); box-shadow: 0 0 0 0 rgba(94,205,137,.6); animation: livepulse 2s infinite; }
.live.err { color: var(--warn); } .live.err i { background: var(--warn); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(94,205,137,.55); } 70% { box-shadow: 0 0 0 7px rgba(94,205,137,0); } 100% { box-shadow: 0 0 0 0 rgba(94,205,137,0); } }
.tbtn .badge { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.feed { top: calc(var(--top-h) + 22px); inset-inline-end: 14px; width: 400px; max-width: calc(100vw - 28px); max-height: min(70vh, 560px); border-radius: var(--r-4); display: flex; flex-direction: column; z-index: 8; }
.feed .fh { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); } .feed .fh b { display: block; font-size: 14.5px; } .feed .fh span { font-size: 11.5px; color: var(--fg-muted); }
.feed .fl { overflow-y: auto; padding: 8px; }
.fe { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; }
.fe:hover { background: rgba(255,255,255,.05); } .fe.off { cursor: default; opacity: .7; }
.fe i { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ok); }
.fe.add i { background: var(--info); } .fe.remove i { background: var(--danger); }
.fe b { display: block; font-size: 13px; font-weight: 600; line-height: 1.6; } .fe span { font-size: 11.5px; color: var(--fg-muted); }
.toast span { max-width: 62vw; } .toast button { margin-inline-start: 6px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-hi); border-radius: var(--pill); padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.toast svg { flex: none; }
.warn { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.7; color: var(--warn); background: rgba(255,200,94,.08); border: 1px solid rgba(255,200,94,.25); border-radius: var(--r-2); padding: 8px 12px; }
.vfoot a.btn { flex: 1; text-decoration: none; }
.login .ssobox { display: none; text-align: center; } .login .ssobox p { color: var(--fg-2); font-size: 13.5px; line-height: 1.8; margin: 0 0 16px; }
.login.sso .field, .login.sso button[type=submit] { display: none; } .login.sso .ssobox { display: block; } .login .ssobox a { text-decoration: none; }
/* both doors: the account form, then «أو», then MARCO */
.login.both .ssobox { display: block; margin-top: 4px; } .login.both .ssotext { display: none; }
.login .ssobox .or { display: none; } .login.both .ssobox .or { display: flex; align-items: center; gap: 12px; color: var(--fg-muted); font-size: 12.5px; margin: 16px 0 14px; }
.login.both .or::before, .login.both .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.login .remember { display: flex; align-items: center; gap: 9px; margin: 2px 2px 14px; font-size: 13px; color: var(--fg-2); cursor: pointer; user-select: none; }
.login .remember input { width: 17px; height: 17px; accent-color: #e85d3a; margin: 0; }
/* who is inside: MARCO photo (or initial) + name */
.who-row { display: flex; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 5px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 220px; }
.who img, .who .ini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.who .ini { display: grid; place-items: center; background: #e85d3a; color: #fff; font-size: 14px; }
.who span { overflow: hidden; text-overflow: ellipsis; }
.who.hidden { display: none; }

/* the arrival: letterbox, title, skip */
.cine { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.cine .bar { position: absolute; inset-inline: 0; height: 11vh; background: #000; transition: transform .9s cubic-bezier(.6,0,.2,1); }
.cine .bar.top { top: 0; transform: translateY(-100%); } .cine .bar.bot { bottom: 0; transform: translateY(100%); }
.cine.play .bar { transform: none; } .cine.out .bar.top { transform: translateY(-100%); } .cine.out .bar.bot { transform: translateY(100%); }
.cine .ctitle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0; text-shadow: 0 2px 24px rgba(0,0,0,.55); }
.cine.play .ctitle { animation: ctitle 3.6s .35s ease both; }
.cine .ctitle .brandrow { margin-bottom: 14px; } .cine .ctitle h2 { margin: 0; font-size: clamp(30px, 5vw, 56px); letter-spacing: .5px; }
.cine .ctitle p { margin: 4px 0 0; color: rgba(255,255,255,.85); font-size: clamp(13px, 1.6vw, 17px); }
@keyframes ctitle { 0% { opacity: 0; transform: translate(-50%, -44%); filter: blur(6px); } 22%, 72% { opacity: 1; transform: translate(-50%, -50%); filter: none; } 100% { opacity: 0; transform: translate(-50%, -56%); filter: blur(4px); } }
.cine .skip { position: absolute; bottom: calc(11vh + 18px); inset-inline-start: 24px; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: var(--pill);
  border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: #fff; font-size: 13.5px; font-weight: 600; backdrop-filter: blur(8px); opacity: 0; animation: fadein .5s 1.2s ease forwards; }
.cine .skip:hover { background: rgba(0,0,0,.55); }
.cine.out .skip, .cine.out .ctitle { opacity: 0 !important; transition: opacity .3s; }
@keyframes fadein { to { opacity: 1; } }
.flash { position: fixed; inset: 0; z-index: 19; background: #000; opacity: 0; pointer-events: none; transition: opacity .26s ease; }
.flash.on { opacity: 1; }

/* ask drawer */
.ask { bottom: 84px; inset-inline-end: 14px; width: 420px; max-width: calc(100vw - 28px); height: min(620px, calc(100vh - 190px)); border-radius: var(--r-4); display: flex; flex-direction: column; transform: translateY(12px); opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s; z-index: 7; }
.ask.open { transform: none; opacity: 1; pointer-events: auto; }
.ask .ah { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ask .ah .av { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.ask .ah b { display: block; font-size: 14.5px; } .ask .ah span { font-size: 11.5px; color: var(--fg-muted); } .ask .ah .x { margin-inline-start: auto; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.msg.me { align-self: flex-start; background: var(--accent); color: #fff; border-end-start-radius: 4px; }
.msg.bot { align-self: flex-end; background: var(--bg-card-2); border: 1px solid var(--line); border-end-end-radius: 4px; }
.msg .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .acts button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-hi); border-radius: var(--pill); padding: 4px 10px; font-size: 12.5px; font-weight: 600; }
.msg .acts button:hover { background: rgba(231,91,61,.25); }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); animation: bl 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.sugg button { border: 1px solid var(--line-2); background: var(--bg-soft); border-radius: var(--pill); padding: 5px 11px; font-size: 12px; color: var(--fg-2); }
.sugg button:hover { border-color: var(--accent-line); color: #fff; }
.ask form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ask form input { flex: 1; height: 44px; border-radius: var(--pill); background: var(--bg-input); border: 1px solid var(--line-2); padding: 0 16px; outline: 0; font-size: 13.5px; }
.ask form input:focus { border-color: var(--accent-line); }
.ask form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; }

/* piece viewer */
.viewer { position: fixed; inset: 0; z-index: 20; background: rgba(8, 8, 11, .82); backdrop-filter: blur(6px); display: none; padding: 20px; }
.viewer.open { display: flex; }
.vbox { flex: 1; display: grid; grid-template-columns: 1fr 380px; gap: 14px; max-width: 1500px; margin: 0 auto; min-height: 0; }
.vstage-wrap { display: flex; flex-direction: column; border-radius: var(--r-4); overflow: hidden; background: #0e1013; border: 1px solid var(--line-2); min-height: 0; }
.vstage { position: relative; flex: 1; overflow: hidden; background: #fff; cursor: grab; touch-action: none; }
.vstage.drag { cursor: grabbing; }
.vstage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.vstage .load { position: absolute; inset: 0; display: grid; place-items: center; color: #777; font-size: 13px; pointer-events: none; }
.vzoom { position: absolute; bottom: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }
.vzoom button, .vnav { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(0,0,0,.1); background: rgba(255,255,255,.92); color: #222; display: grid; place-items: center; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 42px; height: 58px; }
.vnav.prev { right: 12px; } .vnav.next { left: 12px; }
.vcount { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: var(--pill); }
.vstrip { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #121519; border-top: 1px solid var(--line); }
.vstrip img { height: 60px; width: 84px; object-fit: contain; background: #fff; border-radius: 8px; border: 2px solid transparent; cursor: pointer; flex: none; opacity: .65; }
.vstrip img.on { border-color: var(--accent); opacity: 1; }
.vinfo { border-radius: var(--r-4); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.vinfo .top { display: flex; align-items: flex-start; gap: 10px; } .vinfo h2 { margin: 0; font-size: 20px; line-height: 1.5; flex: 1; }
.bc { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-hi); border: 1px solid var(--accent-line); padding: 3px 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 700; direction: ltr; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--fg-muted); } .kv dd { margin: 0; }
.path { display: flex; flex-direction: column; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; }
.path div { display: flex; align-items: center; gap: 8px; font-size: 13px; } .path svg { color: var(--accent-hi); }
.here { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ok); background: rgba(94,205,137,.10); border: 1px solid rgba(94,205,137,.25); border-radius: var(--r-2); padding: 8px 12px; }
.vfoot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; } .vfoot .btn { flex: 1; white-space: nowrap; padding: 0 12px; } .vfoot .btn.primary { flex-basis: 100%; }
.sumtext { font-size: 13px; color: var(--fg-2); line-height: 1.8; background: var(--bg-soft); border-radius: var(--r-2); padding: 10px 12px; }

/* loading */
.loader { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--bg); transition: opacity .5s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader .bar { width: 240px; height: 4px; border-radius: 4px; background: var(--bg-card-2); overflow: hidden; margin: 18px auto 10px; }
.loader .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.loader p { text-align: center; color: var(--fg-muted); font-size: 13px; margin: 0; }

@media (max-width: 900px) {
  .topbar .title, .topbar .sep, .topbar .logo-moc { display: none; }
  .crumbs { max-width: calc(100vw - 28px); }
  .vbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .vinfo { max-height: 42vh; }
  .hint { display: none; } .minimap canvas { width: 180px; height: 132px; }
  .hall.active { grid-template-columns: 1fr; }
}

/* ── 3D models (Roads of Arabia): badge on the card, the model in the viewer's stage, its tile in the strip ── */
.pc .m3d { position: absolute; top: 6px; left: 6px; font: 700 10px/1 var(--font, inherit); letter-spacing: .04em; padding: 4px 6px; border-radius: 6px;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(231,91,61,.4); pointer-events: none; }
.vstage #vmodel { position: absolute; inset: 0; width: 100%; height: 100%; display: none; background: radial-gradient(circle at 50% 40%, #fff, #e9e6e2); --poster-color: transparent; }
.vstage.m3d #vmodel { display: block; }
.vstage.m3d #vimg, .vstage.m3d .vnav, .vstage.m3d .vzoom { display: none; }
.vstage.m3d { cursor: auto; }
.vstrip .t3d { flex: none; display: grid; place-items: center; gap: 2px; width: 84px; height: 60px; border-radius: 8px; border: 2px solid transparent;
  background: var(--accent-soft); color: var(--accent-hi); cursor: pointer; font: inherit; }
.vstrip .t3d b { font-size: 11px; } .vstrip .t3d.on { border-color: var(--accent); }
.vinfo .has3d { display: flex; align-items: center; gap: 6px; margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--fg, #fff); }
/* thumbnails of a crate's pieces in its hover tag */
.hover-tag .hthumbs { display: flex; gap: 4px; margin-top: 6px; }
.hover-tag .hthumbs i { width: 44px; height: 44px; border-radius: 6px; background: #fff; overflow: hidden; display: grid; place-items: center; }
.hover-tag .hthumbs img { width: 100%; height: 100%; object-fit: contain; }
