/* ---------- Fonts: IBM Plex Sans Arabic (SIL OFL, see fonts/LICENSE.txt), self-hosted ---------- */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens: matte monochrome ---------- */
:root {
  --bg: #0a0a0b;
  --raised: #111113;
  --ink: #f1f1f2;
  --ink-2: rgba(241, 241, 242, .74);
  --ink-3: rgba(241, 241, 242, .5);
  --ink-4: rgba(241, 241, 242, .3);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --fill: rgba(255, 255, 255, .04);
  --fill-2: rgba(255, 255, 255, .07);
  --pos: #dfe7e1;
  --neg: #cf9c9c;
  --warn: #cdb98f;
  /* surfaces, light and shadow: everything that changes between the dark and the light theme */
  --spot: rgba(255, 255, 255, .085);
  --spot-2: rgba(255, 255, 255, .03);
  --grain-op: .045;
  --scroll: rgba(255, 255, 255, .14);
  --glass-1: rgba(255, 255, 255, .07);
  --glass-2: rgba(255, 255, 255, .03);
  --glass-3: rgba(255, 255, 255, .018);
  --glass-hi: rgba(255, 255, 255, .11);
  --glass-lo: rgba(255, 255, 255, .025);
  --shadow-1: rgba(0, 0, 0, .95);
  --shadow-2: rgba(0, 0, 0, .5);
  --bar-1: rgba(12, 12, 13, .9);
  --bar-2: rgba(12, 12, 13, .74);
  --icon-ring: rgba(255, 255, 255, .12);
  --icon-ring-sm: rgba(255, 255, 255, .1);
  --icon-shadow: rgba(0, 0, 0, .9);
  --icon-gloss: rgba(255, 255, 255, .16);
  --btn-1: rgba(255, 255, 255, .1);
  --btn-2: rgba(255, 255, 255, .035);
  --btn-hi: rgba(255, 255, 255, .18);
  --btn-inset: rgba(0, 0, 0, .25);
  --btn-shadow: rgba(0, 0, 0, .9);
  --btn-glow: rgba(255, 255, 255, .2);
  --btn-hover: rgba(255, 255, 255, .28);
  --primary-ink: #0c0c0d;
  --primary-line: rgba(255, 255, 255, .85);
  --primary-1: #f6f6f7;
  --primary-2: #d9d9dc;
  --primary-hi: #ffffff;
  --primary-inset: rgba(0, 0, 0, .12);
  --primary-shadow: rgba(255, 255, 255, .35);
  --primary-glow: rgba(255, 255, 255, .9);
  --focus: rgba(255, 255, 255, .7);
  --ripple: rgba(255, 255, 255, .35);
  --primary-ripple: rgba(0, 0, 0, .14);
  --figure-1: #ffffff;
  --figure-2: #a9a9ae;
  --figure-neg: #f3e3e3;
  --drawer: rgba(255, 255, 255, .022);
  --warn-bg: rgba(205, 185, 143, .07);
  --warn-line: rgba(205, 185, 143, .18);
  --warn-line-2: rgba(205, 185, 143, .25);
  --neg-line: rgba(207, 156, 156, .45);
  --neg-bg: rgba(207, 156, 156, .08);
  --pos-line: rgba(223, 231, 225, .5);
  --pos-bg: rgba(223, 231, 225, .1);
  --track: rgba(255, 255, 255, .08);
  --ring-track: rgba(255, 255, 255, .07);
  --ring-1: #f2f2f2;
  --ring-2: #7a7a80;
  --step-done: rgba(255, 255, 255, .16);
  --step-line-done: rgba(255, 255, 255, .42);
  --input: rgba(255, 255, 255, .05);
  --input-inset: rgba(0, 0, 0, .45);
  --input-focus: rgba(255, 255, 255, .08);
  --input-focus-line: rgba(255, 255, 255, .5);
  --option: #18181b;
  --hover-line: rgba(255, 255, 255, .3);
  --code: rgba(255, 255, 255, .07);
  --code-hi: rgba(255, 255, 255, .14);
  --toast: rgba(30, 30, 33, .82);
  --banner: rgba(24, 24, 27, .94);
  --skel-1: rgba(255, 255, 255, .03);
  --skel-2: rgba(255, 255, 255, .07);
  --spinner: rgba(255, 255, 255, .2);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .9, .24, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --font: "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --gutter: clamp(12px, 4vw, 32px);
  --max: 1120px;
  --bar-h: 64px;
  color-scheme: dark;
}

