/* =========================================================================
   iwts.link — visual system
   Direction: "quiet confidence" — warm paper, emerald ink, editorial type.
   Theme: system default + manual override via [data-theme="light|dark"].
   ========================================================================= */

/* ---- Light tokens (default) ------------------------------------------- */
:root {
  --paper:      #faf8f2;
  --paper-2:    #ffffff;
  --ink:        #15211b;
  --ink-soft:   #5c6b62;
  --ink-faint:  #97a39b;
  --line:       #e8e3d6;
  --line-strong:#d8d2c2;

  --brand:      #0e7c4a;
  --brand-2:    #0a5e38;
  --brand-tint: #e9f3ec;
  --clay:       #c0703f;

  --danger:     #b3261e;
  --danger-soft:#9b2226;

  --ring:       0 0 0 4px rgba(14, 124, 74, .18);
  --shadow-sm:  0 1px 2px rgba(20, 33, 26, .05);
  --shadow-md:  0 5px 16px -12px rgba(20, 33, 26, .18);
  --shadow-lg:  0 10px 26px -18px rgba(20, 33, 26, .22);

  /* atmosphere: a whisper-faint emerald wash — restful, not tinted, in daylight */
  --glow-1: color-mix(in oklab, var(--brand) 6%, transparent);
  --glow-2: color-mix(in oklab, var(--brand) 3%, transparent);

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-pill: 999px;
  --maxw: 1080px; --maxw-narrow: 560px;

  --font-display: "Fraunces", "Tajawal", Georgia, serif;
  --font-body: "Hanken Grotesk", "Tajawal", system-ui, -apple-system, sans-serif;
}

[dir="rtl"] {
  --font-display: "Tajawal", system-ui, sans-serif;
  --font-body:    "Tajawal", system-ui, sans-serif;
}

/* dark token values, reused by the system preference and the manual toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0e1512;
    --paper-2:    #141d18;
    --ink:        #eaf1ec;
    --ink-soft:   #9db0a6;
    --ink-faint:  #66776d;
    --line:       #233029;
    --line-strong:#2e3d35;
    --brand:      #41d88e;
    --brand-2:    #2bbe78;
    --brand-tint: #13241c;
    --danger:     #ffb4a8;
    --danger-soft:#ffb4a8;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow-md:  0 5px 16px -12px rgba(0,0,0,.5);
    --shadow-lg:  0 10px 26px -18px rgba(0,0,0,.55);
    --ring:       0 0 0 4px rgba(65, 216, 142, .22);
    --glow-1: color-mix(in oklab, var(--brand) 16%, transparent);
    --glow-2: color-mix(in oklab, #2f6f55 22%, transparent);
  }
}
[data-theme="dark"] {
  --paper:      #0e1512;
  --paper-2:    #141d18;
  --ink:        #eaf1ec;
  --ink-soft:   #9db0a6;
  --ink-faint:  #66776d;
  --line:       #233029;
  --line-strong:#2e3d35;
  --brand:      #41d88e;
  --brand-2:    #2bbe78;
  --brand-tint: #13241c;
  --danger:     #ffb4a8;
  --danger-soft:#ffb4a8;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 5px 16px -12px rgba(0,0,0,.5);
  --shadow-lg:  0 10px 26px -18px rgba(0,0,0,.55);
  --ring:       0 0 0 4px rgba(65, 216, 142, .22);
  --glow-1: color-mix(in oklab, var(--brand) 16%, transparent);
  --glow-2: color-mix(in oklab, #2f6f55 22%, transparent);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; position: relative; overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}
/* Atmosphere: an asymmetric emerald aurora that leans toward the top-start
   edge (not a symmetric centered wash), warmed by a faint clay bloom on the
   opposite corner — gives the page depth and a deliberate light direction. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(52% 46% at 18% -8%, var(--glow-1), transparent 68%),
    radial-gradient(40% 38% at 96% 4%, var(--glow-2), transparent 62%),
    radial-gradient(70% 55% at 50% 118%, color-mix(in oklab, var(--brand) 4%, transparent), transparent 70%);
}
/* Texture layer: a hand-drawn-feeling SVG grain over a fine dot grid.
   The grain breaks up flatness; the dots stay whisper-quiet. Self-contained
   data-URI — no external resource, CSP-safe. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(var(--ink) .55px, transparent .6px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 24px 24px, 160px 160px;
  color: var(--ink); opacity: .035;
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; opacity: .05; }
}
[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: .05; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }

/* ---- Layout ----------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--maxw-narrow); }
main { padding: clamp(28px, 6vw, 72px) 0 64px; }

/* ---- Header ----------------------------------------------------------- */
header.site {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.brand:hover .mark { transform: rotate(-6deg) scale(1.04); box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.3); }
.brand .mark svg { width: 19px; height: 19px; }
.brand .word { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.brand .word b { color: var(--brand); font-weight: 600; }

.head-tools { display: inline-flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px;
  padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper-2); box-shadow: var(--shadow-sm); }
