/* Sabeel styles. One home for every section (travel, guide), a bottom bar to move between them,
   one + button to add. Sheets slide up from the bottom. Logical properties keep Arabic (RTL) right. */
:root {
  --bg: #f5f2ec; --surface: #ffffff; --raise: #faf8f4; --fg: #15201e; --muted: #5d6965; --line: #e2ddd2;
  --accent: #1c3561; --accent-ink: #ffffff; --gold: #c9a24a; --ocean: #e3e8ef; --land: #d2d6dc; --land-line: #ffffff;
  --st-lived: #11663a; --st-visited: #2f9e57; --st-transit: #d8961a; --st-planned: #7b4fd0; --st-wish: #3f86e6; --st-noway: #cc4242;
  --pin-summit: #8a5320; --pin-dive: #0a87a8; --pin-race: #d9481f; --pin-city: #3d4a5e; --pin-landmark: #a3366f; --pin-other: #6b7280;
  --food: #b9532b; --conv: #b8891f;
  --danger: #b3312b;
  --display: "sans-serif-condensed", "Roboto Condensed", "Arial Narrow", "Avenir Next Condensed", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --nav-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1220; --surface: #161b2c; --raise: #1d2336; --fg: #e8ebf3; --muted: #9aa3b8; --line: #283048;
    --accent: #9db6ec; --accent-ink: #0b1430; --gold: #e6c06a; --ocean: #111829; --land: #2b3348; --land-line: #111829;
    --st-lived: #3fbf74; --st-visited: #6fd890; --st-transit: #f0b440; --st-planned: #a988f0; --st-wish: #6aa7f5; --st-noway: #ee7070;
    --pin-summit: #d9a066; --pin-dive: #43c4e6; --pin-race: #ff8a5c; --pin-city: #b8c3d6; --pin-landmark: #ea7cb7; --pin-other: #a3abb8;
    --food: #f08a5d; --conv: #f2c14e;
    --danger: #f08a82; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--nav-h) + 88px + env(safe-area-inset-bottom, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
/* Arabic: no letter-spacing (it breaks joined letters) and no forced capitals */
:lang(ar) * { letter-spacing: 0 !important; text-transform: none !important; }
:lang(ar) body { font-size: 16px; }
/* Japanese: no forced capitals or wide tracking; the condensed display face has no Japanese, so use the body face */
:lang(ja) * { letter-spacing: 0 !important; text-transform: none !important; }
:lang(ja) { --display: var(--body); }
:lang(ja) body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
/* Chinese: the same as Japanese */
:lang(zh) * { letter-spacing: 0 !important; text-transform: none !important; }
:lang(zh) { --display: var(--body); }
:lang(zh) body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
.wrap { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font: 800 26px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
h1 img { width: 30px; height: 30px; display: block; }
.share-url { font: 500 13px var(--mono); word-break: break-all; color: var(--fg); direction: ltr; text-align: start; }
.top-r { display: flex; gap: 10px; align-items: center; }
.save { font: 500 12px var(--mono); color: var(--muted); }
.save[data-state="error"] { color: var(--danger); }
.note { margin: 0; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note b { color: var(--fg); }
.smallbtn { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.screen { display: grid; gap: 18px; align-content: start; }
.scr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.scr-head h2 { margin: 0; font: 800 28px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- home ---------- */
.homecards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .homecards { grid-template-columns: 1fr 1fr; } }
.hcard { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: start; position: relative; overflow: hidden; }
.hcard:hover { border-color: var(--accent); }
.hcard .kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hcard .kicker svg { width: 18px; height: 18px; color: var(--accent); }
.hcard .hero { display: flex; align-items: flex-end; gap: 12px; }
.hcard .big { font: 800 clamp(64px, 18vw, 96px)/0.8 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.hcard .big.food { color: var(--food); }
.hero-txt { display: grid; gap: 2px; padding-bottom: 2px; }
.hero-txt b { font-weight: 600; font-size: 16px; }
.hero-txt span { color: var(--muted); font-size: 13px; }
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--raise); min-width: 0; }
.mini .lab { font-size: 11px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.mini .num { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.mini .num small { font: 400 12px var(--mono); color: var(--muted); }
.mini .bar { margin-top: 2px; }
.hcard .hint { font-size: 13px; color: var(--muted); }
.recent { display: grid; }
.rec { display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; min-height: 52px; }
.rec .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--raise); font-size: 18px; line-height: 1; }
.rec .rt { flex: 1; }
.rec .when { font: 400 12px var(--mono); color: var(--muted); white-space: nowrap; }
.linkish { justify-self: start; background: none; border: 0; padding: 6px 0; color: var(--accent); font-weight: 600; }
.sec-t { margin: 8px 0 0; font: 700 20px var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.sec-d { margin: 0; color: var(--muted); font-size: 13px; max-width: 65ch; }
.bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* ---------- bottom bar and + ---------- */
.bottomnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 15; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px)); }
.bottomnav .core { display: flex; flex: 0 0 auto; }
.bottomnav .core button { min-width: 64px; }
.bottomnav .in { display: flex; flex: 1; min-width: 0; max-width: 560px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.bottomnav .in::-webkit-scrollbar { display: none; }
.bottomnav .in.scrolls button { flex: 0 0 auto; min-width: 72px; scroll-snap-align: start; }
.bottomnav .you { flex: 0 0 auto; min-width: 64px; border-inline-start: 1px solid var(--line); }
.bottomnav button { position: relative; flex: 1; min-width: 0; height: var(--nav-h); display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.bottomnav button svg { width: 24px; height: 24px; }
.bottomnav .nbadge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center; }
#msTabs { display: none !important; }
.modlist { display: grid; gap: 4px; }
.modrow { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.modrow:last-child { border-bottom: 0; }
.modrow .ico svg { width: 26px; height: 26px; color: var(--accent); }
.modrow .rt { display: grid; gap: 2px; min-width: 0; }
.modrow .meta { font-size: 13px; color: var(--muted); }
.modrow .btn { min-width: 84px; }
.bottomnav button[aria-current="page"] { color: var(--accent); }
.bottomnav button[aria-current="page"] svg { stroke-width: 2.3; }
.fab { position: fixed; z-index: 16; inset-inline-end: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(20, 30, 60, 0.28); }
.fab svg { width: 28px; height: 28px; }
.actlist { display: grid; gap: 10px; }
.act { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: start; }
.act:hover { border-color: var(--accent); }
.act .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--raise); color: var(--accent); }
.act .ico svg { width: 24px; height: 24px; }
.act b { display: block; font-size: 16px; }
.act span span { display: block; color: var(--muted); font-size: 13px; }

/* ---------- section picker ---------- */
.picker { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.picker .in { max-width: 560px; margin: 0 auto; display: grid; gap: 18px; }
.picker .brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker .brand h1 { font-size: 30px; }
.langsw { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.langsw button { border: 0; background: none; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.langsw button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.picker h2 { margin: 6px 0 0; font: 800 32px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.picker .lead { margin: 0; color: var(--muted); }
.tiles { display: grid; gap: 12px; }
.tile { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: start; }
.tile .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--raise); color: var(--accent); }
.tile .ico svg { width: 26px; height: 26px; }
.tile b { display: block; font-size: 17px; }
.tile span span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile .tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.tile .tick svg { width: 16px; height: 16px; }
.tile[aria-pressed="true"] { border-color: var(--accent); }
.tile[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.picker .btn { justify-self: stretch; padding: 14px; font-size: 16px; text-align: center; }

/* ---------- travel ---------- */
.mapcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.map { position: relative; background: var(--surface); aspect-ratio: 9600 / 4992; max-width: 100%; direction: ltr; }
.map svg { display: block; width: 100%; height: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.map svg.zoomed { touch-action: none; cursor: grab; }
.map svg.picking { cursor: crosshair; }
.map .sphere { fill: var(--ocean); }
.map path.land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.6; vector-effect: non-scaling-stroke; cursor: pointer; }
.map path.land:hover { filter: brightness(0.93); }
.map path.ov { stroke-width: 0.45; }
.map path.nocode { cursor: default; }
.map circle.dot { fill: var(--land); stroke: var(--surface); stroke-width: 0.8; vector-effect: non-scaling-stroke; cursor: pointer; }
.map .s-lived { fill: var(--st-lived) !important; }
.map .s-visited { fill: var(--st-visited) !important; }
.map .s-transit { fill: var(--st-transit) !important; }
.map .s-planned { fill: var(--st-planned) !important; }
.map .s-wish { fill: var(--st-wish) !important; }
.map .s-noway { fill: var(--st-noway) !important; }
.map .pin { stroke: var(--surface); stroke-width: 1.4; vector-effect: non-scaling-stroke; cursor: pointer; }
.map .pin.t-summit { fill: var(--pin-summit); } .map .pin.t-dive { fill: var(--pin-dive); } .map .pin.t-race { fill: var(--pin-race); }
.map .pin.t-city { fill: var(--pin-city); } .map .pin.t-landmark { fill: var(--pin-landmark); } .map .pin.t-other { fill: var(--pin-other); }
.map .pin.draft { fill: var(--accent); }
.zoom { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.zoom button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.pickbar { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 600; }
.pickbar button { background: transparent; color: var(--bg); border: 1px solid currentColor; border-radius: 6px; padding: 4px 10px; font-size: 13px; }
:lang(ar) .pickbar { direction: rtl; }
.tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; color: var(--fg); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw.s-lived { background: var(--st-lived); } .sw.s-visited { background: var(--st-visited); } .sw.s-transit { background: var(--st-transit); }
.sw.s-planned { background: var(--st-planned); } .sw.s-wish { background: var(--st-wish); } .sw.s-noway { background: var(--st-noway); } .sw.s- { background: var(--land); }
.pd { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; display: inline-block; flex: none; }
.pd.t-summit { background: var(--pin-summit); } .pd.t-dive { background: var(--pin-dive); } .pd.t-race { background: var(--pin-race); }
.pd.t-city { background: var(--pin-city); } .pd.t-landmark { background: var(--pin-landmark); } .pd.t-other { background: var(--pin-other); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 5; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }

.tabpanel { display: grid; gap: 14px; align-content: start; }
.controls { display: grid; gap: 10px; }
.crow { display: flex; gap: 8px; flex-wrap: wrap; }
.field { padding: 10px 12px; font-size: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
#q, #gq { flex: 2 1 220px; } #listSel { flex: 1 1 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--fg); color: var(--fg); font-weight: 600; }
.chip .n { font: 400 12px var(--mono); }
.chip .x2 { font-size: 15px; line-height: 1; }
.listhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.listhead h2 { margin: 0; font: 700 22px var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.listhead span { font: 400 13px var(--mono); color: var(--muted); }
h3.group { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 2px; font: 600 15px var(--body); }
h3.group span { font: 400 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.rows { display: grid; }
@media (min-width: 760px) { .rows { grid-template-columns: 1fr 1fr; column-gap: 28px; } }
.row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); min-height: 54px; min-width: 0; }
.row .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; text-align: start; }
.flag { width: 30px; flex: none; text-align: center; font-size: 22px; line-height: 1; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.flag.txt { font: 600 10px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 4px 0; }
.rt { display: grid; min-width: 0; }
.rt .nm { font-weight: 500; overflow-wrap: anywhere; }
.rt .meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.via { font-weight: 400; color: var(--muted); }
.quick { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: transparent; }
.quick svg { width: 18px; height: 18px; }
.quick[aria-pressed="true"] { background: var(--st-visited); border-color: var(--st-visited); color: var(--surface); }
.quick.lived[aria-pressed="true"] { background: var(--st-lived); border-color: var(--st-lived); }
.quick:hover { border-color: var(--st-visited); color: var(--st-visited); }
.quick[aria-pressed="true"]:hover { color: var(--surface); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; margin: 0; }
.pinrow .ico { width: 30px; flex: none; display: grid; place-items: center; }
.pinrow .ico .pd { width: 14px; height: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: start; }
.card:hover { border-color: var(--accent); }
.card .t { font-weight: 600; } .card .d { font-size: 12px; color: var(--muted); }
.card .num { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.card .num small { font: 400 13px var(--mono); color: var(--muted); }
.conts { display: flex; flex-wrap: wrap; gap: 8px; }
.cont { padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.cont.on { border: 1px solid var(--st-visited); color: var(--fg); background: var(--raise); font-weight: 600; }

.year { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.year .y { font: 800 28px/1 var(--display); color: var(--accent); }
.year .items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ybtn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.ybtn.first { border-color: var(--st-visited); font-weight: 600; }

/* ---------- guide ---------- */
.spots { display: grid; gap: 8px; }
@media (min-width: 760px) { .spots { grid-template-columns: 1fr 1fr; } }
.spot { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px 4px 4px; min-height: 68px; }
:lang(ar) .spot { padding: 4px 4px 4px 8px; }
.spot.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); } 100% { border-color: var(--line); box-shadow: none; } }
.spot .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 8px; text-align: start; }
.spot .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--raise); color: var(--food); }
.spot .ico svg { width: 22px; height: 22px; }
.spot.been .ico { background: var(--food); color: #fff; }
.spot .nm { font-size: 16px; font-weight: 600; }
.spot .meta { font-size: 13px; }
.go { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--raise); display: grid; place-items: center; color: var(--accent); }
.go svg { width: 18px; height: 18px; }
.conv { display: inline-flex; gap: 2px; color: var(--conv); font-size: 12px; letter-spacing: 1px; }
.city { margin: 10px 2px 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.addrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; border: 1.5px dashed var(--accent); background: transparent; color: var(--accent); font-weight: 600; text-align: start; }
.addrow svg { width: 22px; height: 22px; flex: none; }
.emptybox { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 12px; color: var(--muted); }
.okbar { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--st-visited) 14%, var(--surface)); color: var(--fg); font-weight: 600; font-size: 14px; }
.okbar span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { border-color: var(--accent); color: var(--fg); background: var(--raise); }
.cand { display: grid; gap: 2px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: start; }
.cand:last-child { border-bottom: 0; }
.cand b { font-weight: 600; }
.cand span { color: var(--muted); font-size: 12px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl a { color: var(--accent); }

/* ---------- settings ---------- */
.panel { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: 720px; }
.panel h3 { margin: 0; font-size: 16px; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; max-width: 65ch; }
.btn { justify-self: start; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.status-line { font: 400 13px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
:lang(ar) .status-line { font-family: var(--body); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 20, 0.45); z-index: 20; }
.sheet { position: fixed; z-index: 21; background: var(--surface); color: var(--fg); overflow-y: auto; display: grid; align-content: start; gap: 18px;
  left: 0; right: 0; bottom: 0; max-height: 90vh; border-radius: 14px 14px 0 0; overscroll-behavior: contain;
  padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
@media (min-width: 760px) {
  .sheet { inset-inline-start: auto; inset-inline-end: 0; top: 0; width: 440px; max-height: none; border-radius: 0; border-inline-start: 1px solid var(--line);
    padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(24px + env(safe-area-inset-bottom, 0px)) 22px; }
}
.sh-head { display: flex; gap: 12px; align-items: flex-start; }
.sh-head .flag { font-size: 40px; width: 52px; }
.sh-head .flag.txt { font-size: 13px; padding: 10px 0; }
.sh-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sh-title h2 { margin: 0; font: 800 28px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.sh-title .meta { color: var(--muted); font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: inherit; }
.x { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--raise); font-size: 18px; line-height: 1; }
.sh-sec { display: grid; gap: 8px; }
.lab, .sh-sec > .lab { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
:lang(ar) .lab { font-size: 13px; }
.mem { display: flex; flex-wrap: wrap; gap: 6px; }
.mem span { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--raise); border: 1px solid var(--line); }
.stgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stb { display: grid; justify-items: start; gap: 6px; padding: 10px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); text-align: start; font-size: 13px; font-weight: 600; }
.stb[aria-pressed="true"] { border-color: currentColor; background: var(--raise); }
.stb.s-lived { color: var(--st-lived); } .stb.s-visited { color: var(--st-visited); } .stb.s-transit { color: var(--st-transit); }
.stb.s-planned { color: var(--st-planned); } .stb.s-wish { color: var(--st-wish); } .stb.s-noway { color: var(--st-noway); }
.stb .sw { width: 12px; height: 12px; }
.typegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.typegrid .stb .pd { width: 12px; height: 12px; }
.typegrid .stb.t-summit { color: var(--pin-summit); } .typegrid .stb.t-dive { color: var(--pin-dive); } .typegrid .stb.t-race { color: var(--pin-race); }
.typegrid .stb.t-city { color: var(--pin-city); } .typegrid .stb.t-landmark { color: var(--pin-landmark); } .typegrid .stb.t-other { color: var(--pin-other); }
.clear { justify-self: start; background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
.kids { display: grid; }
.kid { display: flex; align-items: center; gap: 10px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; }
.kid .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.visits { display: grid; gap: 6px; }
.visit { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--raise); }
.visit .vd { font: 500 13px var(--mono); white-space: nowrap; }
.visit .vn { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.visit button { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 18px; line-height: 1; }
.addv { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
@media (max-width: 420px) { .addv { grid-template-columns: 1fr auto; } .addv .vnote { grid-column: 1 / -1; grid-row: 2; } }
.inp { padding: 9px 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; width: 100%; }
.addv button { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
textarea.inp { min-height: 90px; resize: vertical; }
.results { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.results button { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); text-align: start; font-size: 14px; }
.results button:last-child { border-bottom: 0; }
.results button span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.locbox { display: grid; gap: 8px; padding: 10px; border-radius: 8px; background: var(--raise); }
.locbox .coords { font: 500 13px var(--mono); direction: ltr; text-align: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two > div { display: grid; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
a.btn { text-decoration: none; display: inline-block; text-align: center; }
.rec .ico svg { width: 18px; height: 18px; }
:lang(ar) .save, :lang(ar) .listhead span, :lang(ar) .chip .n { font-family: var(--body); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--fg); padding: 0; }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- home v2 ---------- */
.greet { display: grid; gap: 2px; }
.greet h2 { margin: 0; font: 800 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.greet span { color: var(--muted); font-size: 14px; }
.hcard { gap: 14px; }
.hhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 0; text-align: start; }
.hhead .more { color: var(--accent); font-weight: 600; font-size: 14px; }
.hcard button.hero { border: 0; background: none; padding: 0; text-align: start; width: 100%; }
.hcard .mini { border: 0; text-align: start; }
.hcard .sub { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: -6px; }
.mapslot .mapcard { border-radius: 10px; }
.mapslot .legend, .mapslot .zoom, .mapslot .pickbar { display: none !important; }
.mlist { display: grid; gap: 6px; }
.mrow { display: flex; align-items: center; gap: 8px; border-radius: 10px; background: var(--raise); padding-inline-end: 6px; }
.mrow .open { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 12px; text-align: start; }
.mrow .nm { font-weight: 600; }
.mrow .meta { font-size: 12px; color: var(--muted); }
.mrow .go { width: 38px; height: 38px; background: var(--surface); }
.hb { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.hb.h-halal { background: #1f7a45; color: #fff; }
.hb.h-nopork { background: color-mix(in srgb, #1f7a45 18%, var(--surface)); color: #1f7a45; }
.hb.h-unsure { background: var(--raise); color: var(--muted); border: 1px solid var(--line); }
.hb.h-pork { background: #b3312b; color: #fff; }
@media (prefers-color-scheme: dark) { .hb.h-nopork { color: #6fd890; } }
.warnbar, .closedbar { display: grid; gap: 6px; padding: 12px; border-radius: 10px; font-size: 14px; }
.warnbar { background: color-mix(in srgb, var(--st-transit) 16%, var(--surface)); }
.warnbar span { color: var(--muted); font-size: 13px; }
.warnbar .btn { justify-self: start; }
.closedbar { background: var(--raise); border: 1px solid var(--line); }
.closedbar b { font-size: 15px; }
.closedbar .linkbtn { justify-self: start; }
.spot.closed { opacity: 0.75; }
.spot.closed .nm { text-decoration: line-through; text-decoration-thickness: 1px; }
.cand.cur { background: var(--raise); }
.spot .acts, .mrow .acts { display: flex; gap: 6px; flex: none; }
.go.book { color: var(--food); }
.cityl { color: var(--fg); font-weight: 600; }
.hb.h-avoid { background: color-mix(in srgb, var(--st-transit) 22%, var(--surface)); color: #8a5a00; }
.hb.h-unavoidable { background: #b3312b; color: #fff; }
@media (prefers-color-scheme: dark) { .hb.h-avoid { color: #f0b440; } }
.chip.tok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.sug { border-style: dashed; color: var(--fg); }
.go.book.none { color: var(--muted); opacity: 0.75; }

/* ---------- 1.0: trips, prayer, settings ---------- */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row2 { display: flex; gap: 8px; align-items: center; }
.row2 .inp { flex: 1; min-width: 0; }
.todo { display: grid; gap: 4px; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--raise); cursor: pointer; }
.todo-row input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.todo-row span { flex: 1; min-width: 0; }
.todo-row.done span { color: var(--muted); text-decoration: line-through; }
.todo-row .x2 { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0 4px; }
.spot.trip .ico { color: var(--accent); }
.spot.past .nm { color: var(--muted); }
.hcard .hero.trip, .hcard .hero { align-items: center; }
.big-t { font: 800 clamp(22px, 6vw, 28px)/1.15 var(--display); color: var(--fg); letter-spacing: 0.01em; }
.mrow .ico.sm { display: grid; width: 28px; height: 28px; color: var(--accent); margin-inline-start: 10px; }
.mrow .ico.sm svg { width: 20px; height: 20px; }
.mrow .ico.sm + .rt { padding-inline-start: 0; }
.hcard .sub.link { border: 0; background: none; padding: 0; color: var(--accent); text-align: start; cursor: pointer; }
.linkbtn.tl { font-size: 14px; color: var(--muted); padding: 0; }
.linkbtn.tl b { color: var(--fg); font-weight: 700; }
.linkbtn svg { width: 18px; height: 18px; vertical-align: -4px; }
.hb.h-stale { background: #f1dfc4; color: #6b4a12; }
@media (prefers-color-scheme: dark) { .hb.h-stale { background: #4a3714; color: #f0cd8a; } }
.conv.stale { color: var(--muted); opacity: .55; }
.chip.near[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.prnext { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.prnext .lab { margin: 0; }
.prnext b { font: 800 30px/1.1 var(--display); }
.prtimes { display: grid; gap: 2px; }
.prrow { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 10px; font-size: 16px; }
.prrow.next { background: var(--raise); font-weight: 700; color: var(--accent); }
.prrow.dim { color: var(--muted); font-size: 14px; }
.prrow b { font-variant-numeric: tabular-nums; }
.prstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.prstrip span { display: grid; gap: 1px; text-align: center; padding: 6px 2px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.prstrip small { font-size: 11px; color: var(--muted); }
.prstrip b { font-size: 14px; }
.prstrip .next { background: var(--raise); color: var(--accent); }
.qibla { display: flex; align-items: center; gap: 18px; }
.dial { width: 150px; height: 150px; flex: none; color: var(--fg); }
.dial svg { width: 100%; height: 100%; }
.dial #qRose, .dial #qNeedle { transform-origin: 100px 100px; transition: transform .25s ease-out; }
.dial text { fill: currentColor; font-family: var(--body); }
.qtext { display: grid; gap: 8px; }
.qtext b { font: 800 26px/1.1 var(--display); }
:lang(ja) .big-t, :lang(ja) .prnext b, :lang(ja) .qtext b { letter-spacing: 0; }

.status-line.bad { color: var(--danger); }

/* ---------- Marsa ---------- */
.seg[hidden] { display: none; }
.reqbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--gold); background: var(--surface); text-align: start; }
.reqbar span { color: var(--accent); font-weight: 600; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff; background: hsl(var(--h, 210) 40% 45%); }
.avatar.grp { border-radius: 14px; }
.avatar.big { width: 60px; height: 60px; font-size: 24px; }
.chatrow { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; }
.chatrow .rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chatrow .ln1, .chatrow .bottom { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chatrow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow .when, .chatrow .pv { font-size: 13px; color: var(--muted); }
.chatrow .pv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow.unread .pv, .chatrow.unread .nm { color: var(--fg); font-weight: 700; }
.badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.person { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; }
.person .rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person .nm { font-weight: 600; }
.person .meta { font-size: 13px; color: var(--muted); }
.person .acts { display: flex; gap: 6px; }
.person[aria-pressed="true"] { background: var(--raise); border-radius: 10px; padding-inline: 8px; }
.people { display: grid; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.panel.slim { margin-top: 16px; }
.coderow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.coderow b { font: 700 16px var(--mono); letter-spacing: 0.08em; }
.coderow .meta { flex: 1; font-size: 13px; color: var(--muted); }
.inp.code { font: 700 22px var(--mono); letter-spacing: 0.12em; text-align: center; text-transform: uppercase; direction: ltr; }
.lkcode { font: 600 13px var(--mono); word-break: break-all; padding: 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); direction: ltr; text-align: start; user-select: all; }
.safety { font: 600 15px var(--mono); letter-spacing: 0.04em; line-height: 1.7; direction: ltr; text-align: start; }
.warn { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gold); background: var(--raise); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
/* the chat sheet fills the screen */
.sheet.chat { top: var(--vvt, 0px); max-height: none; height: var(--vvh, 100dvh); border-radius: 0; padding: 0; gap: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet.chat > * { flex: none; }
.sheet.chat.under { z-index: 19; }
.sheet.chat > .ch-msgs { flex: 1 1 auto; min-height: 0; }
@media (min-width: 760px) { .sheet.chat { width: 480px; } }
.ch-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ch-head .ch-back { grid-row: 1 / 3; grid-column: 1; width: 32px; height: 40px; margin-inline-start: -8px; border: 0; background: none; color: var(--accent); display: grid; place-items: center; padding: 0; }
.ch-head .ch-back svg { width: 24px; height: 24px; }
[dir="rtl"] .ch-head .ch-back svg { transform: scaleX(-1); }
.ch-head .ch-av { grid-row: 1 / 3; grid-column: 2; border: 0; background: none; padding: 0; }
.ch-head .ch-av .avatar { width: 40px; height: 40px; font-size: 17px; }
.ch-head .ch-title, .ch-head .ch-sub { grid-column: 3; }
.ch-head .ch-ico { grid-row: 1 / 3; grid-column: 4; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.ch-head .ch-ico svg { width: 22px; height: 22px; }
.ch-pin { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ch-pin-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 0; text-align: start; color: inherit; }
.ch-pin-ico { width: 18px; height: 18px; flex: none; color: var(--gold); }
.ch-pin-txt { min-width: 0; display: grid; border-inline-start: 2px solid var(--gold); padding-inline-start: 8px; }
.ch-pin-txt b { font-size: 12px; color: var(--accent); font-weight: 600; }
.ch-pin-txt span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.flash { animation: msgflash 1.6s ease-out; }
@keyframes msgflash { 0%, 30% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 3px transparent; } }
.ch-find { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ch-find .inp { flex: 1; min-width: 0; }
.ch-pin .x2, .ch-find .x2 { border: 0; background: none; color: var(--muted); font-size: 20px; width: 36px; height: 36px; flex: none; }
.msg.hit { outline: 2px solid var(--gold); }
.msg.dim { opacity: .35; }
.unreadsep { align-self: stretch; text-align: center; font-size: 12px; color: var(--accent); padding: 4px 10px; margin: 6px 0; border-top: 1px solid var(--accent); background: var(--surface); }
.msg { touch-action: pan-y; transition: transform .12s ease-out; }
.msg.swiping { transition: none; }
.chatrow .pinicon { width: 14px; height: 14px; color: var(--muted); flex: none; margin-inline-start: 4px; }
/* 1.66.0: a chat row swipes: toward the end it archives (or comes back), toward the start it deletes */
.swrow { position: relative; overflow: hidden; }
.swrow .chatrow { position: relative; z-index: 1; background: var(--bg); touch-action: pan-y; transition: transform .18s ease-out; }
.swrow.swiping .chatrow { transition: none; }
.swbg { position: absolute; inset: 0 0 1px; display: none; align-items: center; }
.swrow.toarch .swbg, .swrow.todel .swbg { display: flex; }
.swrow.toarch .swbg { background: var(--accent); color: var(--accent-ink); justify-content: flex-start; }
.swrow.todel .swbg { background: var(--danger); color: #fff; justify-content: flex-end; }
.swrow:not(.armed) .swbg { opacity: .75; }
.sw-act { display: none; flex-direction: column; align-items: center; gap: 3px; padding-inline: 20px; font-size: 12px; transition: transform .15s ease-out; }
.sw-act svg { width: 22px; height: 22px; }
.sw-act b { font-weight: 600; }
.swrow.toarch .sw-arch, .swrow.todel .sw-del { display: flex; }
.swrow.armed .sw-act { transform: scale(1.15); }
.archrow { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); text-align: start; }
.archrow .archic { flex: none; width: 44px; display: grid; place-items: center; color: var(--muted); }
.archrow .archic svg { width: 22px; height: 22px; }
.archrow .nm { flex: 1; font-weight: 600; }
.archrow .when { font-size: 13px; color: var(--muted); }
.badge.quiet { background: var(--muted); color: var(--bg); }
.archhint { margin: 0 0 6px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 0; }
.gallery button { aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--raise); position: relative; }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ch-title { background: none; border: 0; padding: 0; text-align: start; font: 700 17px var(--body); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-msgs { overflow-y: auto; overflow-x: hidden; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg) url(img/wall.svg) 0 0 / 96px 96px repeat; overscroll-behavior: contain; scrollbar-width: none; }
.ch-msgs::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* back to the newest when scrolled up (shows how many came in meanwhile) */
.ch-down { position: absolute; inset-inline-end: 14px; bottom: 76px; z-index: 3; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-size: 18px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.15); display: inline-flex; align-items: center; gap: 4px; }
.ch-down span:not(:empty) { font-size: 13px; background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 7px; }
.sheet { scrollbar-width: none; }
html, body { overflow-x: clip; }
.daysep { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0; }
.msg { position: relative; max-width: 82%; align-self: flex-start; padding: 8px 10px 6px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; overflow-wrap: anywhere; user-select: none; -webkit-user-select: none; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-radius: 14px 14px 4px 14px; }
:dir(rtl) .msg { border-radius: 14px 14px 4px 14px; } :dir(rtl) .msg.mine { border-radius: 14px 14px 14px 4px; }
.msg.gone { opacity: 0.6; font-style: italic; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--accent); }
.msg .txt { white-space: pre-wrap; }
.msg .txt a { color: inherit; }
.msg .cap { font-size: 14px; }
.msg .mmeta { display: flex; gap: 6px; justify-content: flex-end; font-size: 11px; opacity: 0.75; }
/* message status: a clock while it is on this phone, one tick sent, two delivered, two in gold read, red not delivered */
.tick { display: inline-flex; align-items: center; line-height: 1; }
.tick svg { width: 16px; height: 14px; }
.tick.st-delivered svg, .tick.st-read svg { width: 22px; }
.tick.st-pending { opacity: .8; }
.tick.st-pending svg { width: 13px; height: 13px; }
.tick.st-read { color: var(--gold); }
.msg.mine .tick.st-read { color: #f0c76a; opacity: 1; }
.tick.st-failed { color: var(--danger); }
.msg .mmeta .tick { margin-inline-start: 1px; }
.msg.mine .mmeta { opacity: .9; }
.msg .mstatus { display: block; text-align: end; font-size: 11px; margin-top: 2px; opacity: .85; }
.msg.mine .mstatus.st-read { color: #f0c76a; opacity: 1; }
.msg .mfail { font-size: 12px; color: var(--danger); background: none; border: 0; padding: 4px 0 0; text-align: start; cursor: pointer; font-weight: 600; }
.pv .rowtick { margin-inline-end: 4px; vertical-align: -2px; color: var(--muted); }
.pv .rowtick.st-read { color: var(--gold); }
.pv .rowtick.st-failed { color: var(--danger); }
.msg .quote { border: 0; border-inline-start: 3px solid var(--gold); color: inherit; font: inherit; text-align: start; width: 100%; cursor: pointer; padding: 4px 8px; border-radius: 6px; background: rgba(127,127,127,0.12); display: grid; font-size: 13px; }
.msg .quote b { font-size: 12px; }
.msg .reacts { display: flex; gap: 4px; font-size: 13px; }
.msg .reacts span { padding: 1px 6px; border-radius: 999px; background: rgba(127,127,127,0.15); }
.ch-typing { font-size: 12px; color: var(--muted); padding: 0 16px 4px; background: var(--bg); }
.ch-reply { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; }
.ch-reply > div { flex: 1; min-width: 0; display: grid; border-inline-start: 3px solid var(--gold); padding-inline-start: 8px; }
.ch-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ch-bar { display: flex; align-items: flex-end; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.ch-bar .inp { flex: 1; min-width: 0; resize: none; max-height: 140px; border-radius: 20px; padding: 9px 14px; line-height: 1.35; }
.ch-bar .ic { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 20px; color: var(--accent); display: grid; place-items: center; touch-action: none; }
.ch-bar .ic.send, .ch-bar .ic.mic.on { background: var(--accent); color: var(--accent-ink); }
.ch-rec { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; }
.ch-rec .lvl { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); transition: transform 0.1s; }
.ch-rec .tm { font: 600 14px var(--mono); }
.ch-rec .hint { flex: 1; color: var(--muted); }
.ch-lock { position: absolute; inset-inline-end: 22px; bottom: 120px; width: 28px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ch-lock::after { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
.mediabox { display: grid; }
.thumb { position: relative; width: min(68vw, 300px); border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: rgba(127,127,127,0.15); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.thumb .ld { position: absolute; inset: 0; display: grid; place-items: center; }
.once { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px dashed currentColor; background: none; color: inherit; font-weight: 600; }
.once svg { width: 22px; height: 22px; }
.voice { display: grid; gap: 4px; min-width: 230px; position: relative; user-select: none; -webkit-user-select: none; }
.voice .vrow { display: flex; align-items: center; gap: 8px; }
.voice .vrow.sub { justify-content: center; gap: 10px; }
.voice .pp { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: rgba(127,127,127,0.22); color: inherit; display: grid; place-items: center; padding: 0; }
.voice .pp svg { width: 20px; height: 20px; }
.voice .wave { flex: 1; height: 34px; display: flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; min-width: 100px; }
.voice .wave { position: relative; touch-action: none; cursor: pointer; }
.voice .wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: 0.28; transition: opacity .08s; }
.voice .wave i.on { opacity: 1; background: var(--gold); }
.msg:not(.mine) .voice .wave i.on { background: var(--accent); }
.voice .wave::after { content: ""; position: absolute; top: 50%; inset-inline-start: var(--p, 0%); width: 12px; height: 12px; margin-inline-start: -6px; margin-top: -6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px rgba(255,255,255,.7); pointer-events: none; }
.msg:not(.mine) .voice .wave::after { background: var(--accent); }
.voice .wave.drag::after { width: 18px; height: 18px; margin-inline-start: -9px; margin-top: -9px; }
.voice .dur { font: 600 12px var(--mono); opacity: 0.85; }
.voice .spd { border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; font-size: 11px; padding: 3px 7px; flex: none; }
.voice .sk { border: 0; background: rgba(127,127,127,0.18); color: inherit; border-radius: 999px; font: 700 12px var(--mono); padding: 4px 10px; transition: background .15s; }
.voice .sk.hit { background: var(--gold); color: #1c1c1c; }
.cardmsg { display: flex; gap: 10px; align-items: center; border: 1px solid rgba(127,127,127,0.3); border-radius: 10px; padding: 8px; background: rgba(127,127,127,0.1); color: inherit; text-align: start; }
.cardmsg .rt { display: grid; min-width: 0; }
.cardmsg .meta { font-size: 12px; opacity: 0.8; }
.cardmsg .ico { width: 36px; height: 36px; display: grid; place-items: center; }
.reactrow { display: flex; justify-content: space-around; font-size: 26px; }
.reactrow button { background: none; border: 0; font-size: inherit; padding: 6px; }
.sheet.media { top: 0; max-height: none; height: 100dvh; border-radius: 0; background: #000; color: #fff; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px; grid-template-rows: auto 1fr auto; }
.mv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mv-head .x, .mv-head .x2 { background: rgba(255,255,255,0.15); border-color: transparent; color: #fff; }
.mv-body { display: grid; place-items: center; min-height: 0; overflow: hidden; }
.mv-body img, .mv-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.mv-cap { margin: 0; text-align: center; }
.nw-bar { display: flex; gap: 3px; }
.nw-bar i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.35); }
.nw-bar i.done { background: #fff; } .nw-bar i.cur { background: var(--gold); }
.nw-tap { position: absolute; top: 80px; bottom: 80px; width: 30%; background: none; border: 0; }
.nw-tap.prev { inset-inline-start: 0; } .nw-tap.next { inset-inline-end: 0; width: 55%; }
.nowtext { font: 600 26px/1.3 var(--body); text-align: center; padding: 24px; }
.nowring { display: flex; gap: 14px; overflow-x: auto; padding: 10px 2px; }
.nowav { flex: none; display: grid; justify-items: center; gap: 6px; background: none; border: 0; color: var(--fg); font-size: 12px; }
.nowav .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line); }
.nowav.fresh .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
.center { text-align: center; }

.toast .tbtn{margin-inline-start:10px;border:0;border-radius:8px;padding:6px 12px;background:var(--gold);color:#1c1c1c;font:inherit;font-weight:600}
.prompt-card{position:fixed;left:12px;right:12px;bottom:calc(var(--nav-h) + 12px + env(safe-area-inset-bottom,0px));z-index:51;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:16px;padding:14px 16px;box-shadow:0 10px 30px rgba(0,0,0,.25);max-width:480px;margin-inline:auto}
.prompt-card p{margin:0 0 12px;font-size:16px;line-height:1.4}
.pc-btns{display:flex;gap:10px}
.pc-btns .btn{flex:1;min-height:48px;font-size:16px}

/* ---------- Marsa: its own compact layout ---------- */
body[data-screen="marsa"] .top, body[data-screen="marsa"] #updateNote:not(.show) { display: none; }
body[data-screen="marsa"] { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
body[data-screen="marsa"] .wrap { gap: 0; min-height: calc(100dvh - var(--nav-h) - 6px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
body[data-screen="marsa"] .fab { display: none; }
.screen.marsa { gap: 10px; align-content: start; min-height: 100%; grid-template-rows: auto auto auto 1fr; }
.ms-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ms-head h2 { margin: 0; font: 800 26px/1.1 var(--display); letter-spacing: 0.01em; display: flex; align-items: center; gap: 10px; }
.ms-head .count:empty { display: none; }
.ms-head .count { font: 700 13px/1 var(--body); background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 4px 8px; }
.ms-acts { display: flex; gap: 8px; }
.seg.tabs { gap: 0; background: var(--raise); border-radius: 10px; padding: 3px; }
.seg.tabs button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 8px 6px; }
.seg.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg.small button { padding: 6px 10px; font-size: 13px; }
.ms-body { display: grid; align-content: start; gap: 10px; }
.ms-body > div { display: grid; gap: 8px; align-content: start; }
.panel.setup { max-width: 480px; justify-self: center; width: 100%; }
.emptybox { display: grid; gap: 12px; padding: 24px 12px; text-align: center; justify-items: center; }
.emptybox .sec-d { text-align: center; }
.emptybox .modhint { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 320px; }
.bigcode { font: 700 34px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; text-align: center; padding: 14px; background: var(--raise); border-radius: 12px; direction: ltr; user-select: all; }
.sh-sec.mycode { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.qr-row { display: grid; gap: 12px; justify-items: center; }
.qr { width: 200px; height: 200px; border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr:empty { display: none; }
.code-row { display: flex; gap: 8px; }
.code-row .inp { flex: 1; min-width: 0; }
.btn.scan { width: 52px; padding: 0; display: grid; place-items: center; }
.scanner { display: grid; gap: 10px; justify-items: center; }
.scanner video { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; object-fit: cover; }
.nww-prev { max-height: 220px; overflow: hidden; border-radius: 10px; }
.nww-prev img, .nww-prev video { width: 100%; height: 220px; object-fit: cover; display: block; }
/* composer: the box takes the whole width */
.ch-bar { flex-wrap: nowrap; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.ch-box { flex: 1 1 auto; min-width: 0; display: flex; }
.ch-bar .inp { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 42px; max-height: 140px; padding: 10px 14px; border-radius: 21px; line-height: 1.4; resize: none; overflow-y: hidden; scrollbar-width: thin; box-sizing: border-box; }
.ch-bar .ic { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--raise); color: var(--accent); display: grid; place-items: center; padding: 0; }
.ch-bar .ic svg { width: 22px; height: 22px; }
.ch-bar .ic.send, .ch-bar .ic.mic.on { background: var(--accent); color: var(--accent-ink); }
.ch-bar .ic.send svg { margin: 0; width: 22px; height: 22px; stroke-width: 2.4; }
.ch-bar.off { opacity: .45; pointer-events: none; }
.ch-wait { margin: 0; padding: 10px 14px; text-align: center; font-size: 14px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
.ch-typing { padding: 2px 16px 6px; }
.ch-reply, .ch-rec { border-top: 1px solid var(--line); }
.photo-row { display: flex; gap: 12px; align-items: center; }
.photo-btn { width: 64px; height: 64px; border-radius: 50%; border: 1.5px dashed var(--line); background: var(--raise); padding: 0; overflow: hidden; display: grid; place-items: center; color: var(--muted); flex: none; }
.photo-btn img, .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar { overflow: hidden; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-align: start; }
/* wide screens: the chat sits beside the list instead of a side sheet */
@media (min-width: 900px) {
  body[data-screen="marsa"] .wrap { max-width: 1280px; grid-template-columns: minmax(320px, 400px) 1fr; column-gap: 0; }
  body[data-screen="marsa"] .wrap > :not(#scr-marsa) { grid-column: 1 / -1; }
  body[data-screen="marsa"] #scr-marsa { grid-column: 1; border-inline-end: 1px solid var(--line); padding-inline-end: 14px; }
  body[data-screen="marsa"] .sheet.chat { position: fixed; inset-inline-end: 0; top: 0; bottom: 0; height: auto; width: calc(100vw - max((100vw - 1280px) / 2, 0px) - 400px - 14px); max-width: none; border-inline-start: 0; }
  body[data-screen="marsa"] .sheet.chat .ch-bar { padding-bottom: 10px; }
  body[data-screen="marsa"] .scrim { display: none; }
  .sheet.chat .msg { max-width: 68%; }
}
/* You: folded panels */
details.fold > summary { cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; }
details.fold[open] > summary::after { content: "−"; }
details.fold[hidden] { display: none; }
.ch-rec .ic.sm { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--raise); color: var(--accent); display: grid; place-items: center; padding: 0; }
.ch-rec .ic.sm svg { width: 18px; height: 18px; }
.ch-rec .lvl[hidden] { display: none; }

.trail { display: grid; gap: 6px; padding: 6px 0 2px; }
.trail .ev { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; font-size: 14px; }
.trail .ev::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; }
.trail .ev .meta { display: block; }
.linkbtn.inline { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; }

/* ---------- listen ---------- */
.lsplayer { display: grid; gap: 10px; }
.lstitle { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.lsseek { width: 100%; accent-color: var(--accent); height: 28px; }
.lstimes { display: flex; justify-content: space-between; font: 600 13px var(--mono); color: var(--muted); }
.lsctl { display: flex; align-items: center; justify-content: center; gap: 18px; }
.lsctl .pp { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.lsctl .pp svg { width: 30px; height: 30px; }
.lsctl .sk { min-width: 56px; height: 44px; border: 0; border-radius: 22px; background: var(--raise); color: var(--fg); font: 700 15px var(--mono); }
.lsctl .spd { min-width: 52px; height: 36px; border: 1px solid var(--line); border-radius: 18px; background: none; color: var(--fg); font: 600 13px var(--mono); }
.lscont { display: grid; gap: 4px; width: 100%; text-align: start; padding: 14px 16px; border: 1px solid var(--gold); border-radius: 12px; background: var(--surface); color: var(--fg); }
.lscont .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lscont .meta, .lsrow .meta { font-size: 13px; color: var(--muted); }
.lsrow { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.lsrow:last-child { border-bottom: 0; }
.lsrow .rt { flex: 1; min-width: 0; display: grid; gap: 4px; padding: 12px 0; border: 0; background: none; text-align: start; color: var(--fg); }
.lsrow .rt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsrow.now .rt b { color: var(--accent); }
.lsrow .x2 { font-size: 22px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); }

.pvopts { display: grid; gap: 10px; }
.pvopt { display: grid; gap: 4px; text-align: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); color: var(--fg); }
.pvopt b { font-size: 16px; }
.pvopt span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.pvopt[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.pwbox { position: relative; display: block; }
.pwbox > .inp { width: 100%; padding-inline-end: 48px; }
.pweye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.pweye svg { width: 22px; height: 22px; }

/* the wallpaper is a faint line drawing of travel and work on the way; a lighter one sits on the dark theme */
@media (prefers-color-scheme: dark) { .ch-msgs { background-image: url(img/wall-dark.svg); } }
.lsrow .lsi { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1.5px solid var(--muted); background: none; color: var(--muted); font: 700 14px/1 Georgia, serif; font-style: italic; display: grid; place-items: center; padding: 0; }
.lsrow .lsi[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.lsinfo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; margin: 0 0 8px; border-radius: 10px; background: var(--raise); font-size: 13px; }
.lsinfo .kv { display: grid; gap: 1px; }
.lsinfo .k { color: var(--muted); font-size: 12px; }
.lsinfo .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.arrange { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--raise); }
.arrow-row { display: grid; grid-template-columns: 30px 1fr 44px 44px; gap: 8px; align-items: center; }
.arrow-row .ico svg { width: 22px; height: 22px; color: var(--accent); }
.arrow-row .mv { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 18px; }
.arrow-row .mv:disabled { opacity: .3; }

/* no app-wide header: each screen carries its own title; the brand lives on the Sabeel screen and at the end of the bar */
.top { display: none !important; }
.brandhead h2 { display: flex; align-items: center; gap: 10px; }
.brandhead h2 img { border-radius: 9px; }
.brandhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bottomnav .you .emblem { width: 26px; height: 26px; border-radius: 7px; opacity: .85; }
.bottomnav .you[aria-current="page"] .emblem { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.tokbox { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); }
.tokhead { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.tokcoin { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: #1c1c1c; background: var(--gold); }
.tokhead b { font-size: 20px; display: block; }
.tokhead .meta { font-size: 12px; color: var(--muted); }
.price-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--gold); color: #1c1c1c; font-size: 12px; font-weight: 700; }
.modsheet summary { display: none !important; }
.modsheet .panel.fold { border: 0; padding: 0; background: none; box-shadow: none; }
.scr-head .modgear { margin-inline-start: auto; }
.scr-head { display: flex; align-items: center; gap: 10px; }
.bottomnav .in button { flex: 1 0 64px; }
.bottomnav .in.scrolls { -webkit-mask-image: linear-gradient(to var(--edge, right), transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to var(--edge, right), transparent, #000 8%, #000 92%, transparent); }
[dir="rtl"] .bottomnav .in.scrolls { --edge: left; }
.avatar.selfav { background: var(--gold); color: #1c1c1c; }
.avatar.selfav svg { width: 55%; height: 55%; }

/* ---------- family ---------- */
.fmgens { display: grid; gap: 12px; }
.fmgen h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fmrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; color: var(--fg); }
.fmrow:last-child { border-bottom: 0; }
.fmrow.gone { opacity: .6; }
.fmrow .rt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fmrow .nm { font-weight: 600; }
.fmrow .meta { font-size: 13px; color: var(--muted); }
.fmrow .meta .ar, .fmrelar { font-family: "Noto Naskh Arabic", "Geeza Pro", serif; }
.fmrow .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.fmav { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: #3b5f8f; }
.fmav.f { background: #8f4f73; }
.kbs { display: flex; flex-wrap: wrap; gap: 4px; }
.kb { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.kb.rahim { background: #e8f1ea; color: #2e6b3d; border-color: transparent; }
.kb.mahram { background: #f3ecdc; color: #7a5a12; border-color: transparent; }
.kb.milk { background: #eef0f8; color: #3c4f86; border-color: transparent; }
.kb.inlaw { background: transparent; }
@media (prefers-color-scheme: dark) { .kb.rahim { background: #1f3527; color: #9fd8ae; } .kb.mahram { background: #3a3020; color: #e8c97a; } .kb.milk { background: #232a44; color: #aab8ea; } }
.fmdue { display: grid; gap: 8px; border-color: var(--gold); }
.fmdue h3 { margin: 0; }
.fmduerow { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.fmduerow .rt { display: grid; gap: 2px; min-width: 0; }
.fmduerow .meta { font-size: 13px; color: var(--muted); }
.fmadd { width: 100%; margin-top: 12px; }
.fmlearn { display: block; margin: 14px auto 0; }
.fmsheet { display: grid; gap: 12px; }
.fmhead { display: grid; gap: 4px; }
.fmrel { font-size: 18px; }
.fmrelar { font-size: 20px; color: var(--accent); }
.fmrels { display: flex; flex-wrap: wrap; gap: 6px; }
.fmrels .chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.fmrels .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fmhow { font-weight: 600; margin: 6px 0 0; }
.fmkeep { display: grid; gap: 8px; }
.learn h3 { margin: 8px 0 4px; }
.learn p { margin: 0 0 8px; line-height: 1.55; }
.fmrow.ph .nm { font-style: italic; font-weight: 500; color: var(--muted); }
.fmrow.ph .fmav { background: var(--line); color: var(--muted); }

/* opening: the emblem on navy, the same as the app icon, until the app is ready (and never longer than 6 s) */
.splash { position: fixed; inset: 0; z-index: 100; background: #15284B; display: grid; place-content: center; justify-items: center; gap: 18px;
  animation: splashout .35s ease 6s forwards; transition: opacity .35s ease; }
.splash img { width: 112px; height: 112px; border-radius: 26px; animation: splashin .5s ease-out both; }
.splash span { color: #D6AB4E; font: 600 13px/1 var(--body); letter-spacing: .42em; padding-inline-start: .42em; opacity: .9; animation: splashin .5s .12s ease-out both; }
.splash.gone { opacity: 0; pointer-events: none; }
@keyframes splashin { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes splashout { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .splash, .splash img, .splash span { animation-duration: .01s; } .splash { animation-delay: 6s; } }

/* nothing may push the page wider than the phone: drop-downs and file pickers size themselves to their longest
   option, and grid/flex children default to their content's width */
select, input, textarea { max-width: 100%; min-width: 0; }
select.inp { width: 100%; text-overflow: ellipsis; }
input[type="file"] { width: 100%; }
.wrap, .screen, .panel, details, .sh-sec, .sheet { min-width: 0; }
.wrap > *, .screen > *, .panel > *, details > *, .sh-sec > *, .sheet > * { min-width: 0; }
html, body { max-width: 100%; overflow-x: hidden; }

/* ---- the Sabeel screen: account card, rows that open sheets ---- */
#msetBody > :not(.cur) { display: none !important; }
.panel.acc { gap: 12px; }
.acc-hero { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.acc-hero h3 { margin: 0 0 2px; }
.acc-hero .sec-d { margin: 0; }
.acc-av { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: #15284B; color: #D6AB4E; font: 700 22px/1 var(--body); flex: none; }
.acc-av img { width: 100%; height: 100%; object-fit: cover; }
.acc-av.big { width: 64px; height: 64px; border-radius: 50%; font-size: 28px; }
.acc-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.acc-who { display: grid; gap: 2px; min-width: 0; }
.acc-who b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-who .meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syncpill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.syncpill:empty { display: none; }
.syncpill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3a9a5b; }
.seg.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 3px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); }
.seg.tabs2 button { border: 0; border-radius: 8px; background: none; padding: 9px 6px; font-weight: 600; color: var(--muted); }
.seg.tabs2 button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.btn.wide { justify-self: stretch; width: 100%; }
.panel.acc .btns { display: grid; }
.setlist { display: grid; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.setrow { display: grid; grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); text-align: start; font: inherit; font-weight: 600; min-height: 52px; }
.setrow:last-child { border-bottom: 0; }
.setrow:not(:has(.ico)) { grid-template-columns: minmax(0, 1fr) auto; }
.setrow .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--raise); color: var(--accent); }
.setrow .ico svg { width: 18px; height: 18px; }
.setrow em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setrow i { font-style: normal; color: var(--muted); font-size: 20px; line-height: 1; }
[dir="rtl"] .setrow i { transform: scaleX(-1); }
.setrow.danger span { color: #b3412e; }
.setrow:active { background: var(--raise); }
.panel > .setlist:only-child { margin: -16px; border: 0; }
.langgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.langgrid button { padding: 14px 10px; font-size: 16px; }
.langgrid button:first-child { grid-column: 1 / -1; }
.msg.sched { opacity: .72; border-style: dashed; }
.msg .schedtag { font-weight: 600; }

.ch-head .ch-ico#chSearch { grid-column: 5; }
.ch-head .ch-ping { grid-column: 4; }
.ch-head .ch-ping[hidden] { display: none; }
/* Ping! */
.msg.pingmsg { background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px 4px; }
.msg .ping { font: 900 20px/1.1 var(--body); color: #c0392b; letter-spacing: .04em; font-style: italic; }
.sheet.chat.shake { animation: shake .6s cubic-bezier(.36,.07,.19,.97) 2; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .sheet.chat.shake { animation: none; } }
/* Ping!: everything on the screen shakes (each top-level layer, so fixed bars and sheets shake in place); gentler when the phone asks for less motion */
html.pingshake body > * { animation: shake .6s cubic-bezier(.36,.07,.19,.97) 2; }
@keyframes shakesoft { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { html.pingshake body > * { animation: shakesoft .4s ease-in-out 2; } }
/* polls */
.poll { display: grid; gap: 6px; min-width: 220px; }
.poll .pq { font-size: 15px; }
.poll .meta { font-size: 12px; opacity: .75; }
.popt { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; text-align: start; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(127,127,127,.35); background: rgba(127,127,127,.08); color: inherit; font: inherit; }
.popt .pbar { position: absolute; inset: 0 auto 0 0; background: rgba(214,171,78,.35); transition: width .3s; z-index: 0; }
[dir="rtl"] .popt .pbar { inset: 0 0 0 auto; }
.popt > :not(.pbar) { position: relative; z-index: 1; }
.popt.on { border-color: var(--gold); font-weight: 600; }
.popt .pct { font-variant-numeric: tabular-nums; font-size: 13px; }
.popt .pwho { grid-column: 1 / -1; font-size: 11px; opacity: .7; }
.pollopts { display: grid; gap: 8px; }
/* costs */
.expcard { display: grid; gap: 2px; text-align: start; min-width: 200px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(127,127,127,.3); background: rgba(127,127,127,.08); color: inherit; font: inherit; }
.expcard .ek { font-size: 13px; opacity: .85; }
.expcard .ea { font-size: 20px; font-variant-numeric: tabular-nums; }
.expcard .meta { font-size: 12px; opacity: .75; }
.expcard.settle { border-color: #3a9a5b; }
.ch-bal { border-bottom: 1px solid var(--line); background: var(--surface); }
.ch-bal button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 14px; border: 0; background: none; color: var(--fg); font: inherit; text-align: start; }
.ch-bal #chBalText { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-bal b { font-size: 13px; color: var(--accent); }
.ch-bal.square b { display: none; }
.settle { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.settle b { font-variant-numeric: tabular-nums; }
.settle .btn { grid-column: 1 / -1; justify-self: start; }
.row2.amt { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.row2.amt input { font-size: 22px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipck { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--raise); }
.chipck:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.filebtn { cursor: pointer; }
.fsbody { display: grid; gap: 10px; }

/* chat folders */
.folders { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.folders::-webkit-scrollbar { display: none; }
.fold-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; -webkit-user-select: none; user-select: none; }
.fold-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fold-tab .badge { position: static; min-width: 18px; height: 18px; font-size: 11px; }
.fold-tab.add { padding: 7px 12px; color: var(--muted); }
.expcard { grid-template-columns: minmax(0, 1fr); width: 100%; }
.msg.mine .popt .pbar { background: rgba(255,255,255,.2); }
.msg.mine .popt.on { border-color: #D6AB4E; }

/* family tree */
.fmview { margin-bottom: 4px; }
.fmtools { display: flex; gap: 6px; justify-content: flex-end; }
.fmtools .iconbtn { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.fmtree { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 14px; background: var(--surface) radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--fg) 8%, transparent) 1px, transparent 1.4px) 0 0 / 18px 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.fmtree svg { display: block; }
.fmtree .kin { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, transparent); stroke-width: 1.6; }
.fmtree .couple { stroke: var(--gold); stroke-width: 2.2; }
.fmtree .milk { fill: none; stroke: #8f4f73; stroke-width: 1.4; stroke-dasharray: 3 4; }
.fmtree .node { cursor: pointer; }
.fmtree .node rect { fill: var(--raise); stroke: var(--line); stroke-width: 1.2; }
.fmtree .node.me rect { fill: #15284B; stroke: #D6AB4E; stroke-width: 2; }
.fmtree .node.me .nm, .fmtree .node.me .rl { fill: #fff; }
.fmtree .node .dot { fill: #3b5f8f; }
.fmtree .node.f .dot { fill: #8f4f73; }
.fmtree .node.me .dot { fill: #D6AB4E; }
.fmtree .node .ini { fill: #fff; font: 700 13px/1 var(--body); }
.fmtree .node.me .ini { fill: #15284B; }
.fmtree .node .nm { fill: var(--fg); font: 600 13px/1 var(--body); }
.fmtree .node .rl { fill: var(--muted); font: 400 11px/1 var(--body); }
.fmtree .node.gone rect { fill: var(--bg); stroke-dasharray: 4 3; }
.fmtree .node.ph rect { fill: none; stroke-dasharray: 5 4; }
.fmtree .node.ph .dot { fill: var(--line); }
.fmtree .node .rip { fill: var(--muted); font-size: 10px; }
.fmtree .node .mm { fill: var(--accent); font-size: 11px; }
.fmtree .node:focus-visible rect { stroke: var(--accent); stroke-width: 2.5; }
.fmfull { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.fmcontacts .fmcrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; }
.fmcontacts .fmav { width: 32px; height: 32px; font-size: 14px; }
.kincard { display: grid; gap: 6px; min-width: 200px; }
.kincard .kt { font-size: 12px; opacity: .8; }

.avatar.aiav { background: #15284B; padding: 0; overflow: hidden; }
.avatar.aiav img { width: 100%; height: 100%; object-fit: cover; }
.msg .trn { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(127,127,127,.4); font-size: 14px; opacity: .9; white-space: pre-wrap; }
.aisum { white-space: pre-wrap; line-height: 1.55; }

/* without internet */
.meshbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); font-size: 13px; }
.meshdot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: meshpulse 1.6s ease-in-out infinite; }
@keyframes meshpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 60%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .meshdot { animation: none; } }

/* family: the person sheet */
.fmrow.slim { padding: 6px 0; }
.fmrow.slim .fmav { width: 32px; height: 32px; font-size: 14px; }
.fmmiss { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fmsprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.fmsprow .fmrow { border-bottom: 0; }
.fmfam .lab { margin-top: 8px; }
.fmlife { margin: -4px 0 0; }
.fmdua { border-inline-start: 3px solid var(--gold); padding-inline-start: 10px; }
.famevery { display: grid; gap: 8px; }
.famevery label { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; align-items: center; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* handles */
.hdrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: start; color: var(--fg); }
.hdrow + .hdrow { margin-top: 6px; }
.hdrow .hdname { font-weight: 700; font-size: 17px; direction: ltr; unicode-bidi: isolate; }
.hdrow .hdinfo { flex: 1; min-width: 0; display: grid; }
.hdrow .hdprice { font-weight: 700; color: var(--gold); white-space: nowrap; }
.hdbig { font-size: 30px; font-weight: 800; letter-spacing: .5px; text-align: center; padding: 10px 0 2px; direction: ltr; unicode-bidi: isolate; }
.hdstate { text-align: center; margin-bottom: 8px; }
.hdin { display: flex; align-items: center; gap: 6px; }
.hdin .at { font-size: 20px; font-weight: 700; color: var(--muted); }
.hdgrid { display: grid; grid-template-columns: 1fr 110px; gap: 8px 10px; align-items: center; margin: 8px 0; }
.hdgrid .inp { margin: 0; }
.hdlist { margin-top: 10px; }

/* family: tabs, sample/import banner, رحم */
.fmtabs { margin-bottom: 12px; }
.fmtabs button:last-child { font-family: inherit; font-size: 16px; }
.fmdemo { border: 1.5px dashed var(--gold); background: var(--raise); }
.fmdemo b { display: block; font-size: 16px; }
.fmnotes { margin: 6px 0 4px; padding-inline-start: 18px; font-size: 13px; color: var(--muted); }
.fmduelink { display: block; margin: 0 0 8px; }
.fmmore { margin-top: 10px; }
.fmrrow { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.fmrrow:first-of-type { border-top: 0; }
.fmrrow.gone { opacity: .75; }
.fmrwho { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; text-align: start; color: var(--fg); }
.fmrwho .rt { min-width: 0; display: grid; }
.fmrwho .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmracts { display: flex; gap: 2px; flex: none; }
.fmracts .iconbtn { width: 38px; height: 38px; font-size: 18px; }

/* family tree: bigger, full screen, a person and their ties picked out */
.fmtreebox { display: grid; gap: 8px; }
.fmtree { max-height: none; height: clamp(420px, calc(var(--vvh, 100vh) - 230px), 900px); touch-action: pan-x pan-y; }
.fmtools { align-items: center; flex-wrap: wrap; }
.fmrootlab { margin-inline-end: auto; font-weight: 600; }
.fmtreebox.full { position: fixed; inset: 0; z-index: 18; background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px); display: flex; flex-direction: column; }
.fmtreebox.full .fmtree { flex: 1; height: auto; min-height: 0; }
.fmtreebox.full .fmfocus { max-height: 42vh; overflow-y: auto; }
body.fmfullon .bottomnav, body.fmfullon .fab { display: none; }
.fmtree .node.root rect { stroke: var(--gold); stroke-width: 2.5; }
.fmtree .couple.former { stroke-dasharray: 5 4; }
.fmtreebox.focusing .node { opacity: .28; transition: opacity .15s; }
.fmtreebox.focusing .node.focus, .fmtreebox.focusing .node.conn { opacity: 1; }
.fmtreebox.focusing .lines > * { opacity: .2; }
.fmtreebox.focusing .lines > .hot { opacity: 1; stroke: var(--gold); stroke-width: 2.6; }
.fmtree .node.focus rect { stroke: var(--gold); stroke-width: 3; }
.fmtree .node.conn rect { stroke: var(--gold); stroke-width: 1.6; }
.fmfocus { border: 1.5px solid var(--gold); border-radius: 14px; background: var(--surface); padding: 12px; display: grid; gap: 10px; }
.fmfhead { display: flex; gap: 10px; align-items: flex-start; }
.fmfhead .rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fmfhead b { font-size: 17px; }
.fmfrel { font-weight: 600; color: var(--accent); }
.fmfgrp { display: grid; gap: 6px; }
.fmfgrp .lab { margin: 0; }
.fmfchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fmfchip { display: grid; text-align: start; gap: 1px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); border-inline-start: 4px solid #3b5f8f; background: var(--raise); color: var(--fg); font-size: 14px; }
.fmfchip.f { border-inline-start-color: #8f4f73; }
.fmfchip.gone { opacity: .7; }
.fmfchip span { font-size: 12px; color: var(--muted); }
.fmalso { display: block; }
.fmchain { margin: -4px 0 0; font-size: 13px; color: var(--accent); font-weight: 600; }
.fmmodes { margin-inline-end: auto; }
.fmtreebox.closemode.focusing .node, .fmtreebox.closemode.focusing .lines > * { opacity: 1; }
.fmtreebox.closemode .fmtree { height: clamp(360px, calc(var(--vvh, 100vh) - 330px), 640px); }
.fmcmp { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.fmcmp:first-of-type { border-top: 0; }
.fmsug { border-color: var(--gold); display: grid; gap: 10px; }
.fmsugc { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.fmsugc:first-of-type { border-top: 0; padding-top: 0; }
.fmsugtwo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fmsugp { display: grid; gap: 2px; text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); color: var(--fg); }
.fmsugp .meta { font-size: 12px; }
.fmexist { display: grid; gap: 6px; }
.fmconnect { margin-top: 8px; }
.scr-head .fmeye { margin-inline-start: auto; font-size: 18px; }
.fmav.ph { overflow: hidden; padding: 0; }
.fmav.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fmav.big { width: 64px; height: 64px; font-size: 26px; }
.fmphoto { border-radius: 50%; }
.fmev { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fmev:first-of-type { border-top: 0; }
.fmev > span { flex: 1; }

/* family: the overhaul */
.seg.tabs3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); margin-bottom: 10px; }
.seg.tabs3 button { position: relative; border: 0; border-radius: 10px; padding: 10px 6px; background: none; font-size: 15px; }
.seg.tabs3 button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); color: var(--fg); }
.seg.tabs3 .nbadge { position: absolute; top: 4px; inset-inline-end: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #15284B; font: 700 11px/18px system-ui, sans-serif; }
.fmchips { margin-top: 12px; }
.fmchips .chip { font-size: 13px; }
.fmtools { gap: 6px; }
.fmmodes { flex: 1; min-width: 0; }
.fmmodes button { flex: 1; padding: 7px 6px; font-size: 13px; }
.fmcard { display: grid; gap: 12px; padding: 14px; border-radius: 16px; background: var(--raise); border: 1px solid var(--line); }
.fmcardtop { display: flex; gap: 14px; align-items: flex-start; }
.fmcardtx { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fmcardname { font-size: 22px; line-height: 1.15; }
.fmcard .fmrel { font-weight: 600; color: var(--accent); }
.fmcard .fmexplain { margin: 0; }
.fmphoto { border: 0; background: none; padding: 0; border-radius: 50%; flex: none; }
.fmphoto .fmav.big { width: 72px; height: 72px; font-size: 28px; border: 2px solid var(--gold); }
.fmquick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fmq { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 12px; font-weight: 600; }
.fmqi { font-size: 20px; line-height: 1; }
.fmtie { display: flex; align-items: center; gap: 4px; }
.fmtie .fmrow { flex: 1; min-width: 0; }
.fmtie .fmmore { width: 34px; height: 34px; font-size: 18px; flex: none; }
.fmsheet .panel h3 { font-size: 15px; margin: 0 0 8px; }
.fmmodes { width: 100%; }
.fmmodes button { flex: 1; }
.fmtools { justify-content: flex-end; }
.fmdemo.slim { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; padding: 10px 14px; }
.fmdemo.slim b { font-size: 15px; }
.fmdemo.slim .meta { flex: 1; min-width: 0; }
.fmdemo.slim .btns { margin: 0; }
.fmdemo.slim .btn { padding: 6px 10px; font-size: 13px; }
/* the next name, guessed while typing */
.fmnext { margin: -2px 0 2px; gap: 6px; flex-wrap: wrap; }
.fmnext .chip { font-size: 13px; padding: 5px 11px; }
.fmnext .chip.gold { background: color-mix(in srgb, var(--gold) 22%, transparent); border-color: var(--gold); font-weight: 600; }
/* the father's side and the mother's side */
.fmtree .node .side.p { fill: #3b6fb0; }
.fmtree .node .side.m { fill: #2f8a72; }
.fmlegend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); }
.fmlegend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.fmlegend .p::before { background: #3b6fb0; }
.fmlegend .m::before { background: #2f8a72; }
/* a parent not added yet */
.fmtree .node.ghost rect { fill: color-mix(in srgb, var(--gold) 8%, transparent); stroke: var(--gold); stroke-dasharray: 6 5; stroke-width: 1.4; }
.fmtree .node.ghost .nm { fill: var(--accent); font-weight: 600; }
.fmtree .ghostline { stroke-dasharray: 4 4; opacity: .6; }
/* Family in Arabic only: one tap on ع */
.fmar { font: 700 17px/1 var(--body); }
.fmar[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-radius: 10px; }
.fmalt { display: grid; gap: 4px; }
.langauto { margin-top: 14px; }
.scr-head .fmadd { margin-inline-start: auto; flex: none; width: 40px; }
.scr-head .fmar { margin-inline-start: auto; }
.scr-head .fmadd:not([hidden]) ~ .fmar, .scr-head .fmadd:not([hidden]) ~ .fmeye, .scr-head .fmadd:not([hidden]) ~ .modgear, .scr-head .fmar:not([hidden]) ~ .fmeye, .scr-head .fmar:not([hidden]) ~ .modgear, .scr-head .fmeye:not([hidden]) ~ .modgear { margin-inline-start: 0; }
/* the visa map: what the passport needs */
:root { --v-gcc: #2a6f9e; --v-free: #1f8a4c; --v-eta: #7cc46a; --v-arrival: #e2b13c; --v-evisa: #e9823a; --v-required: #c9483b; --v-refused: #5a2a2a; --v-home: #1C3561; }
.map .v-gcc { fill: var(--v-gcc) !important; } .map .v-free { fill: var(--v-free) !important; } .map .v-eta { fill: var(--v-eta) !important; } .map .v-arrival { fill: var(--v-arrival) !important; }
.map .v-evisa { fill: var(--v-evisa) !important; } .map .v-required { fill: var(--v-required) !important; } .map .v-refused { fill: var(--v-refused) !important; } .map .v-home { fill: var(--v-home) !important; }
.sw.v-gcc { background: var(--v-gcc); } .sw.v-free { background: var(--v-free); } .sw.v-eta { background: var(--v-eta); } .sw.v-arrival { background: var(--v-arrival); } .sw.v-evisa { background: var(--v-evisa); } .sw.v-required { background: var(--v-required); } .sw.v-refused { background: var(--v-refused); }
.legend .mapmode { flex-basis: 100%; }
.legend .mapmode button { flex: 1; }
.legend .visapp { margin-inline-start: 0; flex-basis: 100%; gap: 8px; }
.legend .visapp select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.legend .visasrc { flex-basis: 100%; font-size: 11px; }
.legend .visasrc a, .visabox a { color: var(--accent); }
.visabox { border-inline-start: 4px solid var(--line); padding-inline-start: 12px; display: grid; gap: 4px; }
.visabox.v-gcc { border-color: var(--v-gcc); } .visabox.v-free { border-color: var(--v-free); } .visabox.v-eta { border-color: var(--v-eta); } .visabox.v-arrival { border-color: var(--v-arrival); }
.visabox.v-evisa { border-color: var(--v-evisa); } .visabox.v-required { border-color: var(--v-required); } .visabox.v-refused { border-color: var(--v-refused); } .visabox.v-home { border-color: var(--v-home); }
.visabox .visak { font-size: 17px; }
.visabox details summary { font-size: 13px; color: var(--accent); cursor: pointer; }
.fmpcol { display: grid; justify-items: center; gap: 4px; flex: none; }
.fmphotocap { font-size: 12px; white-space: nowrap; }
/* whose child: which wife is the mother */
.fmchoice { display: grid; gap: 8px; margin: 2px 0 8px; }
.fmchrow .lab { margin-bottom: 4px; }
.fmchrow .chips { gap: 6px; flex-wrap: wrap; }
/* mahram or not, said plainly */
.fmverdict { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; margin-top: 10px; border: 1px solid; }
.fmverdict b { font-size: 15px; }
.fmverdict.yes { background: color-mix(in srgb, #1f8a4c 10%, transparent); border-color: color-mix(in srgb, #1f8a4c 45%, transparent); }
.fmverdict.yes b { color: #1f8a4c; }
.fmverdict.no { background: color-mix(in srgb, #c9483b 9%, transparent); border-color: color-mix(in srgb, #c9483b 40%, transparent); }
.fmverdict.no b { color: #c9483b; }
.fmverdict.sp { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: var(--gold); }
.fmphotowho { display: grid; gap: 4px; margin-top: 10px; }
.fmphotowho .inp { font-size: 14px; padding: 8px 10px; }
.map .vdim { opacity: .22; }
.legend .vkind { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; padding: 3px 8px; border-radius: 999px; font: inherit; color: var(--muted); cursor: pointer; }
.legend .vkind[aria-pressed="true"] { border-color: var(--fg); color: var(--fg); font-weight: 600; }
.visapart { display: grid; gap: 4px; }
.visapart + .visapart { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.visaways { gap: 6px; align-items: center; }
.visaways .chip { min-height: 28px; padding: 3px 10px; color: var(--fg); }
.fmguide { display: grid; gap: 8px; border-color: var(--gold); margin-bottom: 10px; }
.fmguide h3 { margin: 0; }
.fmguide .linkbtn { justify-self: start; font-size: 13px; }
/* the tree on the Family screen: a small picture of the close family; the whole tree opens full screen */
.fmtreebox.mini { position: relative; gap: 0; }
.fmtree.mini { height: auto; max-height: 440px; overflow: hidden; touch-action: auto; cursor: zoom-in; border-radius: 14px 14px 0 0; }
.fmtree.mini svg { margin: 0 auto; }
.fmbig { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: var(--raise); color: var(--accent); font: inherit; }
.fmbig span:first-child { font-size: 18px; }
.fmbig .meta { color: var(--muted); font-size: 12px; }
.fmtreebox.full > * { flex: none; }
.fmtreebox.full > .fmtree { flex: 1 1 auto; min-height: 0; }
.fmtreebox.full > .fmtree { display: flex; }
.fmtreebox.full > .fmtree svg { margin: auto; flex: none; }
/* Now: the camera first, the stories over it */
#msNow { margin: 0 -16px; }
.nowcam { position: relative; height: calc(var(--vvh, 100dvh) - 210px - env(safe-area-inset-bottom, 0px)); min-height: 380px; background: #0b0f17; border-radius: 22px; overflow: hidden; color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.nowcam video#ncVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nowcam video#ncVideo { --dz: 1; transform: scale(var(--dz)); }
.nowcam video#ncVideo.mirror { transform: scale(calc(-1 * var(--dz)), var(--dz)); }
/* 1.60.0: the camera's own gestures: a layer over the picture takes taps (focus), double taps (flip) and pinches (zoom) */
.nc-touch { position: absolute; inset: 0; z-index: 1; touch-action: none; }
.nc-focus { position: absolute; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 2px solid var(--gold, #D6AB4E); border-radius: 50%; z-index: 2; pointer-events: none; animation: ncfocus .9s ease-out forwards; }
@keyframes ncfocus { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.nc-lens { position: absolute; inset-inline: 0; bottom: 124px; display: flex; justify-content: center; gap: 8px; z-index: 2; pointer-events: none; }
.nc-lens button { pointer-events: auto; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 19px; border: 0; background: rgba(0,0,0,.42); color: #fff; font: 700 13px/1 var(--body); backdrop-filter: blur(6px); }
.nc-lens button.on { background: rgba(0,0,0,.6); color: var(--gold, #D6AB4E); min-width: 46px; font-size: 14px; }
.nowcam.recording .nc-lens button:not(.on) { visibility: hidden; }
.nowcam.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; animation: ncflash .18s ease-out forwards; }
@keyframes ncflash { to { opacity: 0; } }
.nc-ring { position: absolute; inset-inline: 0; top: 0; display: flex; gap: 12px; overflow-x: auto; padding: 12px 12px 18px; background: linear-gradient(rgba(0,0,0,.55), transparent); z-index: 2; scrollbar-width: none; }
.nc-ring .nowav { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.nc-ring .nowav .avatar { box-shadow: 0 0 0 2px #0b0f17, 0 0 0 4px rgba(255,255,255,.5); }
.nc-ring .nowav.fresh .avatar { box-shadow: 0 0 0 2px #0b0f17, 0 0 0 4px var(--gold); }
.nc-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 32px; text-align: center; z-index: 1; }
.nc-msg p { margin: 0; max-width: 300px; line-height: 1.5; }
.nc-side { position: absolute; inset-inline-end: 12px; top: 96px; display: grid; gap: 12px; z-index: 2; }
.nc-side button, .nc-small { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.38); color: #fff; font: 700 18px/1 var(--body); backdrop-filter: blur(6px); }
.nc-side button[aria-pressed="true"] { background: var(--gold); color: #15284B; }
.nc-bottom { position: absolute; inset-inline: 0; bottom: 34px; display: flex; align-items: center; justify-content: center; gap: 44px; z-index: 2; }
.nc-shutter { --p: 0; width: 78px; height: 78px; border-radius: 50%; border: 0; padding: 0; background: conic-gradient(#e0443a calc(var(--p) * 360deg), rgba(255,255,255,.9) 0); display: grid; place-items: center; touch-action: none; }
.nc-shutter span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.25); border: 3px solid #0b0f17; transition: transform .15s, background .15s; }
.nowcam.recording .nc-shutter span { background: #e0443a; transform: scale(.72); border-radius: 30%; }
.nc-hint { position: absolute; inset-inline: 0; bottom: 8px; margin: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.8); text-shadow: 0 1px 3px rgba(0,0,0,.6); z-index: 2; }
.nowcam.recording .nc-hint, .nowcam.recording .nc-ring, .nowcam.recording .nc-side, .nowcam.recording .nc-small { visibility: hidden; }
/* after the picture */
.sheet.nowedit { padding: 0; display: block; }
.ne-stage { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.ne-stage img, .ne-stage video { width: 100%; height: 100%; object-fit: contain; }
.ne-top { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); inset-inline-start: 12px; z-index: 2; }
.ne-top .x { background: rgba(0,0,0,.45); color: #fff; border-color: transparent; }
.ne-bottom { position: absolute; inset-inline: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; z-index: 2; }
.ne-bottom .inp { flex: 1; background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.3); }
.ne-bottom .inp::placeholder { color: rgba(255,255,255,.7); }
.nesave { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; padding: 0; }
.nesave svg { width: 22px; height: 22px; }
.nesave.done { background: var(--gold); border-color: var(--gold); color: #15201e; }
.nacell .natag { position: absolute; inset-inline-start: 6px; bottom: 6px; z-index: 1; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; }
.naHint { margin: 0 0 10px; }
/* watching */
.nw-bar i { position: relative; overflow: hidden; }
.nw-bar i b { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: #fff; border-radius: 2px; }
.nw-bar i.done b { width: 100%; }
.nw-bar i.cur { background: rgba(255,255,255,0.35); }
.nw-reply { display: flex; gap: 8px; margin-top: 8px; position: relative; z-index: 2; }
.nw-reply .inp { flex: 1; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.nw-reply .inp::placeholder { color: rgba(255,255,255,.65); }
#nowSheet { grid-template-rows: auto auto 1fr auto auto auto; touch-action: none; }
/* Marsa's mark: a simple pier over water, and the word in the language in use */
.ms-logo { gap: 8px !important; }
.ms-pier { width: 40px; height: 29px; color: var(--accent); flex: none; }
.ms-word { letter-spacing: 0.02em; }
:lang(ar) .ms-word { font-family: var(--body); font-weight: 800; }
.ms-acts .iconbtn { position: relative; }
.ms-acts .iconbtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ms-acts .nbadge { position: absolute; top: -5px; inset-inline-end: -5px; box-shadow: 0 0 0 2px var(--bg); }
body.nowtab .ms-head, body.nowtab #msLive, body.nowtab #msMesh { display: none; }
.ms-sub { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ms-sub h3 { margin: 0; font: 800 20px/1.1 var(--display); }
.ms-sub .iconbtn { font-size: 24px; line-height: 1; }
/* Now: its own head over the camera */
.nc-head { position: absolute; inset-inline: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; z-index: 3; }
.nc-head b { font: 800 22px/1 var(--display); text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.nc-who { background: rgba(0,0,0,.38); color: #fff; border: 0; border-radius: 999px; padding: 5px 10px; font: 600 12px/1 var(--body); backdrop-filter: blur(6px); }
.nc-menu { margin-inline-start: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.38); color: #fff; font: 700 20px/1 var(--body); backdrop-filter: blur(6px); }
.nc-ring { top: 50px; padding-top: 8px; }
.nc-side { top: 140px; }
.nowav.mine { position: relative; }
.nowav.mine .avatar { position: relative; overflow: visible; } .nowav.mine .nplus { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #15284B; font: 800 15px/20px var(--body); text-align: center; border: 2px solid #0b0f17; }
.nowav.mine.nopost .avatar { opacity: .85; }
.nc-shutter.pulse { animation: ncpulse .45s ease-in-out 2; }
@keyframes ncpulse { 50% { transform: scale(1.12); } }
/* watching */
.nw-head { gap: 10px; }
.nw-av .avatar { width: 34px; height: 34px; font-size: 14px; }
.nw-tx { display: grid; flex: 1; min-width: 0; line-height: 1.15; }
.nw-tx .meta { color: rgba(255,255,255,.7); }
.nw-views { background: none; border: 0; color: rgba(255,255,255,.85); font: inherit; text-align: center; position: relative; z-index: 2; }
.nw-react { display: flex; justify-content: center; gap: 6px; position: relative; z-index: 2; }
.nw-react button { background: rgba(255,255,255,.12); border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 22px; transition: transform .15s; }
.nw-react button.sent { transform: scale(1.3); background: rgba(214,171,78,.4); }
#nowSheet { grid-template-rows: auto auto 1fr auto auto auto auto; }
/* Now fills the screen edge to edge, from the top of the phone to the bar, like a camera app */
body.nowtab .nowcam { position: fixed; inset-inline: 0; top: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); height: auto; min-height: 0; border-radius: 0; z-index: 14; background: #000; }
body.nowtab .nc-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
body.nowtab .nc-ring { top: calc(52px + env(safe-area-inset-top, 0px)); }
body.nowtab .nc-side { top: calc(150px + env(safe-area-inset-top, 0px)); }
body.nowtab .bottomnav { background: #000; border-top-color: rgba(255,255,255,.08); }
body.nowtab .bottomnav button, body.nowtab .bottomnav .you { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.08); }
body.nowtab .bottomnav button[aria-current="page"] { color: #fff; }
.nowcam video#ncVideo { opacity: 0; transition: opacity .25s; }
.nowcam video#ncVideo.live { opacity: 1; }
.nowcam .nc-ring { background: none; }
.nowcam::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 190px; background: linear-gradient(rgba(0,0,0,.5), transparent); z-index: 1; pointer-events: none; }
.nowcam::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 200px; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; z-index: 1; }
.nowcam.flash::after { content: ""; inset: 0; height: auto; background: #fff; opacity: .7; animation: ncflash .18s ease-out forwards; }
.nc-side button, .nc-small, .nc-menu, .nc-who { background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nc-small { font-size: 0; display: grid; place-items: center; }
.nc-small svg, .nc-side svg { width: 24px; height: 24px; }
.nc-side button { display: grid; place-items: center; font-size: 0; }
#ncText { font: 700 17px/1 var(--body); }
.nc-shutter { box-shadow: 0 2px 14px rgba(0,0,0,.35); }
.nc-shutter span { background: #fff; border: 3px solid rgba(0,0,0,.15); }
.nc-ring { align-items: flex-start; }
.nc-ring .nowav { position: relative; }
.nowav { align-content: start; }
/* watching: the picture fills the whole screen; names, bars, views and replies sit over it */
#nowSheet { display: block; padding: 0; overflow: hidden; }
#nowSheet .mv-body { position: absolute; inset: 0; display: block; }
#nowSheet .mv-body img, #nowSheet .mv-body video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; display: block; }
#nowSheet .mv-body .nowtext { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; background: linear-gradient(160deg, #1C3561, #0b0f17 70%); }
#nowSheet::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 160px; background: linear-gradient(rgba(0,0,0,.55), transparent); z-index: 1; pointer-events: none; }
#nowSheet::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 260px; background: linear-gradient(transparent, rgba(0,0,0,.6)); z-index: 1; pointer-events: none; }
#nowSheet .nw-bar { position: absolute; inset-inline: 10px; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 3; }
#nowSheet .nw-head { position: absolute; inset-inline: 10px; top: calc(20px + env(safe-area-inset-top, 0px)); z-index: 3; }
#nowSheet .nw-head .x, #nowSheet .nw-head .x2 { background: rgba(0,0,0,.3); backdrop-filter: blur(8px); }
#nowSheet .nw-tap { top: 90px; bottom: 170px; z-index: 2; }
#nowSheet .nw-foot { position: absolute; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 3; display: grid; gap: 10px; }
#nowSheet .mv-cap:empty { display: none; }
#nowSheet .mv-cap { font-size: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
#nowSheet .nw-views { justify-self: start; background: rgba(0,0,0,.35); border-radius: 999px; padding: 6px 12px; }
#nowSheet .nw-views:empty, #nowSheet .nw-views[hidden] { display: none; }
#nowSheet .nw-react button { background: rgba(0,0,0,.3); backdrop-filter: blur(8px); }
#nowSheet .nw-reply { margin: 0; }
#nowSheet .nw-reply .inp { background: rgba(0,0,0,.35); border-radius: 999px; backdrop-filter: blur(8px); }
#nowSheet .nw-reply .btn { border-radius: 999px; }
/* after the picture, too: it fills the screen */
.ne-stage img, .ne-stage video { object-fit: cover; }
/* community rules and reports (1.30.0) */
.rules { margin: 4px 0 12px; padding-inline-start: 20px; display: grid; gap: 8px; }
.rules li { line-height: 1.45; }
.rules li.hard { font-weight: 600; color: var(--danger, #b3261e); }
.reports { display: grid; gap: 10px; margin-top: 10px; }
.rep { border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; padding: 12px; display: grid; gap: 6px; min-width: 0; }
.rep.urgent { border-color: var(--danger, #b3261e); box-shadow: inset 4px 0 0 var(--danger, #b3261e); }
.rep .meta { font-size: 13px; opacity: .75; overflow-wrap: anywhere; }
.rep-tx { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rep-note { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.rep-media { max-width: 100%; max-height: 50vh; border-radius: 8px; }
.rep .btns { flex-wrap: wrap; }
.nc-rules { position: absolute; inset-inline: 16px; bottom: 150px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(10, 18, 36, .78); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nc-rules span { flex: 1; min-width: 0; line-height: 1.4; font-size: 15px; }
.nc-rules .btn { flex: none; }
.nowcam.needrules .nc-shutter { opacity: .55; }
.rlmore { margin: 6px 0 12px; }
.rlmore h3 { font-size: 15px; margin: 14px 0 4px; }
.rlmore p { margin: 0; line-height: 1.5; }
/* the assistant chat: not end-to-end encrypted, said every time */
.ch-ainote { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 14px; font-size: 14px; line-height: 1.45; background: color-mix(in srgb, var(--gold, #D6AB4E) 18%, var(--surface, #fff)); border-bottom: 1px solid var(--line); }
.ch-ainote svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--gold, #C3953A); }
.meshbar.relay { background: color-mix(in srgb, var(--danger, #b3261e) 14%, var(--surface, #fff)); }
.meshbar.relay .meshdot { background: var(--danger, #b3261e); }
.invbox { display: grid; justify-items: center; gap: 8px; margin: 10px 0; text-align: center; }
.invqr { background: #fff; padding: 10px; border-radius: 14px; line-height: 0; }
.invqr svg { width: 220px; height: 220px; max-width: 70vw; max-height: 70vw; }
/* the Emergency box in Marsa settings */
.emerg { border: 1px solid color-mix(in srgb, var(--danger, #b3261e) 35%, var(--line)); border-radius: 14px; padding: 12px 14px; margin: 14px 0; background: color-mix(in srgb, var(--danger, #b3261e) 5%, var(--surface, #fff)); }
.emerg h3 { margin: 0 0 6px; color: var(--danger, #b3261e); }
.emerg.on { background: color-mix(in srgb, var(--danger, #b3261e) 12%, var(--surface, #fff)); }
.emerg-state { margin: 0 0 8px; font-weight: 600; line-height: 1.45; }
/* Family 1.37.0: the ledger, the interview, tools */
.fmtie .prov { display: block; font-size: 12px; opacity: .7; }
.fmtie .prov.warn { color: var(--danger, #b3261e); opacity: 1; }
.fmfield { margin: 10px 0; }
.fmfield .lab { display: block; margin-bottom: 4px; }
.seg.mini button { padding: 4px 8px; font-size: 12px; }
.fmbatch { display: grid; gap: 6px; margin: 8px 0; }
.fmbrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.fmbrow .nm { font-weight: 600; flex: 1 1 100px; min-width: 0; }
.fmstep { margin: 8px 0; }
.fmstep summary b { font-weight: 600; }
.fmstepin { padding: 6px 0 2px; }
.fmrelcard p { margin: 6px 0; }
.fmcheck p { margin: 0 0 6px; }
.fmwali ol { padding-inline-start: 20px; margin: 6px 0; }
.fmwali li { margin: 3px 0; }
.fmrecent { align-items: center; }
.fmrecent .lab { margin-inline-end: 6px; }
.chip.on { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); }
.fmsteptitle { display: grid; gap: 2px; min-width: 0; }
.fmsteptitle .meta { font-weight: 400; font-size: 13px; }

/* 1.38.0: reviewing what a relative filled in; proposals waiting */
.fmrev { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.fmrev:first-of-type { border-top: 0; }
.fmrev > input { margin-top: 4px; flex: none; }
.fmrev > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fmrev .meta { font-size: 12px; opacity: .75; }
.fmrev .seg.mini { margin-top: 4px; }
.fmprop { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: start; width: 100%; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--card)); cursor: pointer; }
.fmprop .meta { font-size: 12px; opacity: .8; }

/* 1.39.0: first open — one welcome card, nothing else in the way */
body.noacct .ms-head .iconbtn, body.noacct #msTabs { display: none; }
.setup .welcome-emblem { display: block; width: 72px; height: 72px; border-radius: 18px; margin-inline: auto; margin-bottom: 4px; }
.setup h3 { text-align: center; }
.privcard { position: relative; border-color: var(--gold); }
.privcard .pc-x { position: absolute; inset-inline-end: 6px; top: 6px; }

/* 1.40.0: the add sheet shows the common relations first; the tree card has add slots */
.fmrels .chip.far { display: none; }
.fmrels.open .chip.far { display: inline-flex; }
.fmfchips.slots .fmfchip.add { border-style: dashed; opacity: .85; }
.fmfchips.slots .fmfchip.add b { font-weight: 500; }
.fmguide.slim { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; text-align: start; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.fmguide.slim .meta { margin-inline-start: auto; color: var(--accent); }
.fmrahim-intro { margin: 2px 4px 8px; }
.fmtree.lod .node .rl, .fmtree.lod .node .mm { display: none; }
.fmtree.lod .node .nm { font-size: 22px; transform: translateY(6px); }
.fmlife .fmstory h3 { margin-top: 10px; }
.about-line { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0; }
.about-line a, .about-line .linkbtn.inline { color: var(--muted); }
.prtravel.on { border-color: var(--gold); }
.lsextra { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lsextra .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lsloopline { text-align: center; margin: 0; }
.tpsoon { color: var(--danger); font-weight: 600; }
.fmrels .chip.nofit { display: none; }
.visawarn { color: var(--danger); font-weight: 600; }
.todo-row.doc .rt { flex: 1; min-width: 0; display: grid; gap: 2px; border: 0; background: none; text-align: start; color: var(--fg); padding: 8px 0; font: inherit; }
.todo-row.doc .rt .meta { font-size: 12px; color: var(--muted); }
.fmlegend .former::before { background: none; border-top: 2px dashed var(--gold); height: 0; border-radius: 0; vertical-align: 3px; width: 14px; }
.fmlegend .milk::before { background: none; border-top: 2px dashed #8f4f73; height: 0; border-radius: 0; vertical-align: 3px; width: 14px; }
.fmguide input.inp, .fmguide .chips { margin-bottom: 6px; }
.fmguide .btns { margin-top: 8px; }
.fmknown { margin: 2px 0; }
.iconbtn.fmadd { font-size: 22px; line-height: 1; }
.fmfocus.mini .fmfbody { display: none; }
.fmfocus.mini { padding: 8px 12px; }
.fmtreebox.full .fmfocus .fmfhead { cursor: pointer; }
.fmftoggle { align-self: center; color: var(--muted); font-size: 14px; margin-inline-end: 4px; }
.fmfbody { display: grid; gap: 10px; }
.kb.notm { background: #f6e6e4; color: #8a3b33; border-color: transparent; }
.fmlistq { margin-bottom: 8px; }
.fmrahim-row .meta, .fmrow .meta { white-space: normal; }
.fmwhen.due { color: #8a5a12; font-weight: 600; }
.fmrrow .fmrwho .meta { white-space: normal; overflow: visible; text-overflow: clip; }
#scr-family .scr-head { flex-wrap: nowrap; gap: 6px; }
#scr-family .scr-head .iconbtn { width: 34px; height: 34px; flex: none; }
#scr-family .scr-head .count { white-space: nowrap; }
#scr-family .scr-head h2 { font-size: 24px; }
/* module settings: room between sections, explanations quieter */
#msetBody h3 { margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
#msetBody h3:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
#msetBody p { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
#msetBody label.toggle { padding: 6px 0; }
.convnames { display: grid; gap: 8px; }
.convnames label { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; }
.convnames .conv { letter-spacing: 1px; color: var(--gold); }
.visapp select { max-width: 100%; min-width: 0; }
.legend .visapp { display: grid; grid-template-columns: auto minmax(0, 1fr); flex-basis: 100%; margin-inline-start: 0; }
.legend .vkind { flex: 1 1 45%; min-width: 0; justify-content: flex-start; }
.prwhere { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 2px 4px 6px; }
.prwhere .sec-d { margin: 0; }
/* a recovery key or reset code shown in the question sheet keeps its line breaks */
#askHint { white-space: pre-line; }
.warnword { color: var(--danger); }
.linkbtn.forgot { justify-self: start; font-size: 14px; }
.askcode { font: 700 22px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; text-align: center; background: var(--raise); border: 1px dashed var(--gold); border-radius: 12px; padding: 14px 10px; margin: 4px 0; user-select: all; -webkit-user-select: all; word-break: break-all; color: var(--fg); }
.askqr { justify-self: center; background: #fff; padding: 10px; border-radius: 12px; }
.askqr svg { display: block; width: 220px; height: 220px; }
.lkcode.short { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; text-align: center; user-select: all; -webkit-user-select: all; }
.lkqr { justify-self: center; margin: 4px auto; width: max-content; }
.lkqr svg { width: 200px; height: 200px; }

/* 1.54.0: restore on the Link screen, and the Safari note on an iPhone */
.restorebox { border: 1px solid var(--gold); border-radius: 14px; padding: 12px 14px; margin-block-end: 18px; text-align: start; }
.restorebox h3 { margin-block: 0 6px; }
.restorebox .btn { margin-block: 10px 4px; }
.restorebox .or { margin-block: 10px 0; }
.safari-note { background: var(--gold-soft, #f6ecd4); color: #3a2c08; border-radius: 12px; padding: 10px 12px; margin-block-end: 14px; text-align: start; }
.safari-note p { margin: 4px 0 0; font-size: .9em; }

/* 1.55.0: the test version wears a small gold tag, so nobody mistakes it for the released one */
/* 1.57.7: "BETA", on the Sabeel button in the bar, where it covers nothing (at the top it sat over screen heads) */
html.next #navYou { position: relative; }
html.next #navYou::after { content: "BETA"; position: absolute; inset-block-start: 2px; inset-inline-end: 2px; pointer-events: none;
  font: 800 8px/1 system-ui, sans-serif; letter-spacing: .08em; color: #15284B; background: #D6AB4E; padding: 2px 4px; border-radius: 5px; }
.updbox { border: 1px solid var(--line, #ddd); border-radius: 12px; padding: 10px 12px; margin-block: 8px 14px; display: grid; gap: 8px; }
.updbox h3 { margin: 0; font-size: 1rem; }
.updbox .sec-d { margin: 0; }
/* 1.57.2: the update note floats over any screen (on the chat screen it used to be hidden) */
#updateNote.show { position: fixed; inset-block-start: max(8px, env(safe-area-inset-top)); inset-inline: 12px; z-index: 950; color: var(--ink, inherit); box-shadow: 0 6px 24px rgba(0,0,0,.18); }

/* 1.57.6: Owner tools › Updates: the release button */
.relbox { margin-block: 12px 4px; padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.relbox .btn { inline-size: 100%; }

/* 1.57.7: holding the eye (to show the women again) must not select the emoji like text or open the phone's menu */
.fmeye, .iconbtn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
/* the family ＋ drawn as two clean strokes rather than a full-width character, which some phones draw unevenly */
.scr-head .fmadd svg { inline-size: 18px; block-size: 18px; display: block; margin: auto; }

/* 1.57.9: Now, swiping to the next or previous person slides the new one in */
@keyframes nwInR { from { transform: translateX(30%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes nwInL { from { transform: translateX(-30%); opacity: .4; } to { transform: none; opacity: 1; } }
#nowSheet.nw-in-r { animation: nwInR .22s ease-out; }
#nowSheet.nw-in-l { animation: nwInL .22s ease-out; }
@media (prefers-reduced-motion: reduce) { #nowSheet.nw-in-r, #nowSheet.nw-in-l { animation: none; } }

/* 1.57.9: "Making the picture of the tree…" while a big tree is drawn and turned into a picture */
.fmbusy { position: fixed; inset-inline: 16px; inset-block-end: calc(96px + env(safe-area-inset-bottom)); z-index: 9000; display: flex; align-items: center; gap: 12px;
  background: #1C3561; color: #fff; padding: 14px 16px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-weight: 600; }
.fmbusy .spin { inline-size: 20px; block-size: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: var(--gold, #D6AB4E); animation: fmspin .8s linear infinite; flex: none; }
@keyframes fmspin { to { transform: rotate(360deg); } }

/* 1.57.9: the head's ＋ shares the class of the big "Add a relative" button, whose top margin pushed it down */
.scr-head .fmadd { margin-block-start: 0; align-self: center; }
.fmshare { display: block; inline-size: 100%; margin-block-start: 12px; }

/* 1.58.0: a name in other languages, ready to copy */
.fmnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-block: 6px; border-block-start: 1px solid var(--line); }
.fmnrow .lab { inline-size: 100%; font-size: 12px; color: var(--muted); }
.fmcopy { font-size: 14px; }
/* 1.58.0: Family settings, the last buttons no longer touch */
#familySettings .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 10px; }
#familySettings .fmwipe { margin-block-start: 18px; }

/* 1.58.0: the travel list, one folded line per region */
.groupfold { border-block-end: 1px solid var(--line); }
.groupfold > summary.group { display: flex; justify-content: space-between; align-items: center; padding-block: 14px; cursor: pointer; list-style: none; font-size: 16px; }
.groupfold > summary.group::-webkit-details-marker { display: none; }
.groupfold > summary.group::after { content: "›"; margin-inline-start: 10px; font-size: 20px; color: var(--muted); transition: transform .15s; }
.groupfold[open] > summary.group::after { transform: rotate(90deg); }
.groupfold > summary.group span { margin-inline-start: auto; color: var(--muted); font-family: ui-monospace, monospace; font-size: 13px; }
.nc-rules:not([hidden]) ~ .nc-lens { visibility: hidden; }

/* 1.61.0: your circle while a post goes up */
.nowav.posting .avatar { animation: nwpost 1.1s ease-in-out infinite; box-shadow: 0 0 0 2px #0b0f17, 0 0 0 4px var(--gold, #D6AB4E) !important; }
@keyframes nwpost { 50% { opacity: .55; } }
.nc-lens button.af, .nc-lens button.far { color: var(--gold, #D6AB4E); margin-inline-end: 10px; }
/* 1.61.0: the tree is the Family screen, with a calmer, warmer look */
.fmbar { display: flex; gap: 6px; margin: 4px 0 10px; overflow-x: auto; scrollbar-width: none; }
.fmbarbtn { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 14px/1 var(--body); }
.fmbarbtn .ic { font-size: 15px; }
.fmbarbtn.pri { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.fmtreebox.inline { gap: 8px; }
.fmstage { position: relative; }
.fmtreebox.inline .fmtools { position: absolute; top: 8px; inset-inline-end: 8px; flex-direction: column; gap: 6px; z-index: 2; }
.fmtreebox.inline .fmtools .iconbtn { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(21,40,75,.12); }
.fmtreebox.inline .fmtree { height: calc(var(--vvh, 100vh) - 300px); min-height: 340px; }
.fmrootrow { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.fmtree { background: color-mix(in srgb, var(--bg) 70%, var(--surface)); border-radius: 18px; }
.fmtree .bands .band { fill: transparent; }
.fmtree .bands .band.alt { fill: color-mix(in srgb, var(--accent) 4%, transparent); }
.fmtree .bands .bandlab { fill: color-mix(in srgb, var(--accent) 55%, var(--muted)); font: 700 10px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.fmtree .node rect.card { fill: var(--surface); stroke: color-mix(in srgb, var(--fg) 10%, transparent); stroke-width: 1; }
.fmtree .node.f .dot { fill: #9a5a7e; }
.fmtree .node.m .dot { fill: #3b5f8f; }
.fmtree .node .side { stroke: none; }
.fmtree .node .ini { font: 700 14px/1 var(--body); }
.fmtree .node .nm { font: 650 13.5px/1 var(--body); }
.fmtree .node.me rect.card { fill: #15284B; stroke: #D6AB4E; stroke-width: 2; }
.fmtree .node.gone rect.card { fill: color-mix(in srgb, var(--surface) 70%, var(--bg)); stroke-dasharray: 4 3; }
.fmtree .node.gone .nm { fill: color-mix(in srgb, var(--fg) 75%, transparent); }
.fmtree .node.ph rect.card { fill: none; filter: none; stroke-dasharray: 5 4; }
.fmtree .kin { stroke: color-mix(in srgb, var(--accent) 38%, transparent); stroke-width: 1.8; stroke-linecap: round; }
.fmtree .couple { stroke: var(--gold); stroke-width: 2; }
.fmtree .ring { fill: var(--surface); stroke: var(--gold); stroke-width: 2; }
.fmtreebox.focusing .lines > .ring.hot { fill: var(--gold); }
.fmtree.lod .bands .bandlab { font-size: 14px; }
.fmstage .fmfocus { position: absolute; inset-inline: 8px; bottom: 8px; z-index: 3; max-height: 58%; overflow-y: auto; box-shadow: 0 8px 24px rgba(21,40,75,.18); }
.fmstage .fmlegend { position: absolute; bottom: 8px; inset-inline-start: 10px; z-index: 1; flex-direction: column; gap: 3px; align-items: flex-start; padding: 6px 9px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 11px; pointer-events: none; }
.fmtreebox { min-width: 0; }
.fmtreebox > *, .fmstage { min-width: 0; max-width: 100%; }
.fmstage .fmtree { width: 100%; }
.fmtreebox.inline .fmmodes { width: 100%; }
.fmstage .fmlegend { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; max-width: calc(100% - 70px); font-size: 10.5px; padding: 4px 8px; }
.fmstage .fmlegend span::before { width: 8px; height: 8px; }
.fmtree .node.me .dot { fill: #D6AB4E; }
.fmtree svg { margin-inline: auto; }

/* 1.62.0: my past Now, and a post waiting for internet */
.naGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.nacell { position: relative; aspect-ratio: 9 / 16; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #0b0f17; color: #fff; }
.nacell img, .nacell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.nacell .nadate { position: absolute; top: 6px; inset-inline-start: 6px; font: 700 11px/1 var(--body); text-shadow: 0 1px 3px rgba(0,0,0,.7); z-index: 1; }
.nacell .natext { display: block; padding: 26px 8px 8px; font-size: 12px; text-align: start; }
.nacell .naplay { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.nowav.waiting .avatar { box-shadow: 0 0 0 2px #0b0f17, 0 0 0 4px #e0a23a !important; }

/* 1.63.0: the page scrolls past the tree: a swipe at the tree's top or bottom edge carries on to the page */
.fmtreebox.inline .fmtree { overscroll-behavior-y: auto; overscroll-behavior-x: contain; height: calc(var(--vvh, 100vh) - 360px); }

/* 1.65.0: the move to marsa.chat (a card over everything while the phone's data moves) */
.movecard { position: fixed; inset: 0; z-index: 10000; background: #15284B; color: #F4EBD6; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.movecard[hidden] { display: none; }
.movecard .mvbox { max-width: 380px; width: 100%; text-align: center; }
.movecard img { width: 72px; height: 72px; border-radius: 16px; }
.movecard h2 { color: #D6AB4E; font-size: 1.3rem; margin: 16px 0 8px; }
.movecard .mvline { opacity: .92; line-height: 1.5; margin: 0; }
.movecard .mvbar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; margin: 18px 0 0; }
.movecard .mvbar[hidden] { display: none; }
.movecard .mvbar i { display: block; height: 100%; width: 0; background: #D6AB4E; transition: width .3s; }
.movecard .mvacts { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.movecard .mvacts:empty { display: none; }
.movecard .btn.ghost { color: #F4EBD6; border-color: rgba(244, 235, 214, .5); background: transparent; }
