/* ═══════════════════════════════════════════════════════════════════════════
   azforeigner design system — "HUD"
   One stylesheet for every public page. Pages keep only the rules that are
   truly their own; everything below is shared and must not be re-declared in
   a page-level <style>, because the page block loads later and would win.
   Admin pages (/Admin/**) keep their own inline styles and only inherit the
   tokens + base from here.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url("/fonts/plex.css");

/* ── tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #0d0d14;
  --bg-2: #10101a;
  --panel: rgba(255,255,255,.035);
  --panel-2: rgba(255,255,255,.06);
  --panel-3: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);
  --line-3: rgba(255,255,255,.26);
  --text: #f0f0f5;
  --muted: rgba(240,240,245,.55);
  --faint: rgba(240,240,245,.32);
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-3: #c4b5fd;
  --accent-line: rgba(139,92,246,.35);
  --accent-glow: rgba(139,92,246,.22);
  --accent-soft: rgba(139,92,246,.12);
  --ok: #34d399;  --ok-line: rgba(52,211,153,.35);  --ok-soft: rgba(52,211,153,.08);
  --warn: #fbbf24; --warn-line: rgba(251,191,36,.35); --warn-soft: rgba(251,191,36,.08);
  --bad: #f87171;  --bad-line: rgba(248,113,113,.35); --bad-soft: rgba(248,113,113,.08);
  --blue: #60a5fa; --pink: #f472b6; --teal: #2dd4bf; --amber: #fbbf24; --indigo: #818cf8;
  --green: #34d399; --orange: #fb923c; --sky: #38bdf8; --violet: #a78bfa; --red: #f87171;
  /* module hue: set --m on a page wrapper to tint tags/eyebrows/chips */
  --m: var(--accent-2);
  --display: "IBM Plex Sans Condensed", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, Menlo, monospace;
  --r: 6px; --r-sm: 4px; --r-xs: 3px;
  /* legacy aliases still referenced by page-level styles */
  --card: var(--panel);
  --border: var(--line);
}

/* ── base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 15px; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }
body > .container { flex: 1; position: relative; z-index: 1; }
.container { overflow: visible !important; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent-3); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: .01em; line-height: 1.1; margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
::selection { background: var(--accent-glow); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ── ambient background (drawn by bgfx.js into #bgfx) ───────────────────── */
#bgfx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bg-vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 85% 0%, rgba(139,92,246,.14), transparent 70%),
              radial-gradient(ellipse 50% 40% at 0% 100%, rgba(219,39,119,.07), transparent 70%); }
.bg-scan { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px); }
.ground { position: relative; isolation: isolate; }
.ground::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 0%, #000 30%, transparent 100%); }