.lang-switch a {
  display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 12px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-soft); text-decoration: none; transition: color .2s, background .2s;
}
.lang-switch a.active { color: #fff; background: var(--brand); box-shadow: var(--shadow-sm); }
.lang-switch a:not(.active):hover { color: var(--ink); }

.theme-toggle, .head-link {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--ink-soft); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: color .2s, transform .15s, border-color .2s;
}
.head-link svg { width: 19px; height: 19px; }
.head-link:hover { color: var(--brand); border-color: color-mix(in oklab, var(--brand) 35%, var(--line)); }
.theme-toggle:hover { color: var(--brand); transform: rotate(-12deg); border-color: color-mix(in oklab, var(--brand) 35%, var(--line)); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: none; }
}
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
[data-theme="light"] .theme-toggle .ic-sun { display: none; }
[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* ---- Hero ------------------------------------------------------------- */
.hero { text-align: center; margin-bottom: 8px; }

h1.display {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(35px, 6.4vw, 62px); line-height: 1.02; letter-spacing: -.028em;
  margin: 22px auto 16px; max-width: 15ch; font-optical-sizing: auto;
  font-feature-settings: "liga" 1, "calt" 1, "ss01" 1;
  text-wrap: balance;
}
[dir="rtl"] h1.display { font-weight: 800; letter-spacing: 0; line-height: 1.22; max-width: 20ch; }
/* The italic Fraunces cut is the most characterful self-hosted face — use it
   for the accent as a true editorial flourish, lifted optically. */
h1.display .accent { color: var(--brand); font-style: italic; font-weight: 600; letter-spacing: -.01em; }
[dir="rtl"] h1.display .accent { font-style: normal; font-weight: 800; letter-spacing: 0; }
.lede { color: var(--ink-soft); font-size: clamp(16px, 2.2vw, 19px); line-height: 1.62;
  max-width: 46ch; margin: 0 auto 34px; text-wrap: pretty; }
/* Justify body paragraphs (both edges) — not the centered hero intros. */
.narrow:not(.hero) .lede,
.guide .gbody p, .how-cell p, .faq .ans,
.prose p, .prose li { text-align: justify; }

/* ---- Card ------------------------------------------------------------- */
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow-md);
}
.card.elevated { box-shadow: var(--shadow-lg); }
/* The create card is the centerpiece: layered surface with a faint brand wash
   bleeding from the top-start corner, a 1px gradient keyline, and a soft inner
   sheen — distinctive framing without a heavy glow. */