/* ---------- Light theme: the same matte monochrome, inverted (paper, ink and soft shadow) ---------- */
:root[data-theme="light"] {
  --bg: #f1f1f2;
  --raised: #ffffff;
  --ink: #0d0d0f;
  --ink-2: rgba(13, 13, 15, .72);
  --ink-3: rgba(13, 13, 15, .52);
  --ink-4: rgba(13, 13, 15, .34);
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);
  --fill: rgba(0, 0, 0, .035);
  --fill-2: rgba(0, 0, 0, .06);
  --pos: #2c5a3c;
  --neg: #a33f3f;
  --warn: #86621f;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --spot: rgba(255, 255, 255, .95);
  --spot-2: rgba(0, 0, 0, .025);
  --grain-op: .035;
  --scroll: rgba(0, 0, 0, .18);
  --glass-1: rgba(255, 255, 255, .96);
  --glass-2: rgba(255, 255, 255, .82);
  --glass-3: rgba(255, 255, 255, .74);
  --glass-hi: #ffffff;
  --glass-lo: rgba(0, 0, 0, .02);
  --shadow-1: rgba(24, 24, 32, .16);
  --shadow-2: rgba(24, 24, 32, .07);
  --bar-1: rgba(247, 247, 248, .92);
  --bar-2: rgba(247, 247, 248, .78);
  --icon-ring: rgba(0, 0, 0, .08);
  --icon-ring-sm: rgba(0, 0, 0, .08);
  --icon-shadow: rgba(0, 0, 0, .18);
  --icon-gloss: rgba(255, 255, 255, .12);
  --btn-1: rgba(255, 255, 255, .96);
  --btn-2: rgba(255, 255, 255, .72);
  --btn-hi: #ffffff;
  --btn-inset: rgba(0, 0, 0, .04);
  --btn-shadow: rgba(24, 24, 32, .2);
  --btn-glow: rgba(255, 255, 255, .95);
  --btn-hover: rgba(0, 0, 0, .2);
  --primary-ink: #f6f6f7;
  --primary-line: rgba(0, 0, 0, .9);
  --primary-1: #2b2b2f;
  --primary-2: #0e0e10;
  --primary-hi: rgba(255, 255, 255, .16);
  --primary-inset: rgba(0, 0, 0, .3);
  --primary-shadow: rgba(0, 0, 0, .3);
  --primary-glow: rgba(255, 255, 255, .2);
  --focus: rgba(0, 0, 0, .55);
  --ripple: rgba(0, 0, 0, .1);
  --primary-ripple: rgba(255, 255, 255, .22);
  --figure-1: #0d0d0f;
  --figure-2: #5c5c62;
  --figure-neg: #5e2424;
  --drawer: rgba(255, 255, 255, .62);
  --warn-bg: rgba(134, 98, 31, .07);
  --warn-line: rgba(134, 98, 31, .22);
  --warn-line-2: rgba(134, 98, 31, .3);
  --neg-line: rgba(163, 63, 63, .4);
  --neg-bg: rgba(163, 63, 63, .07);
  --pos-line: rgba(44, 90, 60, .42);
  --pos-bg: rgba(44, 90, 60, .08);
  --track: rgba(0, 0, 0, .08);
  --ring-track: rgba(0, 0, 0, .07);
  --ring-1: #1b1b1e;
  --ring-2: #9d9da3;
  --step-done: rgba(0, 0, 0, .1);
  --step-line-done: rgba(0, 0, 0, .38);
  --input: rgba(255, 255, 255, .92);
  --input-inset: rgba(0, 0, 0, .06);
  --input-focus: #ffffff;
  --input-focus-line: rgba(0, 0, 0, .45);
  --option: #ffffff;
  --hover-line: rgba(0, 0, 0, .22);
  --code: rgba(255, 255, 255, .92);
  --code-hi: #ffffff;
  --toast: rgba(255, 255, 255, .9);
  --banner: rgba(255, 255, 255, .95);
  --skel-1: rgba(0, 0, 0, .03);
  --skel-2: rgba(0, 0, 0, .065);
  --spinner: rgba(0, 0, 0, .15);
  color-scheme: light;
}

/* ---------- Base: a fixed page, like an app — no zoom, no pull, no selection ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  position: fixed;
  inset: 0;
  color: var(--ink);
  font: 400 15px/1.6 var(--font);
  background:
    radial-gradient(1200px 640px at 50% -14%, var(--spot), transparent 62%),
    radial-gradient(760px 560px at 100% 100%, var(--spot-2), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-op);
  background-image: var(--grain);
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
img, a { -webkit-user-drag: none; }
input, select, textarea { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
.n { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* the one scrolling surface; it never bounces past its ends */
.app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}

/* ---------- Surfaces: matte, no backdrop blur (blur stays on the top bar and the toast) ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: linear-gradient(170deg, var(--glass-1), var(--glass-2) 45%, var(--glass-3));
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 var(--glass-lo),
    0 28px 56px -34px var(--shadow-1),
    0 2px 6px -2px var(--shadow-2);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--grain);
  opacity: .05;
}

/* ---------- Top bar: full width, stays on top while the page scrolls under it ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: none;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, var(--bar-1), var(--bar-2));
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
/* the bar spans the whole window: the brand and clock at the far right, the buttons at the far left */
.bar-in { display: flex; align-items: center; gap: 10px; height: var(--bar-h); width: 100%; padding: 0 max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right)); }
.bar-start, .bar-end { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-end { margin-inline-start: auto; gap: 6px; }
.brand { width: 28px; height: 28px; flex: none; fill: var(--ink); }
.brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; margin-inline-end: 6px; }
.clock { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 13px; background: var(--fill); border: 1px solid var(--line); line-height: 1; white-space: nowrap; }
.clock-label { font-size: 12px; color: var(--ink-3); }
.clock-time { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.clock-time.tick { animation: tick .5s var(--ease); }
.clock.stale .clock-label { color: var(--warn); }
.venues { display: flex; gap: 4px; }
.venue { display: inline-flex; padding: 2px; }
.venue.off .appicon, .scan-logos .off .appicon { filter: grayscale(1); opacity: .32; }
.bar-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line-2); flex: none; }

