/* Bitamin web app. Colours sampled from the Bitamin logo. */
:root {
  --bg: #0a0a0a;
  --bg-2: #0d0c0b;
  --surface: #141312;
  --surface-2: #1a1816;
  --line: #262320;
  --line-2: #34302b;
  --text: #ebe1d5;
  --muted: #a39a8e;
  --quiet: #8c8378;
  --orange: #d17134;
  --orange-hi: #e0823f;
  --orange-soft: #1f1712;
  --orange-line: #4a3a2e;
  --orange-text: #e8955c;
  --green: #3dbe7a;
  --green-bg: #0f1f16;
  --green-line: #23573a;
  --green-text: #6fe0a2;
  --amber: #f2b23a;
  --amber-bg: #22190b;
  --amber-line: #5a4220;
  --amber-text: #f2c77a;
  --red: #ef5a4f;
  --red-bg: #250f0d;
  --red-line: #6a2420;
  --red-text: #ff8f86;
  --radius: 14px;
  --font: Inter, 'IBM Plex Sans Arabic', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
#root { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 900px) { #root.wide { max-width: 1100px; } }
a { color: var(--orange); }
a:hover { color: var(--orange-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.screen { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.screen.padded { padding: 12px 20px 28px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.muted { color: var(--muted); }
.quiet { color: var(--quiet); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
h1, h2, h3 { margin: 0; }
.h-display { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 20px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--quiet); text-transform: uppercase; }
p { margin: 0; line-height: 1.5; }

/* top bar + tabs */
.topbar { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 8px 12px 0; }
.topbar-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar-title h1 { font-size: 16px; font-weight: 600; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text); background: transparent; border: 0; cursor: pointer; text-decoration: none; flex: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.tabbar { position: sticky; bottom: 0; display: flex; justify-content: space-around; border-top: 1px solid #1f1d1a; background: var(--bg-2); padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; min-height: 48px; justify-content: center; font-size: 11px; font-weight: 500; color: var(--quiet); text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.on, .tab.on:hover { color: var(--orange); }
.tab-icon { position: relative; display: inline-flex; }
.dot { position: absolute; top: -4px; inset-inline-end: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--orange); color: #0a0a0a; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: var(--radius); border: 0; font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; width: 100%; }
.btn-primary { background: var(--orange); color: #0a0a0a; }
.btn-primary:hover { background: var(--orange-hi); color: #0a0a0a; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--red-text); border: 1px solid var(--red-line); }
.btn:disabled { background: #2a2724; color: #7e766c; border-color: transparent; cursor: not-allowed; }
.btn-sm { min-height: 40px; font-size: 14px; border-radius: 10px; width: auto; padding: 0 14px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--quiet); text-transform: uppercase; }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); outline: none; font-size: 16px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--orange); }
.input.big { font-family: var(--display); font-size: 28px; font-weight: 600; min-height: 64px; }
.input.mono { font-family: var(--mono); font-size: 14px; }
/* Phones: iOS zooms into any field under 16px when it is tapped, and double-tap zoom gets in the way of buttons. */
@media (pointer: coarse) { .input.mono { font-size: 16px; } }
html { touch-action: manipulation; }
.field-hint { font-size: 12.5px; color: var(--quiet); }
.field-error { font-size: 12.5px; color: var(--red-text); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.segmented button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.segmented button.on { background: var(--orange); color: #0a0a0a; }
/* Three options, or long labels ("USDT · TRC-20"): tighter type so nothing wraps mid-word. */
.segmented.compact button { font-size: 13px; padding: 0 4px; white-space: nowrap; letter-spacing: -.01em; }
/* Status words that arrive lowercase from the server ("pending") read as labels. */
.badge.cap { display: inline-block; }
.badge.cap::first-letter { text-transform: uppercase; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: default; }
button.chip { cursor: pointer; }
.chip.on { background: #2b1c12; color: var(--orange-text); border-color: var(--orange); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; min-height: 44px; }
.checkbox input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--orange); flex: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-accent { background: var(--orange-soft); border-color: var(--orange-line); }
.card-green { background: var(--green-bg); border-color: var(--green-line); }
.card-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.card-red { background: var(--red-bg); border-color: var(--red-line); }
a.card { color: var(--text); text-decoration: none; }
a.card:hover { border-color: var(--orange-line); color: var(--text); }
.divider { height: 1px; background: var(--line); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv > :first-child { color: var(--muted); }
.kv > :last-child { font-weight: 600; text-align: end; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat-value { font-family: var(--display); font-size: 21px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--muted); }
.avatar { flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar-orange { background: var(--orange); color: #0a0a0a; }
.avatar-cream { background: var(--text); color: #0a0a0a; }
.avatar-grey { background: #3a3631; color: var(--text); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #1e1d1b; color: var(--muted); white-space: nowrap; }
.badge.tier-3 { background: #2b1c12; color: var(--orange-text); }
.badge.tier-2 { background: #2a2621; color: var(--text); }
.badge.green { background: #10251a; color: var(--green); }
.badge.amber { background: #2a1f0e; color: var(--amber-text); }
.badge.red { background: #2a1210; color: var(--red-text); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); }
.notice > svg { flex: none; margin-top: 1px; color: var(--orange); }
.notice-amber { background: #2a1f0e; border-color: var(--amber-line); color: #f2d9ac; }
.notice-amber > svg, .notice-amber strong { color: var(--amber-text); }
.notice-red { background: var(--red-bg); border-color: var(--red-line); color: #f2c4bf; }
.notice-red > svg, .notice-red strong { color: var(--red-text); }
.notice-green { background: var(--green-bg); border-color: var(--green-line); color: #c3e8d2; }
.notice-green > svg { color: var(--green); }

/* trader list */
.trader { display: flex; gap: 12px; align-items: center; }
.trader-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trader-name { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 14.5px; }
.trader-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.trader-rate strong { font-size: 15px; }

/* radar map */
.radar { position: relative; aspect-ratio: 1.45; border-radius: var(--radius); overflow: hidden; background: #0f0e0d; border: 1px solid var(--line); }
.radar svg { width: 100%; height: 100%; display: block; }
.radar-note { position: absolute; inset-inline-end: 10px; bottom: 8px; font-size: 11px; color: var(--muted); background: rgba(10,10,10,.8); padding: 3px 7px; border-radius: 6px; }
.pin { cursor: pointer; }
.pin:focus-visible { outline: none; }
.pin:focus-visible circle.halo { stroke: var(--text); stroke-width: 2; }

/* verdict */
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid; }
.verdict strong { display: block; font-size: 17px; font-weight: 700; }
.verdict-sub { display: block; font-size: 12.5px; margin-top: 2px; }
.verdict-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #0a0a0a; }
.verdict-green { background: var(--green-bg); border-color: var(--green-line); }
.verdict-green .verdict-icon { background: var(--green); } .verdict-green strong { color: var(--green-text); } .verdict-green .verdict-sub { color: #a9c9b6; }
.verdict-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.verdict-amber .verdict-icon { background: var(--amber); } .verdict-amber strong { color: var(--amber-text); } .verdict-amber .verdict-sub { color: #d9c29a; }
.verdict-red { background: var(--red-bg); border-color: var(--red-line); }
.verdict-red .verdict-icon { background: var(--red); } .verdict-red strong { color: var(--red-text); } .verdict-red .verdict-sub { color: #d9a9a4; }
.verdict-hold { background: var(--surface); border-color: var(--line-2); }
.verdict-hold .verdict-icon { background: #4a443d; color: var(--text); } .verdict-hold .verdict-sub { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checkrow { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--surface-2); }
.checkrow-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; margin-top: 1px; }
.s-pass .checkrow-icon { background: #10251a; color: var(--green); }
.s-warn .checkrow-icon, .s-unavailable .checkrow-icon { background: #2a1f0e; color: var(--amber); }
.s-fail .checkrow-icon { background: #2a1210; color: var(--red); }
.s-skipped .checkrow-icon { background: var(--surface-2); color: var(--quiet); }
.checkrow-text { display: flex; flex-direction: column; gap: 1px; }
.checkrow-name { font-size: 13.5px; font-weight: 600; }
.checkrow-detail { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.s-warn .checkrow-detail, .s-unavailable .checkrow-detail { color: var(--amber-text); }

/* trade room */
.steps { display: flex; gap: 6px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.step.done { background: var(--green); }
.step.now { background: var(--orange); }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg-them { align-self: flex-start; background: var(--surface-2); border-end-start-radius: 4px; }
.msg-me { align-self: flex-end; background: #3a2516; border-end-end-radius: 4px; }
.msg-system { align-self: center; max-width: 92%; font-size: 12px; color: var(--quiet); text-align: center; padding: 2px 8px; }
.msg-locked { font-style: italic; color: var(--quiet); }
.composer { display: flex; gap: 8px; align-items: center; }
.composer .input { min-height: 44px; border-radius: 22px; }
.tick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: start; width: 100%; cursor: pointer; min-height: 56px; color: var(--text); }
.tick:hover { border-color: var(--orange-line); }
.tick-box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #4a443d; display: flex; align-items: center; justify-content: center; }
.tick.on .tick-box { background: var(--green); border-color: var(--green); color: #0a0a0a; }
.stars { display: flex; gap: 4px; justify-content: center; }
.stars button { width: 52px; height: 52px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: #5a534b; display: flex; align-items: center; justify-content: center; }
.stars button.on { color: var(--orange); }
.stars button.on svg { fill: var(--orange); }

/* misc */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--orange); animation: spin .9s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 0; flex: 1; }
.empty { text-align: center; padding: 32px 12px; display: flex; flex-direction: column; gap: 6px; }
.toaster { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(440px, calc(100% - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: #2a2724; color: var(--text); font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast-error { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-line); }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--orange); border-radius: 4px; }
.welcome-hero { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-top: 36px; }
.welcome-hero img.mark { width: 97px; height: auto; }
.welcome-hero img.word { width: 272px; height: auto; }
.welcome-hero img.tagline-img { width: 200px; height: auto; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--orange-soft); color: var(--orange); display: flex; align-items: center; justify-content: center; }
.demo-bar { font-size: 11.5px; text-align: center; padding: 6px 12px; background: #2a1f0e; color: var(--amber-text); border-bottom: 1px solid var(--amber-line); }

/* admin */
.admin { padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin th { text-align: left; color: var(--quiet); font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--line); }
.admin td { padding: 10px 8px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.admin .scroll { overflow-x: auto; }
.admin pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 10px; margin: 0; max-height: 320px; overflow: auto; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }

/* ===================== v0.2: dating-style discovery, sheets, map, rooms ===================== */
body.no-scroll { overflow: hidden; }
.padded-x { padding-left: 20px; padding-right: 20px; }
.wrap { flex-wrap: wrap; }
.center-col { align-items: center; text-align: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--orange-text); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.btn-soft { background: var(--orange-soft); color: var(--orange-text); border: 1px solid transparent; }
.btn-soft:hover { background: #2b1c12; color: var(--orange-text); }
.btn-danger:hover { background: var(--red-bg); color: var(--red-text); }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip svg { margin-inline-end: 5px; }

/* badges */
.badge.pro { background: linear-gradient(90deg, #3a2414, #2b1c12); color: #f3b27c; border: 1px solid var(--orange-line); }
.avatar { position: relative; }
.avatar-ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--orange); }
.avatar-online { position: absolute; inset-inline-end: 2%; bottom: 2%; width: 26%; height: 26%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }
.online-text { color: var(--green-text); }
.fav-on { color: var(--orange); }
.bio { font-size: 15px; line-height: 1.55; color: #ddd2c4; }

/* discover */
.screen.discover { gap: 12px; }
.list-sheet { position: relative; margin-top: -26px; z-index: 2; background: var(--bg); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); padding: 10px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 4px; flex: none; }
.trader-card { position: relative; padding: 14px 16px; }
.trader-card.featured { border-color: var(--orange-line); background: linear-gradient(180deg, #1a130e, var(--surface)); }
.featured-tag { position: absolute; top: -9px; inset-inline-end: 14px; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--orange); color: #0a0a0a; }
.trader-name { flex-wrap: wrap; }

/* map */
.map { position: relative; overflow: hidden; background-color: #0e0d0c; touch-action: none; user-select: none; -webkit-user-select: none;
  background-image: linear-gradient(#1b1916 1px, transparent 1px), linear-gradient(90deg, #1b1916 1px, transparent 1px); background-size: 48px 48px; }
.map-tiles { position: absolute; inset: 0; filter: sepia(.35) saturate(.75) hue-rotate(-8deg) brightness(.95); }
.map-tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-me { position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 6px rgba(235,225,213,.22); z-index: 2; }
.map-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; padding: 0; background: none; cursor: pointer; z-index: 3; }
.map-halo { position: absolute; border-radius: 50%; background: rgba(209,113,52,.13); border: 1.5px dashed rgba(209,113,52,.6); pointer-events: none; }
.map-dot { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.map-pin.tone-orange .map-dot { background: var(--orange); color: #0a0a0a; }
.map-pin.tone-cream .map-dot { background: var(--text); color: #0a0a0a; }
.map-pin.tone-grey .map-dot { background: #3a3631; color: var(--text); }
.map-pin.featured .map-dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--orange), 0 3px 10px rgba(0,0,0,.45); }
.map-pin:focus-visible .map-dot { outline: 2px solid var(--text); outline-offset: 3px; }
.map-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 4; }
.map-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(20,19,18,.92); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.map-note { position: absolute; left: 10px; top: 10px; font-size: 11px; color: var(--muted); background: rgba(10,10,10,.82); padding: 3px 8px; border-radius: 6px; z-index: 4; }
.map-attrib { position: absolute; left: 8px; bottom: 30px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; color: #8c8378; background: rgba(10,10,10,.7); padding: 1px 5px; border-radius: 4px; z-index: 4; }

/* sheets and dialogs */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { width: min(480px, 100%); max-height: 88dvh; background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; outline: none; animation: rise .2s ease-out; }
.sheet-head { padding-block: 0; padding-inline: 20px 12px; }
.sheet-body { overflow-y: auto; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 0; background: none; border: 0; color: var(--text); font-size: 15px; text-decoration: none; cursor: pointer; text-align: start; }
.menu-item:hover { color: var(--text); }
.menu-item.danger { color: var(--red-text); }
.menu-card { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.menu-card .menu-item + .menu-item { border-top: 1px solid var(--surface-2); }

/* sticky bottom action bar */
.sticky-footer { position: sticky; bottom: 0; z-index: 10; display: flex; flex-direction: column; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(10,10,10,0), var(--bg) 22%); }

/* rooms (trade and "say hi") */
.screen.room { gap: 10px; min-height: 100dvh; }
.room-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.chat .msgs { flex: 1; padding-top: 6px; }
.chat .composer { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.iconbtn.send { background: var(--orange-soft); color: var(--orange); width: 48px; height: 48px; }
.iconbtn.send:disabled { opacity: .5; }
.msg-me { background: #3a2516; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); flex: none; }
.addr-row { padding: 14px; }

/* billing, pro, guides */
.pro-hero { display: flex; flex-direction: column; gap: 10px; }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #ddd2c4; }
.perks li { display: flex; gap: 8px; align-items: flex-start; }
.perks svg { color: var(--green); flex: none; margin-top: 2px; }
.amount-exact { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: .01em; margin: 0; }
.amount-exact mark { background: var(--orange-soft); color: var(--orange-text); border-radius: 6px; padding: 0 3px; }
.amount-exact small { font-size: 15px; color: var(--muted); }
.sign-msg { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
.guide p { font-size: 15.5px; line-height: 1.6; color: #ddd2c4; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.map-radius { position: absolute; left: 0; top: 0; border-radius: 50%; border: 1.5px dashed rgba(235,225,213,.22); pointer-events: none; z-index: 1; }
.map-btn:disabled { opacity: .4; cursor: default; }
.map { cursor: grab; }
.map:active { cursor: grabbing; }

/* map clusters and the meeting-point picker */
.map-cluster { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; padding: 0; background: none; cursor: pointer; z-index: 3; }
.map-cluster .map-dot { background: var(--bg-2); color: var(--orange-text); border: 2px solid var(--orange); font-size: 15px; width: 42px; height: 42px; margin: -21px 0 0 -21px; }
.map-cluster.featured .map-dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--orange), 0 3px 10px rgba(0,0,0,.45); }
.map-picker { border-radius: 14px; border: 1px solid var(--line); flex: none; }
.map-center-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: var(--orange); z-index: 5; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.map-center-pin::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 8px; height: 4px; margin-left: -4px; border-radius: 50%; background: rgba(0,0,0,.5); }

/* shared meeting point */
.loc-card { width: min(300px, 86%); border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface-2); }
.loc-card.mine { border-color: var(--orange-line); background: #22170f; }
.static-map { position: relative; overflow: hidden; background-color: #0e0d0c; }
.static-map .map-tiles img { position: absolute; left: 0; top: 0; max-width: none; }
.static-pin { position: absolute; transform: translate(-50%, -100%); color: var(--orange); filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.loc-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.loc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.loc-links .btn-sm { min-height: 34px; padding: 0 10px; font-size: 12.5px; }
.loc-btn { color: var(--orange); flex: none; }
.loc-btn[aria-disabled="true"] { color: var(--quiet); opacity: .6; }

.coords { white-space: nowrap; word-break: normal; }

/* ---------- Languages: Arabic (right-to-left) and French ---------- */
[dir=rtl] .flip-rtl { transform: scaleX(-1); }
/* Maps are drawn by script in screen coordinates, so they stay left-to-right. */
.map, .static-map { direction: ltr; }
.map-note { unicode-bidi: plaintext; }
/* Addresses, hashes and amounts always read left-to-right, also inside Arabic text. */
.mono { unicode-bidi: isolate; }
[dir=rtl] .mono { direction: ltr; text-align: right; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* Arabic letters join up; letter-spacing would pull them apart. */
:root[lang=ar] .label, :root[lang=ar] .field label, :root[lang=ar] .featured-tag { letter-spacing: 0; text-transform: none; }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.lang-switch button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lang-switch button.on { background: var(--surface-2); color: var(--text); }
.lang-switch button:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.lang-switch.compact button { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
/* Short addresses in key-value rows never wrap mid-address; the label wraps instead. */
.kv .mono { white-space: nowrap; word-break: normal; }

/* Language menu: a globe that opens a short list (welcome screen) */
.lang-menu { position: relative; }
.lang-menu-btn { width: 40px; height: 40px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.lang-menu-btn:hover, .lang-menu-btn[aria-expanded=true] { color: var(--text); background: var(--surface-2); }
.lang-menu-list { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 176px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0,0,0,.5); z-index: 30; display: flex; flex-direction: column; animation: fade .12s ease-out; }
.lang-menu-list .menu-item { min-height: 44px; padding: 0 10px; border-radius: 10px; }
.lang-menu-list .menu-item:hover { background: var(--surface-2); }
.lang-menu-list .menu-item[aria-checked=true] { color: var(--orange-text); }

/* Brand lockup in headers: the capsule mark beside the wordmark */
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { display: block; width: auto; }

/* Proof of trade: finding the transfer, pasting a hash */
.hash-row { display: flex; gap: 8px; align-items: stretch; }
.hash-row .input { flex: 1; min-width: 0; }
.hash-row .paste { min-height: 52px; border-radius: var(--radius); flex: none; }
/* Hashes are monospace, but the placeholder is a sentence (Arabic letters look torn apart in a mono font). */
.input.mono::placeholder { font-family: var(--font); font-size: 15px; letter-spacing: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--quiet); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
:root[lang=ar] .or { letter-spacing: 0; text-transform: none; }
.found { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.proof-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--surface-2); }
.ext { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.howto { margin: 0; padding-inline-start: 20px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.5; color: #ddd2c4; }