.create-card {
  position: relative; max-width: var(--maxw-narrow); margin: 0 auto;
  background: var(--paper-2);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in oklab, #fff 50%, transparent);
}
[data-theme="dark"] .create-card { box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .create-card { box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.04); } }
.create-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: 0; padding: 1px;
  background: linear-gradient(150deg, color-mix(in oklab, var(--brand) 32%, transparent), transparent 45%, color-mix(in oklab, var(--brand) 14%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .5; pointer-events: none;
}
.create-card > * { position: relative; z-index: 1; }

/* ---- Form ------------------------------------------------------------- */
/* Honeypot: present for bots, zero layout footprint, no off-screen offset
   (a negative left here widens the page and causes horizontal scroll). */
.hp { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.field { text-align: start; margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 8px; letter-spacing: .01em; }
.input-wrap { position: relative; display: flex; align-items: center; }
/* physical sides keyed on page direction (the input itself is dir=ltr for the number,
   so logical properties would resolve to the wrong side — use left/right explicitly) */
.input-wrap .lead { position: absolute; left: 16px; right: auto; color: var(--ink-faint);
  font-weight: 600; pointer-events: none; display: inline-flex; align-items: center; gap: 6px; }
[dir="rtl"] .input-wrap .lead { left: auto; right: 16px; }
.input-wrap .lead svg { width: 18px; height: 18px; }
/* Recover-via-email link (my-links page) — clearly visible, not muted. */
.recover-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand);
  font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--brand-tint); border: 1px solid color-mix(in oklab, var(--brand) 28%, transparent); }
.recover-link:hover { background: color-mix(in oklab, var(--brand) 16%, var(--paper-2)); }

/* Attention card: a distinctive brand-tinted background that draws the eye —
   colour, not a heavy shadow (used for the email-recovery prompt). */
.card.attention {
  background: color-mix(in oklab, var(--brand) 16%, var(--paper-2));
  border: 1.5px solid color-mix(in oklab, var(--brand) 42%, var(--line));
  box-shadow: var(--shadow-sm);
}

/* Default country flag (from IP) shown as the field's leading indicator.
   zoom scales the 50px sprite cell down to ~21px without breaking the
   per-country background-position from flags.css. */