/* ---------- Logos: exchanges as app icons; payment methods sit after their name (to its left) ---------- */
.appicon { position: relative; display: inline-block; flex: none; width: var(--s, 30px); height: var(--s, 30px); border-radius: 28%; overflow: hidden; box-shadow: 0 0 0 1px var(--icon-ring), 0 6px 14px -6px var(--icon-shadow); }
.appicon img { width: 100%; height: 100%; }
.appicon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, var(--icon-gloss), transparent 50%); pointer-events: none; }
.appicon.s14 { --s: 14px; border-radius: 4px; box-shadow: 0 0 0 1px var(--icon-ring-sm); }
.appicon.s16 { --s: 16px; border-radius: 4.5px; box-shadow: 0 0 0 1px var(--icon-ring-sm); }
.appicon.s18 { --s: 18px; border-radius: 5px; box-shadow: 0 0 0 1px var(--icon-ring-sm); }
.appicon.s22 { --s: 22px; border-radius: 7px; }
.appicon.s26 { --s: 26px; }
.appicon.s40 { --s: 40px; }
.appicon.s48 { --s: 48px; }
.method { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.method .appicon { align-self: center; }

/* ---------- Buttons: matte glass, with light that follows the pointer and a press ---------- */
.gbtn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  flex-direction: row-reverse; /* the icon sits after the label, to its left */
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2));
  box-shadow: inset 0 1px 0 var(--btn-hi), inset 0 -2px 6px var(--btn-inset), 0 10px 24px -14px var(--btn-shadow);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform .45s var(--spring), box-shadow .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), opacity .2s;
}
.gbtn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130px 80px at var(--mx, 50%) var(--my, 0%), var(--btn-glow), transparent 70%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.gbtn:hover { border-color: var(--btn-hover); transform: translateY(-1px); }
.gbtn:hover::after { opacity: 1; }
.gbtn:active { transform: scale(.95); transition-duration: .12s; }
.gbtn.primary {
  color: var(--primary-ink);
  border-color: var(--primary-line);
  background: linear-gradient(180deg, var(--primary-1), var(--primary-2));
  box-shadow: inset 0 1px 0 var(--primary-hi), inset 0 -2px 4px var(--primary-inset), 0 14px 30px -14px var(--primary-shadow);
}
.gbtn.primary::after { background: radial-gradient(130px 80px at var(--mx, 50%) var(--my, 0%), var(--primary-glow), transparent 70%); }
.gbtn.primary .ic { stroke-width: 2; }
.gbtn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-3); }
.gbtn.quiet:hover { color: var(--neg); }
.gbtn.armed { color: var(--neg); border-color: var(--neg-line); background: var(--neg-bg); }
.gbtn.xl { height: 54px; padding: 0 30px; font-size: 16px; }
.gbtn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.gbtn.icon { width: 38px; height: 38px; padding: 0; }
.gbtn.icon .ic { width: 18px; height: 18px; }
.gbtn.on { color: var(--primary-ink); background: linear-gradient(180deg, var(--primary-1), var(--primary-2)); border-color: var(--primary-line); }
.gbtn.on .ic { animation: ring-bell 1.2s var(--ease) 1; }
#open-settings.on .ic { animation: none; }
.gbtn.busy { pointer-events: none; opacity: .7; }
.gbtn.busy .ic { animation: spin 1s linear infinite; }
.gbtn.back { flex-direction: row; gap: 4px; height: 38px; padding: 0 14px 0 16px; font-size: 14px; }
.gbtn:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.ripple { position: absolute; z-index: -1; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ripple); pointer-events: none; animation: ripple .7s var(--ease) forwards; }
.gbtn.primary .ripple { background: var(--primary-ripple); }