/* ── navbar ─────────────────────────────────────────────────────────────── */
header { position: sticky; top: 0; z-index: 1040; }
nav.navbar { background: rgba(13,13,20,.92) !important; border-bottom: 1px solid var(--line) !important; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); padding: 0; min-height: 56px; }
nav.navbar .navbar-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; padding: 12px 0; }
nav.navbar .navbar-brand svg, nav.navbar .navbar-brand img { width: 26px; height: 26px; }
nav.navbar .nav-link, nav.navbar .nav-link.text-dark { position: relative; color: var(--muted) !important; font-size: 13px; font-weight: 500; padding: 10px 12px !important; transition: color .15s; border-radius: var(--r-sm); }
nav.navbar .nav-link:hover, nav.navbar .nav-link:focus, nav.navbar .nav-link.active { color: var(--text) !important; }
nav.navbar .nav-link.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }
nav.navbar .navbar-toggler { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 6px 8px; }
nav.navbar .navbar-toggler:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
nav.navbar .dropdown-toggle::after { opacity: .5; margin-left: 4px; }
nav.navbar .dropdown-menu { background: rgba(13,13,20,.98) !important; border: 1px solid var(--line-2) !important; border-radius: var(--r) !important; padding: 6px !important; margin-top: 6px !important; backdrop-filter: blur(24px); box-shadow: 0 16px 48px rgba(0,0,0,.6) !important; min-width: 220px; z-index: 1050 !important; }
nav.navbar .dropdown-item { display: flex !important; align-items: center; gap: 8px; color: var(--muted) !important; background: transparent !important; border-radius: var(--r-sm) !important; padding: 8px 12px !important; font-size: 13px !important; font-weight: 500 !important; transition: background .15s, color .15s; }
nav.navbar .dropdown-item:hover, nav.navbar .dropdown-item:focus { background: var(--panel-3) !important; color: var(--text) !important; }
nav.navbar .dropdown-item:active { background: var(--accent-soft) !important; color: var(--text) !important; }
nav.navbar .dropdown-divider { border-color: var(--line) !important; margin: 4px 0; }
nav.navbar .dropdown-header { font-family: var(--mono); color: var(--faint) !important; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; padding: 6px 12px 4px; }
.nav-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); transition: color .15s, border-color .15s; }
.nav-icon:hover { color: var(--text); border-color: var(--line-2); }
.nav-icon svg { width: 16px; height: 16px; }
.nav-badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 9px; font-weight: 500; min-width: 16px; height: 16px; border-radius: 999px; display: none; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.nav-badge[data-count]:not([data-count="0"]) { display: inline-flex; }
.nav-user { display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px 4px 4px !important; }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--accent-line); flex-shrink: 0; }
.nav-pill-badge { background: var(--accent); color: #fff; font-family: var(--mono); font-size: 10px; min-width: 18px; height: 18px; border-radius: 999px; display: none; align-items: center; justify-content: center; padding: 0 5px; line-height: 1; }
.nav-pill-badge[data-count]:not([data-count="0"]) { display: inline-flex; }
@media (max-width: 991px) {
  /* Phone menu: a drawer sliding in from the right over a dimmed page. The Bootstrap collapse
     still drives open/closed (the toggler, aria state), the drawer only changes how it looks:
     always in the DOM, moved off-screen with a transform instead of display:none. */
  nav.navbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(13,13,20,.98) !important; } /* a backdrop-filter would trap the fixed drawer inside the bar */
  body:has(.navbar-collapse.show) { overflow: hidden; }
  body:has(.navbar-collapse.show)::after { content: ""; position: fixed; inset: 0; background: rgba(5,5,10,.6); z-index: 1039; }
  nav.navbar .navbar-collapse, nav.navbar .navbar-collapse.collapsing { display: flex !important; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); height: auto !important; margin: 0; padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)); overflow: hidden; background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: -24px 0 48px rgba(0,0,0,.5); z-index: 1041; transform: translateX(104%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
  nav.navbar .navbar-collapse.show { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  nav.navbar .navbar-collapse.collapsing { transition: none; }
  /* drawer header */
  nav.navbar .navbar-collapse::before { content: "MENYU"; display: flex; align-items: center; height: 56px; padding: 0 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--faint); border-bottom: 1px solid var(--line); flex-shrink: 0; }
  nav.navbar .drawer-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
  nav.navbar .drawer-close svg { width: 16px; height: 16px; }
  nav.navbar .navbar-nav { gap: 0; padding: 6px 0; }
  nav.navbar .navbar-nav:first-of-type { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  nav.navbar .nav-link.active::after { display: none; }
  /* rows */
  nav.navbar .nav-item > .nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 18px !important; font-size: 15px; font-weight: 600; color: var(--text) !important; border-radius: 0; }
  nav.navbar .nav-item > .nav-link.active { color: var(--accent-3) !important; box-shadow: inset 3px 0 0 var(--accent); }
  nav.navbar .nav-item > .nav-link:active { background: var(--panel-2); }
  /* accordion groups */
  nav.navbar .nav-item.dropdown > .nav-link { justify-content: space-between; }
  nav.navbar .nav-item.dropdown > .nav-link::after { margin: 0; opacity: .6; border-top-width: .32em; border-right-width: .32em; border-left-width: .32em; transition: transform .2s; }
  nav.navbar .nav-item.dropdown > .nav-link.show::after { transform: rotate(180deg); }
  nav.navbar .dropdown-menu { display: block !important; position: static; float: none; width: 100%; min-width: 0; margin: 0 !important; padding: 0 !important; max-height: 0; overflow: hidden; background: rgba(0,0,0,.25) !important; border: 0 !important; border-radius: 0 !important; box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line) !important; backdrop-filter: none; transition: max-height .3s cubic-bezier(.2,.8,.2,1), padding .3s cubic-bezier(.2,.8,.2,1); }
  nav.navbar .dropdown-menu.show { max-height: 640px; padding: 2px 0 8px !important; }
  nav.navbar .dropdown-header { padding: 10px 18px 4px !important; }
  nav.navbar .dropdown-divider { margin: 4px 18px !important; }
  nav.navbar .dropdown-item { min-height: 42px; padding: 0 18px 0 30px !important; border-radius: 0 !important; font-size: 14px !important; color: var(--muted) !important; }
  nav.navbar .dropdown-item:active { background: var(--accent-soft) !important; color: var(--text) !important; }
  nav.navbar .dropdown-item .ic { width: 15px; height: 15px; color: var(--accent-2); flex-shrink: 0; }
  /* account block at the bottom */
  nav.navbar .navbar-nav + .navbar-nav { flex-shrink: 0; margin-top: 0; padding: 10px 18px 0; border-top: 1px solid var(--line); background: var(--bg-2); }
  nav.navbar .navbar-nav + .navbar-nav > .nav-item > .nav-link { padding: 0 !important; }
  nav.navbar .nav-user { border: 0; gap: 10px; }
  nav.navbar .nav-user .nav-avatar { width: 32px; height: 32px; }
  nav.navbar .navbar-nav + .navbar-nav .dropdown-menu { background: transparent !important; box-shadow: none !important; }
  nav.navbar .navbar-nav + .navbar-nav .dropdown-menu.show { padding: 0 0 4px !important; }
  nav.navbar .navbar-nav + .navbar-nav .dropdown-item { padding-left: 42px !important; }
  nav.navbar .navbar-nav + .navbar-nav .dropdown-menu form .dropdown-item { color: var(--bad) !important; }
  /* signed out: two buttons */
  nav.navbar .navbar-nav + .navbar-nav > .nav-item > .nav-link:not(.dropdown-toggle) { justify-content: center; min-height: 44px; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 14px; }
  nav.navbar .navbar-nav + .navbar-nav > .nav-item > .btn { width: 100%; --h: 44px; font-size: 14px; }
}