.lead-flag { display: inline-block; width: 50px; height: 50px; zoom: .42;
  background-image: url(https://s3.eu-west-2.amazonaws.com/qmasters/flags.png);
  border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
/* all form controls inherit the project font */
button, input, select, textarea { font-family: inherit; }

input[type="tel"], input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], textarea {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 15px 16px;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.input-wrap input { padding-left: 46px; padding-right: 16px; letter-spacing: .02em; }
[dir="rtl"] .input-wrap input { padding-left: 16px; padding-right: 46px; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) { border-color: color-mix(in oklab, var(--brand) 30%, var(--line-strong)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); background: var(--paper-2); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 88px; }
select {
  font-family: inherit; font-size: 15px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

/* ---- Distribution-mode choice cards (multi-number link) -------------- */
.mode-options { display: grid; gap: 10px; margin-top: 4px; }
.mode-opt {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.mode-opt:hover { border-color: var(--brand); }
.mode-opt input[type="radio"] { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.mode-opt-title { display: block; font-weight: 600; line-height: 1.3; }
.mode-opt-desc { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.slug-input { display: flex; align-items: stretch; direction: ltr; border: 1.5px solid var(--line-strong);
  border-radius: var(--r); background: var(--paper); overflow: hidden; }
.slug-input:focus-within { border-color: var(--brand); box-shadow: var(--ring); background: var(--paper-2); }
.slug-input .slug-prefix { display: inline-flex; align-items: center; padding: 0 12px;
  background: color-mix(in oklab, var(--brand) 8%, var(--paper-2)); color: var(--ink-soft);
  font-size: 14px; direction: ltr; white-space: nowrap; border-inline-end: 1.5px solid var(--line); }
.slug-input input { border: 0 !important; border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; flex: 1; min-width: 0; }
.field-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 12px;
  background: var(--brand-tint); color: var(--brand); border-radius: var(--r-sm);
  border: 1px solid color-mix(in oklab, var(--brand) 22%, transparent);
  font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.field-note svg { flex: 0 0 auto; width: 16px; height: 16px; }
@media (prefers-color-scheme: dark) { .field-note { color: var(--brand); } }
.optional-msg { margin-bottom: 4px; }
.optional-msg > summary { cursor: pointer; list-style: none; font-size: 14px; font-weight: 600;
  color: var(--brand); display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; user-select: none; }
.optional-msg > summary::-webkit-details-marker { display: none; }
.optional-msg > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 6px; background: var(--brand-tint); font-weight: 700; line-height: 1;
  border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent); }
.optional-msg[open] > summary::before { content: "\2212"; }

/* ---- Segment toggle (single / multi switch above the create card) -----
   home.php renders this as `.btn.ghost` + `.seg-active`; style it as a
   contained pill switch so it reads as a control, not two primary buttons. */
.seg-toggle {
  display: inline-flex; gap: 4px; padding: 4px; margin-inline: auto;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--paper-2) 70%, transparent);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.seg-toggle .btn,
.seg-toggle .btn.ghost {
  padding: 9px 20px; font-size: 14.5px; font-weight: 600; border: 0;
  border-radius: var(--r-pill); color: var(--ink-soft); background: transparent;
  box-shadow: none; transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.seg-toggle .btn:hover { color: var(--ink); transform: none; box-shadow: none; filter: none; }
.seg-toggle .btn.seg-active {
  color: #fff; background: linear-gradient(160deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.22);
}
.seg-toggle .btn.seg-active:hover { color: #fff; transform: none; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 16px; font-weight: 600; letter-spacing: .01em;
  color: #fff; text-decoration: none; cursor: pointer; padding: 15px 22px; border: 0; border-radius: var(--r);
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .14s ease, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.25); filter: saturate(108%); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn.block { width: 100%; }
[dir="rtl"] .btn > svg:last-child { transform: scaleX(-1); }
.btn--ghost, .btn.ghost { color: var(--brand); background: transparent; border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn--ghost:hover, .btn.ghost:hover { background: var(--brand-tint); border-color: color-mix(in oklab, var(--brand) 40%, transparent); transform: translateY(-1px); box-shadow: none; filter: none; }
.btn--sm { padding: 9px 14px; font-size: 14px; border-radius: var(--r-sm); }
/* the multi-number row delete button is a compact square ghost */
.btn.ghost.g-del { padding: 0 14px; align-self: stretch; font-size: 20px; line-height: 1; color: var(--ink-soft); }
.btn.ghost.g-del:hover { color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--brand); background: var(--brand-tint);
  border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent);
  transition: background .2s, transform .12s;
}
.chip:hover { transform: translateY(-1px); background: color-mix(in oklab, var(--brand) 20%, var(--brand-tint)); }
.chip.neutral { color: var(--ink-soft); background: var(--paper); border-color: var(--line); }

/* ---- KPI bar ---------------------------------------------------------- */
.kpi { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 34px; }
.kpi .box { flex: 1; min-width: 150px; max-width: 240px; text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in oklab, var(--brand) 7%, transparent), transparent 70%),
    var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, transform .2s ease; }
.kpi .box:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand) 22%, var(--line)); }
.kpi .box b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600;
  color: var(--ink); letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
[dir="rtl"] .kpi .box b { font-weight: 700; }
.kpi .box span { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .08em; }
[dir="rtl"] .kpi .box span { text-transform: none; letter-spacing: 0; }

/* ---- Section heads & misc -------------------------------------------- */
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
[dir="rtl"] .section-title { font-weight: 700; }
.muted { color: var(--ink-soft); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), color-mix(in oklab, var(--brand) 20%, transparent)); }
[dir="rtl"] .eyebrow { letter-spacing: .04em; text-transform: none; }
[dir="rtl"] .eyebrow::before { background: linear-gradient(270deg, var(--brand), color-mix(in oklab, var(--brand) 20%, transparent)); }
/* eyebrows that head a card section (stats) keep their block flow */
.card > .eyebrow, .stat-card h3.eyebrow { display: flex; }

/* Section header: a centered kicker + title that gives each page section a
   clear, scannable heading. */