/* ---------- Page and sections: content sits on the page itself ---------- */
.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 6vw, 56px);
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(22px, 4.6vw, 42px) var(--gutter) clamp(26px, 5vw, 46px);
  animation: rise .7s var(--ease) both;
}
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; margin-bottom: clamp(16px, 3.6vw, 26px); }
.sec-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sec-title { font-size: clamp(15.5px, 4.4vw, 21px); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.stage { display: flex; flex-direction: column; gap: clamp(14px, 3vw, 20px); }
.stage > .sec-head { margin-bottom: clamp(0px, 1vw, 6px); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: .42em 1em; border-radius: 999px; font-size: clamp(10.5px, 3vw, 12.5px); font-weight: 500; color: var(--ink-2); background: var(--fill); border: 1px solid var(--line); white-space: nowrap; }
.chip.strong { color: var(--ink); font-weight: 600; border-color: var(--line-2); }
.chip .ic { width: 14px; height: 14px; }

/* the big figure */
.figure { display: grid; justify-items: center; gap: 4px; text-align: center; margin: 0 0 clamp(4px, 2vw, 16px); }
.figure .label { font-size: clamp(12px, 3.4vw, 14px); color: var(--ink-3); white-space: nowrap; }
.figure .value { display: flex; align-items: baseline; gap: .16em; font-size: clamp(46px, 13.5vw, 92px); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; white-space: nowrap; }
.figure .value .n { background: linear-gradient(180deg, var(--figure-1) 20%, var(--figure-2) 115%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.figure .value.neg .n { background: linear-gradient(180deg, var(--figure-neg) 20%, var(--neg) 115%); -webkit-background-clip: text; background-clip: text; }
.figure .value .cur { font-size: .3em; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.figure .sub { font-size: clamp(11px, 3.2vw, 13.5px); color: var(--ink-3); white-space: nowrap; }

/* ---------- The trade: buy and sell side by side at every size ---------- */
.trade { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: clamp(6px, 1.8vw, 16px); }
.arrow { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 30px; color: var(--ink-3); }
.arrow .flow { flex: 1; width: 1px; max-height: 72px; background: linear-gradient(to bottom, transparent, var(--line-2)); }
.arrow .flow:last-child { background: linear-gradient(to top, transparent, var(--line-2)); }
.arrow .ic { flex: none; width: 26px; height: 26px; stroke-width: 1.4; }
.leg { container-type: inline-size; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: clamp(12px, 3vw, 20px); border-radius: clamp(16px, 3.6vw, 24px); }
.leg-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.leg .leg-top .appicon { --s: clamp(24px, 12cqi, 40px); }
.leg-top .name { min-width: 0; font-size: clamp(12.5px, 6.2cqi, 17px); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-price { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: clamp(20px, 13.5cqi, 38px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.leg-price small { font-size: clamp(9.5px, 4.4cqi, 13px); font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.leg-meta { display: flex; align-items: center; gap: 8px clamp(10px, 2.4cqi, 14px); min-width: 0; font-size: clamp(11.5px, 4.8cqi, 13.5px); color: var(--ink-2); }
.leg-meta > span { display: inline-flex; align-items: center; gap: 7px; flex: none; min-width: 0; max-width: 100%; white-space: nowrap; }
.leg-meta > .who { flex: 0 1 auto; }  /* on one line, the merchant's name is the one that gives way */
.leg-meta .who .mt { display: inline-flex; gap: .3em; }  /* the label stays whole; the name keeps its start */
.leg-meta .who bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.leg-meta.terse .full { display: none; }  /* set by the page when the line is too short for every word */
.leg-meta.terse .short { display: inline; }
.leg-meta.stacked { flex-direction: column; align-items: stretch; gap: 8px; }
.leg-meta.stacked > span { justify-content: space-between; }
.leg-meta .warn, .leg-meta .warn .ic { color: var(--warn); }
.leg-meta .short { display: none; }
.leg-meta .mt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.leg-meta .ic { width: 15px; height: 15px; color: var(--ink-3); }
.leg .open { margin-top: auto; align-self: flex-start; height: 36px; padding: 0 15px; font-size: 13px; }
@container (max-width: 400px) {
  /* narrow ticket: one detail per line — the text on the right, its icon or logo on the left */
  .leg-meta { flex-direction: column; align-items: stretch; gap: 8px; }
  .leg-meta > span { justify-content: space-between; }
  .leg-meta .full { display: none; }  /* a narrow card says the same in fewer words */
  .leg-meta .short { display: inline; }
  .leg .open { align-self: stretch; padding: 0 10px; }
}
@container (max-width: 124px) {
  /* the smallest phones: the logo goes above the title rather than squeezing it */
  .leg-top { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* OKX mode: a side's orders, each a link to its ad — price and amount on one line, the merchant on the next */
.fills { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.fills .fill { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); transition: border-color .25s var(--ease), background .25s var(--ease); }
.fills .fill:hover { border-color: var(--hover-line); background: var(--fill-2); }
.fills .f-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; white-space: nowrap; }
.fills .f-price { font-size: clamp(13px, 6.4cqi, 15.5px); font-weight: 700; }
.fills .f-amt { font-size: clamp(11px, 5.2cqi, 13px); color: var(--ink-2); }
.fills .f-who { font-size: clamp(10.5px, 4.8cqi, 12.5px); color: var(--ink-3); }
.fills .f-who bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fills .f-marks { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.fills .f-marks .ic { width: 13px; height: 13px; }
@container (max-width: 240px) {
  .fills .f-line:first-child { flex-direction: column; align-items: flex-start; gap: 0; }  /* a narrow card: the amount under the price */
}
#okx-mode.on .ic { animation: none; }

.cta { display: grid; justify-items: center; gap: 12px; margin: clamp(6px, 2vw, 14px) 0; }
.cta .gbtn { width: min(100%, 340px); }
.assure { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 7px; font-size: clamp(11.5px, 3.2vw, 12.5px); color: var(--ink-3); white-space: nowrap; }

/* ---------- Details ---------- */
details.drawer { border-radius: var(--r-lg); background: var(--drawer); border: 1px solid var(--line); }
details.drawer > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; color: var(--ink-2); font-size: clamp(13px, 3.6vw, 14px); font-weight: 500; white-space: nowrap; border-radius: inherit; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > summary .chev { transition: transform .45s var(--spring); color: var(--ink-3); }
details.drawer[open] > summary .chev { transform: rotate(180deg); }
.drawer-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 4px 18px 18px; animation: unfold .5s var(--ease) both; }
.drawer-body h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 22px 28px; align-items: start; }
.cols > .wide { grid-column: 1 / -1; }
.cols > div { min-width: 0; }  /* a card never grows past the screen; its rows fit or shorten instead */

/* the unit after a price: ج.م / USDT */
.u { font-size: .76em; font-weight: 500; color: var(--ink-3); letter-spacing: 0; white-space: nowrap; }

/* profit breakdown and deal facts: cards with hairline rows, like the price table */
.receipt, .kv { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.receipt li, .kv li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 12px; font-size: clamp(12px, 3.4vw, 14px); color: var(--ink-2); white-space: nowrap; }
.receipt li + li, .kv li + li { border-top: 1px solid var(--line); }
.receipt li > span:first-child, .kv li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.receipt li.minus .n { color: var(--ink-3); }
.kv .short, .warnline .short { display: none; }
@media (max-width: 460px) {
  .warnline .full { display: none; }
  .warnline .short { display: inline; }
  .receipt .sub { display: block; font-size: .85em; color: var(--ink-3); }  /* a fee's USDT amount on its own short line */
  .kv .full { display: none; }  /* a narrow phone says the same in fewer words */
  .kv .short { display: inline; }
}
.receipt li.total { padding: 11px 12px; border-top-color: var(--line-2); background: var(--fill); font-weight: 700; font-size: clamp(13.5px, 3.8vw, 15.5px); color: var(--ink); }
.kv li > span:first-child { color: var(--ink-3); }
.kv li.warn, .kv li.warn > span:first-child { color: var(--warn); }
/* the merchants' conditions: one block per ad, a ticked box for each condition the owner's account meets */
.conds { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.conds li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 12px; font-size: clamp(12px, 3.4vw, 14px); color: var(--ink-2); white-space: nowrap; }
.conds li + li { border-top: 1px solid var(--line); }
.conds li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conds .c-head { background: var(--fill); color: var(--ink); font-weight: 600; }
.conds .c-name { display: inline-flex; align-items: center; gap: 8px; }
.conds .c-sum { font-weight: 500; color: var(--ink-3); }
.met-box { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; color: var(--pos); background: var(--pos-bg); border: 1px solid var(--pos-line); }
.met-box .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.met-box.no { background: var(--warn-bg); border-color: var(--warn-line-2); }

/* minimum sale price on each platform */
.targets-wrap { container-type: inline-size; }
.targets { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.t-head, .t-row { display: contents; }
.t-head > *, .t-row > * { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t-row:last-child > * { border-bottom: 0; }
.t-head > * { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); background: var(--fill); }
.t-name { display: flex; align-items: center; gap: 8px; font-size: clamp(12.5px, 3.5vw, 14px); color: var(--ink-2); }
.t-cell { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: clamp(13.5px, 3.8vw, 15px); font-weight: 700; }
.t-cell .t-m { display: none; }
.table-note { margin-top: 8px; padding-inline: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
@container (max-width: 400px) {
  /* narrow: one block per platform, each method on its own line with its price on the left */
  .targets { display: block; }
  .t-head { display: none; }
  .t-row { display: grid; gap: 8px; padding: 11px 12px; }
  .t-row + .t-row { border-top: 1px solid var(--line); }
  .t-row > * { padding: 0; border-bottom: 0; }
  .t-name { color: var(--ink); font-weight: 600; }
  .t-cell { justify-content: space-between; font-size: 14px; }
  .t-cell .t-m { display: inline-flex; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
}
.warnline { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: clamp(12px, 3.3vw, 13px); color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); white-space: nowrap; overflow: hidden; }

/* ---------- Scanning: no trade right now ---------- */
/* nothing to offer: the scan sits in the middle of the page, a touch above centre */
.stage:has(> .scan) { flex: 1 0 auto; justify-content: center; }
.scan { display: grid; justify-items: center; gap: clamp(10px, 1.6vh, 14px); padding: 0 0 clamp(24px, 7vh, 72px); text-align: center; }
.scan-logos { display: flex; gap: clamp(12px, 3vw, 16px); margin-bottom: clamp(8px, 1.6vh, 14px); }
.scan-logos .appicon { --s: clamp(44px, 13vw, 56px); }
.scan h2 { font-size: clamp(18px, 5.6vw, 32px); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; margin-bottom: 4px; }
.scan .line { font-size: clamp(11.5px, 3.4vw, 16px); color: var(--ink-3); white-space: nowrap; }
.next-scan { display: grid; justify-items: center; gap: 10px; width: min(320px, 100%); margin-top: clamp(10px, 2vh, 18px); font-size: clamp(12px, 3.2vw, 13.5px); color: var(--ink-3); white-space: nowrap; }
.next-scan .track { width: 100%; height: 3px; border-radius: 999px; background: var(--track); overflow: hidden; }
.next-scan .track span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--ink-2); transition: width 1s linear; }

/* ---------- Open position: expected vs now ---------- */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(8px, 2vw, 14px); align-items: stretch; }
.tile { container-type: inline-size; display: grid; align-content: start; gap: 2px; min-width: 0; padding: clamp(12px, 3vw, 18px); border-radius: var(--r-lg); }
.tile .k { font-size: clamp(11px, 6.6cqi, 13px); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font-size: clamp(19px, 12.5cqi, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; }
.tile .v small { font-size: .45em; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.tile .s { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: clamp(10.5px, 6cqi, 12.5px); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.tile .open { justify-self: start; margin-top: 10px; }
@container (max-width: 220px) { .tile .open { justify-self: stretch; padding: 0 10px; } }
.lockrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 4vw, 30px); align-items: center; }
.ring-wrap { position: relative; width: clamp(136px, 38vw, 176px); height: clamp(136px, 38vw, 176px); }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--ring-track); }
.ring stop:first-child { stop-color: var(--ring-1); }
.ring stop:last-child { stop-color: var(--ring-2); }
.ring .bar { stroke: url(#ring-g); stroke-linecap: round; stroke-dasharray: 534; stroke-dashoffset: calc(534 * (1 - var(--p, 0))); transition: stroke-dashoffset 1s linear; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-time { font-size: clamp(20px, 6vw, 26px); font-weight: 700; letter-spacing: .02em; }
.ring-label { font-size: clamp(10.5px, 3vw, 12px); color: var(--ink-3); white-space: nowrap; }

/* a row of small figures with hairlines between them */
/* columns take what their figure needs, then share the rest; only a long name gets an ellipsis */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stats.c2 { grid-template-columns: repeat(2, minmax(0, auto)); }
.stats.c4 { grid-template-columns: repeat(4, minmax(0, auto)); }
.stat { display: grid; gap: 2px; min-width: 0; padding: clamp(10px, 2.6vw, 14px) clamp(10px, 2.8vw, 16px); background: var(--raised); }
.stat .k { font-size: clamp(10.5px, 2.8vw, 12px); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: clamp(12.5px, 3.4vw, 15px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- While the user executes ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 clamp(4px, 1.6vw, 12px); padding: 0; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; font-size: clamp(10.5px, 3vw, 13px); color: var(--ink-3); white-space: nowrap; text-align: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 14px; inset-inline-start: calc(50% + 18px); width: calc(100% - 28px); height: 1px; background: var(--line-2); }
.steps .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 700; background: var(--raised); border: 1px solid var(--line-2); color: var(--ink-2); }
.steps .dot .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.steps li.done { color: var(--ink-2); }
.steps li.done .dot { background: var(--step-done); border-color: transparent; color: var(--ink); }
.steps li.done::after { background: var(--step-line-done); }
.steps li.now { color: var(--ink); font-weight: 500; }
.steps li.now .dot { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.order { display: flex; align-items: center; gap: clamp(12px, 3vw, 16px); padding: clamp(14px, 3.4vw, 20px); border-radius: var(--r-lg); }
.order .t { min-width: 0; font-size: clamp(14px, 4.2vw, 19px); font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 10px; width: min(100%, 560px); margin: clamp(4px, 1.6vw, 10px) auto 0; }
.actions .gbtn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.field { display: grid; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.field > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
input, select {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--input);
  color: var(--ink);
  box-shadow: inset 0 1px 3px var(--input-inset);
  font: 500 16px var(--font);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
input::placeholder { color: var(--ink-4); }
input:focus, select:focus { outline: none; border-color: var(--input-focus-line); background: var(--input-focus); }
select option { background: var(--option); }
.foot-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.lead { text-align: center; font-size: clamp(12.5px, 3.6vw, 15.5px); color: var(--ink-2); white-space: nowrap; }
.lead.ask { margin: -6px 0 clamp(2px, 1.4vw, 10px); color: var(--ink); font-weight: 600; }
.choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(8px, 2vw, 12px); }
.choice { overflow: hidden; display: grid; justify-items: start; gap: 4px; min-width: 0; padding: clamp(14px, 3.4vw, 20px); border-radius: var(--r-lg); text-align: start; cursor: pointer; transition: transform .45s var(--spring), border-color .3s; }
.choice:hover { border-color: var(--hover-line); transform: translateY(-2px); }
.choice:active { transform: scale(.97); transition-duration: .12s; }
.choice b { font-size: clamp(13.5px, 3.8vw, 16px); white-space: nowrap; }
.choice small { font-size: clamp(11px, 3vw, 13px); color: var(--ink-3); white-space: nowrap; }


/* ---------- History: hairline rows, no boxes ---------- */
.totals { display: flex; gap: 8px; }
.hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: clamp(12px, 3vw, 16px) 2px; border-bottom: 1px solid var(--line); }
.hist .trip { display: grid; gap: 5px; min-width: 0; }
.hist .ln { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: clamp(12px, 3.3vw, 14px); white-space: nowrap; overflow: hidden; }
.hist .when { font-size: clamp(10.5px, 2.9vw, 12px); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist .res { display: grid; justify-items: end; }
.hist .res b { font-size: clamp(14px, 4vw, 18px); white-space: nowrap; }
.hist .res small { font-size: clamp(10.5px, 2.9vw, 12px); color: var(--ink-3); white-space: nowrap; }

/* ---------- Settings: a page of grouped rows, not a pop-up ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(22px, 4.6vw, 32px) 28px; align-items: start; }
.group { display: grid; gap: 8px; min-width: 0; }
.group h3 { padding-inline: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.group .note { padding-inline: 6px; font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.rows { list-style: none; margin: 0; padding: 0; border-radius: var(--r-md); background: var(--fill); border: 1px solid var(--line); overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row .lbl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: clamp(12.5px, 3.5vw, 14px); white-space: nowrap; overflow: hidden; }
.row .lbl > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row input { flex: none; width: clamp(74px, 22vw, 116px); height: 38px; padding: 0 12px; border-radius: 11px; direction: ltr; text-align: left; }
.row .unit { flex: none; width: 3em; font-size: 12px; color: var(--ink-3); text-align: end; white-space: nowrap; }
.row .dev { display: grid; gap: 0; }
.row .dev .t { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.row .dev .chip { padding: .2em .8em; font-size: 11px; }
.row .dev .s { font-size: 12px; color: var(--ink-3); }
.devices-group { margin-top: clamp(4px, 1vw, 8px); }
.accounts-group { margin-bottom: clamp(22px, 4.6vw, 32px); }
.row input.wide { flex: 1; width: auto; }
.row.end { justify-content: flex-end; }
.key-hint { color: var(--ink-2); letter-spacing: .04em; }
.row .val { flex: none; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.row .lbl.wrap, .row .lbl.wrap > span { white-space: normal; }  /* an error explains itself in full */
.chips { display: inline-flex; align-items: center; gap: 6px; }
/* the USDT on its way between platforms */
.move { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); }
.move .mv-route, .move .mv-route .from { flex: none; display: flex; align-items: center; gap: 5px; }
.move .mv-route .ic { width: 14px; height: 14px; color: var(--ink-3); }
.move .mv-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.move .mv-text b { font-size: clamp(12.5px, 3.6vw, 14px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move .mv-text small { font-size: clamp(11.5px, 3.2vw, 12.5px); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move > .gbtn, .move > .spinner { flex: none; }
.move.warn { border-color: var(--warn-line-2); background: var(--warn-bg); }
.move.warn .mv-text small { color: var(--warn); white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
@media (max-width: 520px) {  /* a phone: the destination alone, and the button on a row of its own */
  .move { flex-wrap: wrap; row-gap: 10px; }
  .move > .gbtn { flex: 1 0 100%; }
  .move .mv-route .from { display: none; }
}
/* settings: deposit addresses and the automatic-transfer switch */
.row .lbl.fit { flex: none; }
.row input.addr { flex: 1; width: auto; min-width: 0; font-size: 12.5px; }
.notes { display: grid; gap: 2px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; }
.row .switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-2); border: 1px solid var(--line-2); pointer-events: none; transition: background .25s var(--ease), border-color .25s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3); transition: inset-inline-start .3s var(--spring), background .25s var(--ease); }
.switch input:checked + span { background: linear-gradient(180deg, var(--primary-1), var(--primary-2)); border-color: var(--primary-line); }
.switch input:checked + span::after { inset-inline-start: 21px; background: var(--primary-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.infoline { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: clamp(12px, 3.3vw, 13px); color: var(--ink-2); background: var(--fill); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; }

/* ---------- Toast, offline banner, footer, skeleton ---------- */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 18px;
  border-radius: 18px;
  font-size: clamp(12.5px, 3.4vw, 14px);
  font-weight: 500;
  line-height: 1.5;
  background: var(--toast);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-2);
  box-shadow: 0 22px 50px -22px var(--shadow-1);
  transform: translateX(-50%);
  animation: toast-in .55s var(--spring) both;
}
.toast .ic { width: 19px; height: 19px; color: var(--ink-2); }
.toast.no .ic { color: var(--neg); }
.banner { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top) + 10px); z-index: 25; align-self: center; margin-top: 10px; padding: 8px 16px; border-radius: 999px; font-size: clamp(11.5px, 3.2vw, 13px); color: var(--warn); background: var(--banner); border: 1px solid var(--warn-line-2); white-space: nowrap; }
.foot { flex: none; padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom)); text-align: center; font-size: clamp(10.5px, 2.9vw, 12px); color: var(--ink-4); white-space: nowrap; }
.skeleton { height: 260px; border-radius: var(--r-xl); background: linear-gradient(100deg, var(--skel-1) 30%, var(--skel-2) 50%, var(--skel-1) 70%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }

/* ---------- Device gate ---------- */
.gate { flex: 1 0 auto; display: grid; place-content: center; justify-items: center; gap: 20px; padding: 40px var(--gutter) 64px; text-align: center; animation: rise .7s var(--ease) both; }
.gate-body { display: grid; justify-items: center; gap: 16px; width: min(420px, 100%); }
.gate-body.swap { animation: rise .55s var(--ease) both; }
.gate h1 { font-size: clamp(20px, 6vw, 26px); font-weight: 700; white-space: nowrap; }
.gate .lead { display: grid; gap: 2px; color: var(--ink-3); font-size: clamp(12px, 3.5vw, 14px); }
.gate .lead span { white-space: nowrap; }
.gate .gbtn { width: 100%; }
.gate-sk { width: 100%; height: 150px; }
/* signing in: the page's own keypad, so no phone keyboard ever opens */
.pin { display: grid; justify-items: center; gap: 12px; width: min(100%, 300px); }
.slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; width: 100%; }
.slot { display: grid; place-items: center; height: 52px; border-radius: 14px; font-size: 24px; font-weight: 700; color: var(--ink); background: var(--input); border: 1px solid var(--line-2); box-shadow: inset 0 1px 3px var(--input-inset); transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.slot.on { border-color: var(--input-focus-line); }
.slot.filled { animation: pop .22s var(--spring); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.key { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 56px; padding: 0; border-radius: 16px; font: 600 22px var(--font); color: var(--ink); background: var(--fill); border: 1px solid var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s var(--ease), background .2s var(--ease), opacity .2s, color .2s, border-color .2s; }
.key:hover { background: var(--fill-2); }
.key:active { transform: scale(.94); }
.key .ic { width: 22px; height: 22px; }
.key.fn { color: var(--ink-2); }
.key.go { font-size: 15.5px; color: var(--primary-ink); background: linear-gradient(180deg, var(--primary-1), var(--primary-2)); border-color: var(--primary-line); box-shadow: 0 10px 24px -14px var(--primary-shadow); }
.key.go .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.key.go:disabled { opacity: .3; cursor: default; transform: none; }
.key.go.busy .ic { animation: spin .9s linear infinite; }
.pin.paused .key:not(.go) { opacity: .4; pointer-events: none; }
/* a wrong code: the slots and the button shake and turn red, with a low double buzz */
.pin.wrong .slots, .pin.wrong .go { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
.pin.wrong .slot, .pin.wrong .go { color: var(--neg); background: var(--neg-bg); border-color: var(--neg-line); opacity: 1; }
/* the right code: the slots light up one after another, with a short chime */
.pin.right .slot { color: var(--pos); background: var(--pos-bg); border-color: var(--pos-line); animation: lit .55s var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms); }
.pin.right .go { opacity: 1; }
@keyframes pop { from { transform: scale(.84); } to { transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes lit { 0% { transform: none; } 45% { transform: translateY(-6px) scale(1.06); } 100% { transform: none; } }
.gate .back { width: auto; }
/* setting up: copy the key on the phone, scan the QR on a computer */
.setup-steps { display: grid; justify-items: center; gap: 14px; width: 100%; }
.howto { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; justify-self: stretch; }
.howto li { display: flex; align-items: center; gap: 10px; font-size: clamp(13px, 3.7vw, 14.5px); color: var(--ink-2); white-space: nowrap; }
.howto .num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 700; color: var(--ink); background: var(--fill-2); border: 1px solid var(--line-2); }
.only-desktop { display: none; }
.gate .qr { width: 198px; height: 198px; border-radius: 16px; }
.gate .manual { display: grid; justify-items: center; gap: 10px; width: 100%; font-size: 13px; color: var(--ink-3); }
.gate .manual summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.gate .manual summary::-webkit-details-marker { display: none; }
.gate .manual .gbtn { width: auto; }
.gate .secret { display: grid; gap: 4px; font-size: 16px; font-weight: 600; letter-spacing: .08em; color: var(--ink); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {  /* a computer: the phone scans the QR from the screen */
  .only-desktop { display: grid; }
  .only-phone { display: none; }
}
@media (max-height: 720px) {  /* a short phone screen: the keypad still fits without scrolling */
  .gate { gap: 12px; padding-top: 18px; padding-bottom: 28px; }
  .device-icon { width: 38px; height: 38px; }
  .slot { height: 46px; font-size: 21px; }
  .key { height: 50px; }
}
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--spinner); border-top-color: var(--ink); animation: spin .9s linear infinite; }
.error { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 22px; color: var(--neg); font-size: 13.5px; white-space: nowrap; }
.device-icon { width: 50px; height: 50px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Screen transitions (View Transitions API) ---------- */
#stage { view-transition-name: stage; }
/* theme switch: the whole new page is revealed as one circle from the button (animated from app.js) */
html.theming #stage { view-transition-name: none; }
html.theming::view-transition-old(root), html.theming::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
#theme .ic.swap { animation: icon-in .6s var(--spring); }
::view-transition-old(stage) { animation: vt-out .3s var(--ease) both; }
::view-transition-new(stage) { animation: vt-in .55s var(--spring) both; }

/* ---------- Motion: only where it means something ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes vt-out { to { opacity: 0; transform: scale(.98); filter: blur(8px); } }
@keyframes vt-in { from { opacity: 0; transform: scale(1.02); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { from { transform: scale(1); opacity: .5; } to { transform: scale(26); opacity: 0; } }
@keyframes ring-bell { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 24px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes tick { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes icon-in { from { opacity: 0; transform: rotate(-90deg) scale(.5); } to { opacity: 1; transform: none; } }

/* ---------- Tablets and phones: same layout, scaled down — nothing stacks, nothing wraps ---------- */
@media (max-width: 760px) {
  .arrow { width: 16px; gap: 8px; }
  .arrow .flow { max-height: 48px; }
  .arrow .ic { width: 16px; height: 16px; stroke-width: 1.6; }
  .lockrow { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .lockrow .duo { width: 100%; }
  .stats.c4 { grid-template-columns: repeat(2, minmax(0, auto)); }
  .foot-actions { grid-template-columns: minmax(0, 1fr); }
  .foot-actions > .gbtn { justify-self: center; }
}
@media (max-width: 600px) {
  :root { --bar-h: 56px; }
  .bar-in { gap: 6px; }
  .bar-start { gap: 6px; }
  .brand-name, .bar-sep { display: none; }
  .gate-page .brand-name { display: inline; }
  .brand { width: 24px; height: 24px; }
  .clock { height: 32px; gap: 5px; padding: 0 9px; border-radius: 11px; }
  .clock-label { font-size: 11px; }
  .clock-time { font-size: 12.5px; }
  .venues { gap: 2px; }
  .venue { padding: 1px; }
  .venue .appicon { --s: 22px; border-radius: 7px; }
  .bar-end { gap: 4px; }
  .gbtn.icon { width: 34px; height: 34px; }
  .gbtn.icon .ic { width: 17px; height: 17px; }
  .gbtn.xl { height: 52px; }
  .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fields .gbtn { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .history .sec-head { flex-direction: column; align-items: flex-start; } /* the totals sit under the title */
}
@media (max-width: 360px) {
  /* three figures no longer fit side by side: one per line, label right and figure left */
  .stats.c3 { grid-template-columns: minmax(0, 1fr); }
  .stats.c3 .stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .row { gap: 8px; padding: 8px 10px; }
  .row .unit { width: 2.6em; }
}
@media (max-width: 400px) {
  body:not(.gate-page) .brand { display: none; } /* the top bar keeps the clock, the platforms and three buttons */
  .venue .appicon { --s: 20px; border-radius: 6px; }
}
@media (max-width: 352px) {
  .venues { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