/* status strip under the nav (home page) */
.strip { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.strip-in { max-width: 1180px; margin: 0 auto; padding: 0 20px 0 0; height: 34px; display: flex; align-items: center; gap: 22px; overflow: hidden; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.strip .live { flex-shrink: 0; position: relative; z-index: 1; padding: 0 16px 0 20px; background: var(--bg-2); }
.strip .live::after { content: ""; position: absolute; left: 100%; top: 0; bottom: 0; width: 14px; background: linear-gradient(90deg, var(--bg-2), transparent); }
/* ticker: the track holds two identical copies and slides exactly one copy per loop */
.strip-track { display: flex; width: max-content; animation: strip-ticker 70s linear infinite; }
.strip-copy { display: flex; gap: 22px; padding-right: 22px; }
.strip:hover .strip-track { animation-play-state: paused; }
@keyframes strip-ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .strip-in { overflow-x: auto; scrollbar-width: none; } .strip-track { animation: none; } .strip-copy[aria-hidden] { display: none; } }
.strip b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.strip .live { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.strip .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ── footer ─────────────────────────────────────────────────────────────── */
footer.footer { position: relative; z-index: 1; background: transparent; border-top: 1px solid var(--line) !important; padding: 22px 0 40px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
footer.footer, footer.footer a { color: var(--faint) !important; }
footer.footer a:hover { color: var(--text) !important; }
footer.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
footer.footer .footer-links { display: flex; flex-wrap: wrap; gap: 8px 0; }
footer.footer .footer-links a { padding: 4px 12px; border-left: 1px solid var(--line-2); line-height: 1; }
footer.footer .footer-links a:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 600px) {
  footer.footer { padding: 20px 0 32px; text-align: center; }
  footer.footer .container { flex-direction: column; align-items: center; gap: 12px; }
  footer.footer .footer-links { justify-content: center; }
  footer.footer .footer-links a { padding: 6px 12px; }
}

/* ── WhatsApp contact button ────────────────────────────────────────────── */
.wa-fab { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; align-items: center; gap: 10px; background: #25D366; color: #fff; border-radius: var(--r); padding: 10px 16px 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45); text-decoration: none; font-size: 13px; font-weight: 600; transition: transform .15s; white-space: nowrap; max-width: calc(100vw - 48px); }
.wa-fab:hover { transform: translateY(-2px); color: #fff; }
.wa-fab-icon { font-size: 18px; flex-shrink: 0; }
.wa-fab-text { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .wa-fab { padding: 12px; border-radius: 50%; } .wa-fab-text { display: none; } }

/* ── admin badge (kept for the layout) ──────────────────────────────────── */
.admin-badge { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--warn-line); color: var(--warn); font-family: var(--mono); font-size: 9px; padding: 1px 6px; border-radius: var(--r-xs); letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRIMITIVES
   ═══════════════════════════════════════════════════════════════════════════ */

/* layout */
.wrap { max-width: 1140px; margin: 0 auto; padding: 24px 0 80px; }
.wrap-narrow { max-width: 820px; }
.wrap-xnarrow { max-width: 640px; }
.page-body { max-width: 1140px; margin: 0 auto; padding: 0 0 80px; }

/* eyebrow + headings */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--m); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--m); flex-shrink: 0; }
.crumbs { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; margin-bottom: 6px; }
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--text); }

/* page head: replaces the old gradient .pg-header box */
.page-head, .pg-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 6px 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); background: none; border-radius: 0; }
.pg-header .hdr-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; width: 100%; }
.page-head h1, .page-head h2, .pg-header h1, .pg-header h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; text-transform: uppercase; margin: 8px 0 0; color: var(--text); letter-spacing: .01em; }
.page-head p, .pg-header p { color: var(--muted); margin: 8px 0 0; max-width: 62ch; font-size: 14px; }
.page-head.center, .pg-header.center { flex-direction: column; align-items: center; text-align: center; }
.page-head.center p, .pg-header.center p { margin-inline: auto; }