.section-head { text-align: center; max-width: 42ch; margin-inline: auto; margin-bottom: clamp(18px, 3.5vw, 30px); }
.section-head .eyebrow { margin-bottom: 8px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(23px, 3vw, 31px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
[dir="rtl"] .section-head h2 { font-weight: 800; letter-spacing: 0; }

/* ---- How-it-works strip ----------------------------------------------- */
.how-strip { margin-top: 56px; }
.how-strip { text-align: center; }
.how-strip > .eyebrow { text-align: center; }
.how-strip > .how-grid { text-align: start; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 16px; }
/* keep a lone trailing card centred so the 3-column grid stays tidy */
.how-grid > .how-cell:last-child:nth-child(3n + 1) { grid-column: 2; }
.how-cell { position: relative; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 22px; text-align: start; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
/* a quiet brand keyline on the start edge gives the grid rhythm and direction */
.how-cell::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: linear-gradient(var(--brand), var(--brand-2)); opacity: 0; transition: opacity .2s ease; }
.how-cell:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--brand) 26%, var(--line)); box-shadow: var(--shadow-md); }
.how-cell:hover::before { opacity: .9; }
.how-cell .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px;
  color: var(--brand); background: var(--brand-tint); border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent);
  transition: transform .2s ease; }
.how-cell:hover .ic { transform: scale(1.06) rotate(-3deg); }
.how-cell .ic svg { width: 23px; height: 23px; }
.how-cell h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
[dir="rtl"] .how-cell h3 { font-weight: 700; }
.how-cell p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.how-cell .step-no { float: inline-end; font-family: var(--font-display); font-size: 14px; color: var(--ink-faint); font-weight: 600; }

/* ---- Success / result ------------------------------------------------- */
#create-result:not(:empty) { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
#create-result.standalone { margin-top: 0; padding-top: 0; border-top: 0; }
.success { text-align: start; }
.success .ok-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(160deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow-md);
  animation: pop .5s cubic-bezier(.2,.8,.2,1.2) both; }
.success h2 { font-family: var(--font-display); font-weight: 600; text-align: center; font-size: 24px; margin: 0 0 18px; color: var(--ink); }
.result-links { list-style: none; padding: 0; margin: 0 0 8px; }
.result-links li { padding: 14px 0; border-bottom: 1px dashed var(--line-strong); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-links li:last-child { border-bottom: 0; }
.result-links .lbl { font-weight: 600; color: var(--ink-soft); margin-inline-end: auto; }
#qrcode { margin: 14px auto 0; width: max-content; padding: 14px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
#qrcode img, #qrcode canvas { width: 220px; height: 220px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.result-actions .chip svg { width: 15px; height: 15px; }

/* ---- Owner panel ------------------------------------------------------ */
.owner-panel { margin-top: 18px; }
.owner-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-badge.on { color: var(--brand); background: var(--brand-tint); border: 1px solid color-mix(in oklab, var(--brand) 20%, transparent); }
.status-badge.on .dot { background: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 22%, transparent); }
.status-badge.off { color: var(--danger); background: color-mix(in oklab, #c1121f 8%, var(--paper-2)); border: 1px solid color-mix(in oklab, #c1121f 22%, transparent); }
.status-badge.off .dot { background: #c1121f; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: var(--r);
  background: var(--paper); border: 1px solid var(--line); }
.owner-tab { flex: 1; padding: 9px 12px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.owner-tab:hover { color: var(--ink); }
.owner-tab.active { background: var(--paper-2); color: var(--brand); box-shadow: var(--shadow-sm); }
.owner-pane[hidden] { display: none; }
.owner-state-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.owner-top { display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  margin-bottom: 0; }
.owner-top-main { flex: 1; min-width: 240px; }
.owner-qr { text-align: center; }
.owner-qr #qrcode { margin: 0 auto; }
.owner-qr #qrcode img, .owner-qr #qrcode canvas { width: 140px; height: 140px; }
.owner-forms { display: grid; grid-template-columns: 1fr; gap: 18px; }
.owner-forms form { padding-top: 16px; border-top: 1px solid var(--line); }
.owner-forms form:first-child { padding-top: 0; border-top: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { font-size: 14px; }
@media (max-width: 560px) { .owner-top { justify-content: center; } .owner-forms { grid-template-columns: 1fr; } }

/* ---- My links list ---------------------------------------------------- */
.links-list { display: grid; gap: 14px; }
.link-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.link-card .link-card-main { display: flex; align-items: center; gap: 12px; margin-inline-end: auto; }
.link-card .num { font-weight: 700; color: var(--brand); text-decoration: none; font-size: 18px; }
.link-card .link-card-meta { color: var(--ink-soft); font-size: 14px; }
.link-card .link-card-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.link-card .link-card-actions { display: flex; gap: 8px; }
.badge-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.badge-status.on { color: var(--brand); background: var(--brand-tint); }
.badge-status.off { color: var(--danger); background: color-mix(in oklab, #c1121f 8%, var(--paper-2)); }

/* ---- Error / messages ------------------------------------------------- */
.error {
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--danger-soft);
  background: color-mix(in oklab, #c1121f 7%, var(--paper-2));
  border: 1px solid color-mix(in oklab, #c1121f 28%, transparent);
  border-radius: var(--r); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  animation: rise .35s cubic-bezier(.2,.7,.2,1) both;
}
.error .alert-ic { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  color: #dc2626; }
@media (prefers-color-scheme: dark) { .error .alert-ic { color: #ff7a6b; } }
[data-theme="dark"] .error .alert-ic { color: #ff7a6b; }
.error ul { margin: 0; padding: 0; list-style: none; }
.error li { margin: 1px 0; font-weight: 500; line-height: 1.5; }

/* ---- Extra KPIs + country visual -------------------------------------- */
.meta-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 18px; }
.meta-stats > div { display: flex; flex-direction: column; align-items: center; }
.meta-stats span { font-size: 12px; color: var(--ink-faint); }
.meta-stats b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.cmap { display: grid; gap: 12px; }
.cmap-row { display: flex; align-items: center; gap: 12px; }
.cmap .icon { float: none !important; margin: 0 !important; flex: 0 0 auto; border-radius: 3px; }
.cmap-name { flex: 0 0 130px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmap-bar { flex: 1; height: 10px; background: var(--brand-tint); border-radius: 999px; overflow: hidden; }
.cmap-bar > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand)); animation: grow .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
[dir="rtl"] .cmap-bar > span { transform-origin: right; }
.cmap-val { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 50px; text-align: end; }
@media (max-width: 480px) { .cmap-name { flex-basis: 90px; } }

/* ---- Stats ------------------------------------------------------------ */
.stats-head { text-align: center; margin-bottom: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 22px; margin-top: 22px; }
.stat-card { background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-md); }
.stat-card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
[dir="rtl"] .stat-card h3 { letter-spacing: 0; text-transform: none; font-size: 15px; }
.stat-card ul { list-style: none; margin: 0; padding: 0; }
.stat-card li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.stat-card li:last-child { border-bottom: 0; }
.stat-card li span { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card li b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---- Daily chart ------------------------------------------------------ */
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); }
.seg a { display: inline-grid; place-items: center; height: 28px; padding: 0 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; transition: color .2s, background .2s; }
.seg a.on { color: #fff; background: var(--brand); box-shadow: var(--shadow-sm); }
.seg a:not(.on):hover { color: var(--ink); }
.chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 14px;
  border-bottom: 1px solid var(--line); }
/* faint horizontal guide lines behind the bars for a calmer, charted feel */
.chart::before { content: ""; position: absolute; inset-inline: 0; bottom: 0; top: 14px; pointer-events: none;
  background-image: repeating-linear-gradient(to top, transparent, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%);
  opacity: .5; }
.chart .bar { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar .fill {
  width: 100%; max-width: 26px; border-radius: 7px 7px 3px 3px; min-height: 3px;
  background: linear-gradient(180deg, var(--brand), color-mix(in oklab, var(--brand) 55%, var(--paper)));
  transition: filter .15s; transform-origin: bottom; animation: grow .8s cubic-bezier(.2,.8,.2,1) both;
}
.chart .bar:hover .fill { filter: saturate(120%) brightness(1.05); }
.chart .bar .lbl { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.chart .bar .val { font-size: 11px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; }
.chart .bar:hover .val { opacity: 1; }
.chart .bar.peak .fill { background: linear-gradient(180deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand) 30%, transparent); }
.chart .bar.peak .lbl { color: var(--brand); font-weight: 700; }

/* ---- Empty state ------------------------------------------------------ */
.empty-state { text-align: center; padding: 40px 24px; }
.empty-state .lede { text-align: center; }
.empty-ic { display: inline-grid; place-items: center; width: 68px; height: 68px;
  border-radius: 20px; margin-bottom: 8px; color: var(--brand);
  background: var(--brand-tint); border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent); }
.empty-ic svg { width: 32px; height: 32px; }

/* ---- Prose (policy / long text) --------------------------------------- */
.prose { color: var(--ink); }
.prose > p:first-child { margin-top: 0; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px;
  letter-spacing: -.01em; margin: 26px 0 8px; color: var(--ink); }
[dir="rtl"] .prose h2 { font-weight: 700; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); margin: 8px 0; }
.prose ul { margin: 8px 0; padding-inline-start: 22px; }
.prose li { color: var(--ink-soft); margin: 5px 0; }
.prose li b, .prose p b { color: var(--ink); font-weight: 600; }
.prose a { color: var(--brand); text-decoration: none; font-weight: 600; }
.prose a:hover { text-decoration: underline; }
.prose .updated { font-size: 13px; color: var(--ink-faint); margin-bottom: 4px; }

/* ---- Guide steps + FAQ (how page) ------------------------------------- */
.guide { display: grid; gap: 14px; }
.guide-step { display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, transform .2s ease; }
.guide-step:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand) 24%, var(--line)); }
.guide-step .gnum { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 19px;
  color: #fff; background: linear-gradient(160deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.22); }
.guide-step .gbody { min-width: 0; }
.guide-step h3 { margin: 0 0 5px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
[dir="rtl"] .guide-step h3 { font-weight: 700; }
.guide-step p { margin: 0; color: var(--ink-soft); }
.guide-step .hint { margin-top: 8px; font-size: 13px; color: var(--ink-faint);
  display: inline-flex; align-items: center; gap: 6px; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .2s ease; }
.faq details:hover { border-color: color-mix(in oklab, var(--brand) 24%, var(--line)); }
.faq details[open] { border-color: color-mix(in oklab, var(--brand) 32%, var(--line)); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; user-select: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 22px; line-height: 1; }
.faq details[open] summary { color: var(--brand); }
.faq details[open] summary::after { content: "\2212"; }
.faq .ans { padding: 0 18px 16px; color: var(--ink-soft); }

/* ---- Steps (how page legacy list) ------------------------------------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 56px; min-height: 36px; display: flex; align-items: center; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 38px; height: 38px;
  border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 17px;
  color: var(--brand); background: var(--brand-tint); border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent); }

/* ---- Footer ----------------------------------------------------------- */
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0; }
footer.site .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; justify-content: center; }
footer.site a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
footer.site a:hover { color: var(--brand); }
footer.site .copy { width: 100%; text-align: center; color: var(--ink-faint); font-size: 13px; margin-top: 8px; }

/* ---- Admin ------------------------------------------------------------ */
.admin-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.admin-topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* stats strip */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.astat { background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.astat b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.astat span { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-faint); }
.astat.ok b { color: var(--brand); }
.astat.danger b { color: var(--danger); }

/* toolbar */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.admin-toolbar .tb-search { flex: 1; min-width: 200px; }
.admin-toolbar select { padding: 12px 38px 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font-family: inherit; font-size: 15px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6b62' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; }
[dir="rtl"] .admin-toolbar select { background-position: left 12px center; padding: 12px 14px 12px 38px; }
.admin-toolbar .tb-search { font-size: 15px; padding: 12px 16px; }
.admin-toolbar .btn { padding: 12px 20px; }

/* link containers (admin) */
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lc-num { font-weight: 700; font-size: 18px; color: var(--brand); text-decoration: none; }
.lc-num:hover { text-decoration: underline; }
.lc-meta { list-style: none; margin: 0 0 14px; padding: 0; }
.lc-meta li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lc-meta li:last-child { border-bottom: 0; }
.lc-meta li span { color: var(--ink-faint); }
.lc-meta li b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-meta li b a { color: var(--brand); text-decoration: none; }
.lc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-count { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.admin-count b { color: var(--ink); font-variant-numeric: tabular-nums; }

.danger-chip { color: #fff !important; background: var(--danger) !important; border-color: transparent !important; }

/* pager */
.admin-pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 20px; }
.admin-pager .disabled { opacity: .45; pointer-events: none; }
.pager-info { color: var(--ink-soft); font-size: 14px; }
.pager-info b { color: var(--ink); }
.pager-jump { display: inline-flex; gap: 6px; align-items: center; }
.pager-jump input { width: 70px; padding: 8px 10px; font-size: 14px; }
.admin-card.deleted { background: color-mix(in oklab, #c1121f 6%, var(--paper-2)); border-color: color-mix(in oklab,#c1121f 22%, transparent); }
.tag-deleted { color: var(--danger); font-weight: 700; font-size: 13px; }
.inline-form { display: inline; }

/* ---- Toast + confirm modal -------------------------------------------- */
.iw-toast { position: fixed; inset-inline: 0; bottom: 26px; margin-inline: auto; width: max-content; max-width: 90vw;
  background: var(--ink); color: var(--paper-2); padding: 12px 22px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 1000; pointer-events: none;
  opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .25s; }
.iw-toast.show { opacity: 1; transform: translateY(0); }

.iw-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 14, 11, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s; }
.iw-modal.show { opacity: 1; }
.iw-modal-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 26px; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg); text-align: center;
  transform: scale(.92); transition: transform .2s; }
.iw-modal.show .iw-modal-box { transform: scale(1); }
.iw-modal-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px;
  color: var(--danger); background: color-mix(in oklab, #c1121f 10%, var(--paper-2)); }
.iw-modal-ic svg { width: 28px; height: 28px; }
.iw-modal-msg { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 22px; line-height: 1.6; }
.iw-modal-actions { display: flex; gap: 10px; justify-content: center; }
.iw-modal-actions .btn { flex: 1; }
.btn.iw-danger { background: linear-gradient(160deg, #dc2626, #b3261e); }

/* ---- Motion ----------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* one orchestrated entrance: a soft staggered settle of the page's lead block */
.reveal > * { animation: rise .72s cubic-bezier(.2,.7,.2,1) both; }
.reveal > *:nth-child(1) { animation-delay: .02s; }
.reveal > *:nth-child(2) { animation-delay: .09s; }
.reveal > *:nth-child(3) { animation-delay: .16s; }
.reveal > *:nth-child(4) { animation-delay: .23s; }
.reveal > *:nth-child(5) { animation-delay: .30s; }
.reveal > *:nth-child(6) { animation-delay: .37s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 720px) {
  .how-grid { grid-template-columns: 1fr; }
  .how-grid > .how-cell:last-child:nth-child(3n + 1) { grid-column: auto; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  header.site .bar { height: 60px; }
  .brand .word { font-size: 18px; }
  .kpi .box { min-width: 120px; }
  #qrcode img, #qrcode canvas { width: 180px; height: 180px; }
  .chart { height: 140px; gap: 3px; }
  .chart .bar .lbl { font-size: 9px; }
}