/* section heads */
.section-head, .section-label, .section-hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 40px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 20px; font-weight: 600; text-transform: uppercase; color: var(--text); letter-spacing: .01em; }
.section-head h2, .section-head h3 { font-size: inherit; font-weight: inherit; }
.section-head .idx, .section-label .idx { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .1em; font-weight: 400; text-transform: none; }
.sec-title { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--m); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* link */
.link, .see-all, .card-link-text { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); display: inline-flex; align-items: center; gap: 6px; }
.link:hover, .see-all:hover { color: var(--accent-3); }
.see-all { margin-top: 14px; }
.back-link, .back-btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; transition: color .15s; }
.back-link:hover, .back-btn:hover { color: var(--text); }

/* panel + bracket signature */
.panel, .card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; transition: border-color .2s, background .2s; overflow: visible; }
:where(a).panel, :where(a).card, .panel.hover, .card.hover, .card.lift { display: block; color: inherit; }
:where(a).panel:hover, :where(a).card:hover, .panel.hover:hover, .card.hover:hover, .card.lift:hover { border-color: var(--line-2); background: var(--panel-2); color: inherit; transform: none; box-shadow: none; }
.bracket { position: relative; }
.bracket::before, .bracket::after, .bracket > i.b::before, .bracket > i.b::after { content: ""; position: absolute; width: 10px; height: 10px; border: 1px solid var(--accent-2); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.bracket::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; transform: translate(3px,3px); }
.bracket::after { top: -1px; right: -1px; border-left: 0; border-bottom: 0; transform: translate(-3px,3px); }
.bracket > i.b::before { bottom: -1px; left: -1px; border-right: 0; border-top: 0; transform: translate(3px,-3px); }
.bracket > i.b::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; transform: translate(-3px,-3px); }
.bracket:hover::before, .bracket:hover::after, .bracket:hover > i.b::before, .bracket:hover > i.b::after,
.bracket.lit::before, .bracket.lit::after, .bracket.lit > i.b::before, .bracket.lit > i.b::after { opacity: 1; transform: translate(0,0); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h3 { font-size: 15px; text-transform: uppercase; font-weight: 600; margin-top: 6px; }

/* grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* card internals shared across listings */
.card-title { font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 6px; line-height: 1.35; }
.card-title a { color: inherit; }
.card-desc, .card-text { font-size: 13px; color: var(--muted); line-height: 1.55; }
.card-meta { font-family: var(--mono); font-size: 11px; color: var(--faint); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; letter-spacing: .03em; }
.owner-row { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.owner-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.owner-name { font-size: 12px; color: var(--muted); font-weight: 500; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); letter-spacing: .03em; }
.kv b { color: var(--text); font-weight: 500; display: block; font-variant-numeric: tabular-nums; font-family: var(--body); font-size: 13px; }
.cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); display: block; }
.thumb { width: 40px; height: 40px; border-radius: var(--r-xs); object-fit: cover; flex-shrink: 0; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--muted); }
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: inherit; }
.row-item:first-of-type { border-top: 0; }
.row-item:hover { color: inherit; }
.row-item:hover .row-name { color: var(--accent-3); }
.row-thumb { width: 32px; height: 32px; border-radius: var(--r-xs); object-fit: cover; flex-shrink: 0; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.row-info { flex: 1; min-width: 0; }
.row-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.row-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .03em; }
.row-right { font-family: var(--mono); font-size: 11px; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.empty-cell { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 8px 0; margin: 0; }

/* tags / chips / badges */
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--c, var(--m)); }
.tag::before { content: ""; width: 6px; height: 6px; background: var(--c, var(--m)); flex-shrink: 0; }
.chip, .badge, .status-active, .mini-badge, .cat-badge, .type-badge, .cat-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-xs); font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); background: transparent; letter-spacing: .02em; white-space: nowrap; line-height: 1; }
.chip.ok, .status-active, .badge.ok, .mb-offering { color: var(--ok); border-color: var(--ok-line); }
.chip.warn, .badge.warn, .mb-seeking { color: var(--warn); border-color: var(--warn-line); }
.chip.bad, .badge.bad { color: var(--bad); border-color: var(--bad-line); }
.chip.acc, .badge.acc { color: var(--accent-3); border-color: var(--accent-line); background: var(--accent-soft); }
.chip.m, .badge.m { color: var(--m); border-color: color-mix(in srgb, var(--m) 40%, transparent); }
/* category colour classes used by Q&A and others */
.cat-blue { color: var(--blue); border-color: rgba(96,165,250,.4); }
.cat-green { color: var(--green); border-color: var(--ok-line); }
.cat-purple, .cat-violet { color: var(--accent-2); border-color: var(--accent-line); }
.cat-amber, .cat-yellow { color: var(--amber); border-color: var(--warn-line); }
.cat-teal { color: var(--teal); border-color: rgba(45,212,191,.4); }
.cat-pink { color: var(--pink); border-color: rgba(244,114,182,.4); }
.cat-sky, .cat-cyan { color: var(--sky); border-color: rgba(56,189,248,.4); }
.cat-indigo { color: var(--indigo); border-color: rgba(129,140,248,.4); }
.cat-red { color: var(--bad); border-color: var(--bad-line); }
.cat-orange { color: var(--orange); border-color: rgba(251,146,60,.4); }
.cat-gray { color: var(--muted); border-color: var(--line-2); }

/* buttons */
.btn, .btn-submit, .btn-auth, .create-btn, .search-btn, .clear-btn, .btn-primary-hero, .btn-ghost-hero, .read-btn, .voice-cta, .card-link, .btn-admin-del, .btn-admin-ban {
  --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent; font-family: var(--body); font-weight: 600; font-size: 13px; letter-spacing: .02em; line-height: 1; cursor: pointer; position: relative; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; box-shadow: none; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn:hover, .btn:focus { text-decoration: none; transform: none; }
.btn-primary, .btn-submit, .btn-auth, .create-btn, .btn-primary-hero, .read-btn, .voice-cta { background: var(--accent); color: #fff !important; border-color: var(--accent); }
.btn-primary:hover, .btn-submit:hover, .btn-auth:hover, .create-btn:hover, .btn-primary-hero:hover, .read-btn:hover, .voice-cta:hover, .btn-primary:focus { background: #7c4ff0; border-color: #7c4ff0; box-shadow: 0 0 24px var(--accent-glow); color: #fff !important; transform: none; }
.btn-primary:active, .btn-submit:active { background: #6d3fe0; }
.btn-ghost, .btn-outline-primary, .btn-ghost-hero, .clear-btn, .card-link { background: transparent; color: var(--text) !important; border-color: var(--line-2); }
.btn-ghost:hover, .btn-outline-primary:hover, .btn-ghost-hero:hover, .clear-btn:hover, .card-link:hover { border-color: var(--accent-2); color: var(--accent-3) !important; background: transparent; }
.btn-quiet, .btn-secondary, .btn-light, .search-btn { background: var(--panel-2); color: var(--text) !important; border-color: var(--line); }
.btn-quiet:hover, .btn-secondary:hover, .btn-light:hover, .search-btn:hover { border-color: var(--line-2); background: var(--panel-3); color: var(--text) !important; }
.btn-danger, .btn-outline-danger, .btn-admin-del { background: transparent; color: var(--bad) !important; border-color: var(--bad-line); }
.btn-danger:hover, .btn-outline-danger:hover, .btn-admin-del:hover { background: var(--bad-soft); color: var(--bad) !important; border-color: var(--bad); }
.btn-warn, .btn-admin-ban { background: transparent; color: var(--warn) !important; border-color: var(--warn-line); }
.btn-warn:hover, .btn-admin-ban:hover { background: var(--warn-soft); }
.btn-ok, .btn-success { background: transparent; color: var(--ok) !important; border-color: var(--ok-line); }
.btn-ok:hover, .btn-success:hover { background: var(--ok-soft); }
.btn-link { background: none; border: 0; color: var(--accent-2) !important; padding: 0; height: auto; }
.btn-sm, .btn-admin-del, .btn-admin-ban { --h: 32px; padding: 0 12px; font-size: 12px; }
.btn-xs { --h: 26px; padding: 0 9px; font-size: 11px; }
.btn-lg { --h: 46px; padding: 0 24px; font-size: 14px; }
.btn-block, .btn-submit, .btn-auth { width: 100%; }
.btn[disabled], .btn:disabled, .btn.disabled, .btn-submit:disabled, .btn-auth:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.btn-admin-del, .btn-admin-ban { width: 100%; margin-top: 6px; }
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-spinner, .spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: btn-spin .6s linear infinite; vertical-align: -2px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* forms */
.form-group { margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.form-label, .label, label.form-label { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form-label em, .label em { color: var(--accent-2); font-style: normal; }
.form-control, .input, .form-select, textarea.form-control, select.form-control,
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]):not([type=file]).form-control {
  display: block; width: 100%; height: 40px; padding: 0 12px; background: rgba(255,255,255,.04) !important; border: 1px solid var(--line-2) !important; border-radius: var(--r-sm) !important; color: var(--text) !important; font-family: var(--body); font-size: 14px; line-height: 38px; outline: none; box-shadow: none; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea.form-control, textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.form-control::placeholder, .input::placeholder { color: var(--faint) !important; text-align: start; }
.form-control:hover, .input:hover { border-color: var(--line-3) !important; }
.form-control:focus, .input:focus, .form-select:focus { border-color: var(--accent-2) !important; box-shadow: 0 0 0 3px var(--accent-glow) !important; background: rgba(255,255,255,.06) !important; color: var(--text) !important; }
.form-control.input-validation-error, .input.err, .form-control.err { border-color: var(--bad) !important; }
.form-control-lg { height: 46px; line-height: 44px; font-size: 15px; }
select.form-control, .form-select, select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a78bfa' stroke-width='1.5'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; }
select.form-control option, .form-select option { background: #14141f; color: var(--text); }
input[type=file].form-control { padding: 7px 12px; line-height: 1.6; color: var(--muted) !important; }
input[type=file]::file-selector-button { font: inherit; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 3px 10px; margin-right: 10px; cursor: pointer; }
input:disabled, input[readonly], input[disabled], .form-control:disabled, .form-control[readonly] { color: var(--muted) !important; -webkit-text-fill-color: var(--muted) !important; opacity: 1 !important; background: rgba(255,255,255,.02) !important; cursor: not-allowed; }
input[type=checkbox], input[type=radio], .form-check-input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; background: transparent; border: 1px solid var(--line-2); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-label { color: var(--muted); font-size: 13px; cursor: pointer; }
.help, .form-hint, .form-text { font-size: 12px; color: var(--faint); margin-top: 4px; display: block; }
.val-error, .err-msg, .text-danger, .field-validation-error { display: block; font-family: var(--mono); font-size: 11px; color: var(--bad) !important; margin-top: 4px; letter-spacing: .02em; }
.field-validation-valid { display: none; }
.val-summary, .validation-summary-errors { border: 1px solid var(--bad-line); background: var(--bad-soft); color: var(--bad); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.row2, .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 600px) { .row2, .row3, .form-row-2 { grid-template-columns: 1fr; } }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .form-control { flex: 1; }

/* location picker (city-picker.js hooks: keep class names) */
.loc-picker { position: relative; }
.loc-btn, .loc-btn.form-control { display: flex !important; justify-content: space-between; align-items: center; cursor: pointer; text-align: left !important; font-family: var(--body); }
.loc-btn:hover { border-color: var(--line-3) !important; }
.loc-btn.loc-hint { border-color: var(--warn) !important; box-shadow: 0 0 0 3px var(--warn-soft) !important; }
.loc-selected { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.loc-chevron { flex-shrink: 0; margin-left: 8px; font-size: 11px; color: var(--accent-2); }
.loc-panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 220px; background: #14141f; border: 1px solid var(--line-2); border-radius: var(--r); z-index: 9999; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.55); padding: 0; }
/* the search box is self-styled: listing pages render it as a bare <input class="loc-search">,
   the partial as .loc-search.form-control; both must look identical and fill the panel */
.loc-search, .loc-search.form-control { display: block; width: 100%; box-sizing: border-box; border: none !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; height: 38px; line-height: 38px; padding: 0 12px !important; font-family: var(--body); font-size: 13px !important; color: var(--text) !important; background: var(--panel) !important; outline: none; }
.loc-search::placeholder { color: var(--faint) !important; }
.loc-search:focus, .loc-search.form-control:focus { border-bottom-color: var(--accent-line) !important; background: rgba(255,255,255,.05) !important; box-shadow: none !important; }
.loc-list { list-style: none; margin: 0; padding: 4px 0; max-height: 220px; overflow-y: auto; }
.loc-item, .loc-list li { padding: 8px 12px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }
.loc-item:hover, .loc-item:focus, .loc-list li:hover { background: var(--accent-soft); color: var(--accent-3); }
.loc-empty { padding: 12px; font-family: var(--mono); font-size: 11px; color: var(--faint); list-style: none; }

/* filter bar */
.fbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 14px; margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.fbar-sep { font-family: var(--mono); color: var(--faint); font-size: 14px; padding: 0 2px; height: 40px; display: flex; align-items: center; flex-shrink: 0; }
.fbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fbar-picker { position: relative; flex: 1; min-width: 150px; max-width: 240px; }
.fbar .form-group { margin: 0; flex: 1; min-width: 150px; }
.fbar select, .fbar input[type=text], .fbar input[type=search] { min-width: 150px; }
.search-result-info, .result-info { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
@media (max-width: 600px) { .fbar-sep { display: none; } .fbar-picker { max-width: none; } }

/* pagination */
.pg-wrap, .pager { display: flex; justify-content: center; gap: 6px; margin: 28px 0 8px; flex-wrap: wrap; }
.pg-btn, .pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--mono); font-size: 12px; color: var(--muted); transition: border-color .15s, color .15s; }
.pg-btn:hover, .pager a:hover { border-color: var(--line-2); color: var(--text); }
.pg-btn.active, .pager a.on { border-color: var(--accent-2); color: var(--accent-3); background: var(--accent-glow); pointer-events: none; }
.pg-btn.disabled { opacity: .3; pointer-events: none; }
.pg-info { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; margin-top: 8px; }

/* alerts / status */
.alert, .success-bar, .error-bar, .info-bar, .warn-bar, .email-warning { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; background: var(--panel); color: var(--text); line-height: 1.5; }
.alert-success, .success-bar { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.alert-danger, .error-bar { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.alert-warning, .warn-bar, .email-warning { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.alert-info, .info-bar { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-3); }
.alert a, .email-warning a { color: inherit; text-decoration: underline; }
.alert strong { color: inherit; }

/* empty state */
.empty, .empty-state { text-align: center; padding: 40px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); }
.empty .big, .empty-state .big { font-size: 28px; margin-bottom: 8px; opacity: .6; }
.empty svg, .empty-state svg { width: 32px; height: 32px; color: var(--faint); margin-bottom: 10px; }
.empty b, .empty-state b, .empty h3 { display: block; font-family: var(--display); font-size: 18px; text-transform: uppercase; font-weight: 600; color: var(--text); }
.empty p, .empty-state p { color: var(--muted); margin: 6px 0 14px; font-size: 13px; }
.empty p:last-child { margin-bottom: 0; }

/* toast (site-wide notifications, built by the layout script) */
.toast-hud { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99999; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #151226; border: 1px solid var(--accent-line); border-radius: var(--r-sm); box-shadow: 0 12px 40px rgba(0,0,0,.5); max-width: 360px; color: var(--text); text-decoration: none; animation: slideUp .25s ease; }
.toast-hud:hover { color: var(--text); border-color: var(--accent-2); }
.toast-hud ._ti { width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--accent-soft); border: 1px solid var(--accent-line); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.toast-hud ._tt { font-size: 13px; font-weight: 600; }
.toast-hud ._tb { font-size: 12px; color: var(--muted); margin-top: 2px; }
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* avatars */
.avatar, .av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); background: var(--panel-2); flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }
.av-fallback { display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--accent-3); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 50%; }

/* rating stars */
.stars, .rating { font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* tables */
.table-hud { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-hud th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-weight: 500; }
.table-hud td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-hud tr:hover td { background: var(--panel); }

/* auth pages */
.auth-wrap { min-height: 74vh; display: flex; align-items: center; justify-content: center; padding: 28px 0 60px; }
.auth-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 34px 32px; position: relative; }
.auth-icon { display: none; }
.auth-title { font-family: var(--display); font-size: 26px; font-weight: 700; text-transform: uppercase; color: var(--text); text-align: center; margin: 0 0 4px; }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 26px; }
.auth-links { text-align: center; margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.auth-links a { color: var(--muted); font-size: 13px; }
.auth-links a:hover { color: var(--accent-3); }
.auth-links .register-link { font-weight: 600; color: var(--accent-2); }
.remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.remember-row label { font-size: 13px; color: var(--muted); cursor: pointer; margin: 0; user-select: none; }
@media (max-width: 480px) { .auth-card { padding: 26px 20px; } }

/* brand mark (auth pages) */
.brand-mark { position: relative; width: 84px; height: 84px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.brand-mark img { width: 60%; }
.brand-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--accent-line); animation: brandSpin 40s linear infinite; }
.brand-ring::after { content: ""; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
@keyframes brandSpin { to { transform: rotate(360deg); } }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }

/* utilities */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.text-m { color: var(--m); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.rowx { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prose { max-width: 70ch; color: var(--muted); line-height: 1.7; font-size: 14.5px; }
.prose h2, .prose h3 { color: var(--text); font-size: 18px; text-transform: uppercase; margin: 28px 0 10px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 20px; }
.prose strong { color: var(--text); }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted) !important; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .35s ease both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* inline icon */
.ic { width: 1em; height: 1em; vertical-align: -.15em; flex-shrink: 0; fill: none; }
.ic-lg { width: 1.35em; height: 1.35em; }

/* grid children must be allowed to shrink below their content (nowrap text) */
.grid > *, .grid-2 > *, .grid-3 > *, .row2 > *, .row3 > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* icons inside buttons keep their size even inside .empty / .alert */
.empty .btn svg, .empty-state .btn svg, .alert .btn svg { width: 15px; height: 15px; margin: 0; color: currentColor; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT SCREEN (Messages/Chat, Groups/Chat)
   A fixed, full-height screen under the navbar: header, scrolling body on a
   WhatsApp-style backdrop, composer pinned to the bottom. chat-fit.js sizes it
   to the *visual* viewport so the composer stays above the phone keyboard.
   ═══════════════════════════════════════════════════════════════════════════ */
.chat-page { overflow: hidden; }
.chat-page footer.footer { display: none; }
.chat-page main { padding: 0 !important; }
.chat-screen { position: fixed; left: 0; right: 0; top: 57px; bottom: 0; z-index: 5; display: flex; flex-direction: column; background: var(--bg); }
.chat-col { flex: 1; min-height: 0; width: 100%; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; }
@media (min-width: 900px) { .chat-col { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-shrink: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.chat-head .back-link { margin: 0; padding: 6px; }
.chat-head .back-link span { display: none; }
.chat-head form { margin: 0; }
.chat-head .chat-avatar { width: 38px; height: 38px; }
.chat-head .chat-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .chat-name a { color: inherit; }
.chat-head .chat-status { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.chat-head .chat-status:empty { display: none; }
@media (max-width: 600px) { .chat-head .btn .lbl { display: none; } .chat-head .btn { padding: 0 10px; } }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 10px; scrollbar-width: thin;
  background-color: #100d1e;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='rgba(255,255,255,0.075)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='M22 30h26a6 6 0 0 1 6 6v14a6 6 0 0 1-6 6H36l-9 7v-7h-5a6 6 0 0 1-6-6V36a6 6 0 0 1 6-6z'/><circle cx='118' cy='40' r='11'/><path d='M118 29v22M107 40h22M110 32l16 16M126 32l-16 16'/><path d='M96 112c6-10 14-10 20 0s14 10 20 0'/><path d='M40 118l4 4-4 4-4-4z'/><path d='M60 84l5 11 12 1-9 8 3 12-11-6-11 6 3-12-9-8 12-1z'/><circle cx='138' cy='120' r='3'/><circle cx='20' cy='80' r='3'/><path d='M132 70l12 0M138 64l0 12'/><path d='M70 140c8 4 16 4 24 0'/></svg>"),
    linear-gradient(165deg, #1c1236 0%, #120e24 40%, #0d0c16 100%);
  background-size: 160px 160px, cover;
  background-attachment: local, fixed; }
.chat-foot { flex-shrink: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg-2); border-top: 1px solid var(--line); }
.chat-foot .composer, .chat-foot .input-bar { display: flex; gap: 8px; align-items: flex-end; margin: 0; padding: 0; border: 0; }
.chat-foot .form-control { flex: 1; min-height: 42px; height: 42px; max-height: 120px; padding: 10px 14px; line-height: 1.45; resize: none; font-size: 14px; border-radius: 21px !important; background: rgba(255,255,255,.06) !important; }
.chat-foot .send-btn, .chat-foot #send { width: 42px; height: 42px; padding: 0; border-radius: 50%; flex-shrink: 0; }
.chat-foot #send .lbl { display: none; }
.chat-foot .send-btn svg, .chat-foot #send svg { width: 17px; height: 17px; margin-left: 2px; }
/* bubbles: WhatsApp shape, brand colours; class names are built by the page scripts */
.chat-body .msg-row { display: flex; gap: 6px; align-items: flex-end; }
.chat-body .msg-row.mine { flex-direction: row-reverse; }
.chat-body .msg-inner { display: flex; flex-direction: column; max-width: min(78%, 520px); position: relative; }
.chat-body .msg-row.mine .msg-inner { align-items: flex-end; }
.chat-body .bubble { position: relative; padding: 8px 12px 20px; border-radius: 12px; font-size: 14px; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); box-shadow: 0 1px 1px rgba(0,0,0,.35); min-width: 64px; }
.chat-body .bubble-theirs { background: #1e1c2c; border: 1px solid rgba(255,255,255,.06); border-bottom-left-radius: 3px; }
.chat-body .bubble-mine { background: linear-gradient(135deg, #4b32a8, #3a2588); border: 1px solid rgba(167,139,250,.35); border-bottom-right-radius: 3px; }
.chat-body .bubble.deleted { color: var(--faint); font-style: italic; }
/* time sits inside the bubble's bottom-right corner (bubble reserves 20px) */
.chat-body .msg-time, .chat-body .b-time { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: rgba(240,240,245,.55); margin-top: -18px; padding: 0 10px 4px 0; align-self: flex-end; position: relative; pointer-events: none; }
.chat-body .b-name { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--accent-2); margin: 0 0 3px 4px; }
.chat-body .msg-av { display: none; }
.chat-body .m-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--accent-line); font-family: var(--mono); font-size: 10px; color: var(--accent-3); }
.chat-body .msg-row.mine .m-avatar { display: none; }
.chat-body .date-divider, .chat-body .sys { align-self: center; max-width: 86%; text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(240,240,245,.6); background: rgba(13,13,20,.7); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin: 6px 0; }
.chat-body .date-divider::before, .chat-body .date-divider::after { display: none; }
.chat-body .empty-chat { margin: auto; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 40px 20px; }
.chat-body .load-older { align-self: center; margin-bottom: 6px; }
.chat-foot .block-bar { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 0; padding: 4px 0; border: 0; }
.chat-foot .blocked-notice { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--faint); text-align: center; }
.chat-foot .locked { margin: 0; padding: 6px 0; border: 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.chat-foot .err-toast { margin: 0 0 8px; }
/* Safari zooms the whole page when a focused field is under 16px, and keeps the zoom after the
   keyboard closes (content cut off on the right, screen shifted down). Chat fields stay at 16px
   on touch-sized screens so that never triggers. */
@media (max-width: 900px) {
  .chat-page .chat-foot textarea, .chat-page .chat-foot input { font-size: 16px !important; }
  .chat-page .chat-foot .form-control { touch-action: manipulation; }
}

/* flash notices rendered by _Flash.cshtml at the top of every page */
.flash-wrap { max-width: 1140px; margin: 20px auto -4px; }
.flash-wrap .alert { margin-bottom: 8px; }
.flash-wrap .alert span { color: inherit; }
