/* Genesis WhatsApp dashboard. Self-hosted assets only; no CDN. */

@font-face {
  font-family: "Cairo";
  src: url("fonts/cairo-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  src: url("fonts/cairo-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arabic glyphs only, so English pages keep the system Latin font but render Arabic
   customer text in Cairo. */
@font-face {
  font-family: "Cairo Arabic";
  src: url("fonts/cairo-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f4;
  --border: #e3e7ec;
  --border-strong: #d2d8df;
  --text: #15191e;
  --text-2: #3c4552;
  --muted: #687384;
  --accent: #0d7a5f;
  --accent-strong: #0a654e;
  --accent-soft: #e5f3ee;
  --accent-text: #ffffff;
  --bubble-in: #ffffff;
  --bubble-out: #ddf3ea;
  --chat-bg: #eef2f1;
  --ok: #067647;
  --ok-soft: #e3f5ea;
  --warn: #a15c07;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --read: #1f7ae0;
  --focus: #2f80ed;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
  --shadow: 0 1px 3px rgb(16 24 40 / 8%), 0 1px 2px rgb(16 24 40 / 4%);
  --shadow-lg: 0 12px 32px -8px rgb(16 24 40 / 18%), 0 4px 8px -4px rgb(16 24 40 / 6%);
  --radius: 12px;
  --radius-sm: 8px;
  --rail: 236px;
  --list: 352px;
  --font-ar: "Cairo", system-ui, sans-serif;
  --font-en: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Cairo Arabic", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161a20;
    --surface-2: #1b2027;
    --surface-3: #222831;
    --border: #2a313b;
    --border-strong: #38414d;
    --text: #e8ecf1;
    --text-2: #c3cad4;
    --muted: #8b95a5;
    --accent: #2bb38a;
    --accent-strong: #3cc59b;
    --accent-soft: #15322a;
    --accent-text: #06120e;
    --bubble-in: #1e242c;
    --bubble-out: #133a2e;
    --chat-bg: #11161b;
    --ok: #47c98a;
    --ok-soft: #12301f;
    --warn: #f0a94a;
    --warn-soft: #33260f;
    --bad: #f47067;
    --bad-soft: #3a1714;
    --read: #5aa7ff;
    --shadow: 0 1px 3px rgb(0 0 0 / 40%);
    --shadow-lg: 0 16px 40px -8px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html[lang="ar"] { font-family: var(--font-ar); }
html[lang="en"] { font-family: var(--font-en); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-size: 15.5px; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
bdi.phone { font-variant-numeric: tabular-nums; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.btn.warn:hover { background: var(--warn-soft); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.95); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 38px; padding: 0; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.link:hover { color: var(--text); text-decoration: underline; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.sm { gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
input.code { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
textarea { resize: none; }

/* ---------- chips, badges, dots ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.muted { color: var(--muted); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 16px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }

.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-text);
}
.brand-mark.lg { width: 44px; height: 44px; border-radius: 12px; }
.brand-mark.lg svg { width: 24px; height: 24px; }
.brand-mark.xl { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.brand-mark.xl svg { width: 32px; height: 32px; }

.flash {
  margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash.hide { opacity: 0; transition: opacity .4s; }
.flash-stack {
  position: fixed; z-index: 70; top: max(16px, env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.flash-stack .flash { display: flex; align-items: flex-start; gap: 10px; margin: 0; box-shadow: var(--shadow-lg); pointer-events: auto; }
.flash-stack .flash span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flash-close { flex: none; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 22px; line-height: 1; padding: 0; width: 28px; height: 28px; }

/* ---------- sign-in pages ---------- */
body.plain { min-height: 100dvh; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 28px 22px;
}
.auth-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.auth-brand { color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.auth-title { font-size: 22px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 20px; }
.auth-card .flash { margin: 0 0 16px; }
.auth-out { margin-top: 18px; text-align: center; }
.steps { padding-inline-start: 20px; margin: 18px 0 0; display: flex; flex-direction: column; gap: 18px; }
.steps li::marker { font-weight: 700; color: var(--accent); }
.steps p { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; align-items: center; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.secret {
  display: inline-block; padding: 6px 10px; border-radius: 6px; background: var(--surface-3);
  font-size: 14px; letter-spacing: .04em; cursor: copy; user-select: all;
}
.secret.copied { background: var(--ok-soft); color: var(--ok); }
details.minor { margin-top: 10px; }
details.minor summary { cursor: pointer; color: var(--muted); font-size: 13px; }
textarea.uri { margin-top: 8px; font-family: ui-monospace, monospace; font-size: 12px; }

/* ---------- app shell ---------- */
body.shell { height: 100dvh; overflow: hidden; }
.app { display: grid; grid-template-columns: var(--rail) 1fr; height: 100dvh; }
.rail {
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  background: var(--surface); border-inline-end: 1px solid var(--border); padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 14.5px;
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.rail-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--muted); font-size: 12.5px; }
.rail-actions { display: flex; justify-content: space-between; gap: 6px; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- inbox ---------- */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--list) 1fr; }
.convs { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-end: 1px solid var(--border); }
.convs-head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.pane-title { font-size: 19px; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-inline-start: 36px; background: var(--surface-2); border-color: var(--border); min-height: 38px; }
.conv-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.conv {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; color: inherit;
}
.conv:hover { background: var(--surface-2); text-decoration: none; }
.conv.active { background: var(--accent-soft); }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-top, .conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.conv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { color: var(--muted); font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.conv-preview { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-name { font-weight: 800; }
.conv.unread .conv-preview { color: var(--text-2); font-weight: 600; }
.conv.unread .conv-time { color: var(--accent); font-weight: 700; }
.empty-list { padding: 32px 16px; text-align: center; color: var(--muted); }
.more { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: 13.5px; }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.thread-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.thread-who { flex: 1; min-width: 0; }
.thread-name { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.back-link { display: none; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20;
  width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px; display: flex; flex-direction: column; gap: 14px;
}
.menu-panel h3 { font-size: 14px; color: var(--muted); }
.menu.end .menu-panel { width: 230px; gap: 6px; padding: 8px; }
.danger-zone { border-top: 1px solid var(--border); padding-top: 14px; }
.danger-zone p { color: var(--bad); }

.msgs { flex: 1; overflow-y: auto; padding: 18px clamp(12px, 4vw, 48px); display: flex; flex-direction: column; gap: 6px; }
.msgs .older { align-self: center; background: var(--surface); border-radius: 999px; padding: 4px 14px; box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.msg { display: flex; }
.msg.out { justify-content: flex-end; }
.bubble {
  max-width: min(72%, 560px); background: var(--bubble-in); border-radius: 14px; padding: 7px 11px 5px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; min-width: 88px;
}
.msg.in .bubble { border-start-start-radius: 4px; }
.msg.out .bubble { background: var(--bubble-out); border-start-end-radius: 4px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.meta .by { font-weight: 600; }
.st { display: inline-block; width: 18px; height: 12px; background: currentColor; flex: none;
  -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
.st-queued, .st-sending { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Ccircle cx='12' cy='8' r='6' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 5v3.5l2 1.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.st-accepted, .st-sent { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M5 8.5l3.5 3.5L16 4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.st-delivered, .st-read, .st-played { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M1.5 8.5L5 12l7.5-8M9 11l1 1 7.5-8' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.st-read, .st-played { color: var(--read); }
.st-failed, .st-dead, .st-blocked, .st-unknown { color: var(--bad); --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Ccircle cx='12' cy='8' r='6.5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 4.5v4M12 11v.5' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.st-note { font-size: 12px; color: var(--bad); font-weight: 600; }
.media-img img { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; object-fit: cover; }
.bubble audio { width: min(300px, 62vw); height: 40px; }
.bubble video { max-width: 100%; max-height: 340px; border-radius: 10px; }
.file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); font-weight: 600; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-note { font-size: 13px; color: var(--muted); font-style: italic; }
.media-note.bad { color: var(--bad); }

.composer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: end;
  padding: 12px 16px 10px; background: var(--surface); border-top: 1px solid var(--border);
}
.composer textarea { min-height: 44px; max-height: 180px; background: var(--surface-2); border-color: var(--border); line-height: 1.5; padding: 10px 14px; border-radius: 12px; }
.composer .btn { min-height: 44px; border-radius: 12px; }
.composer-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 0 4px; }
.composer [hidden] { display: none; }
.attach-btn { position: relative; cursor: pointer; }
.attach-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.attach-chip, .attach-error { grid-column: 1 / -1; }
.attach-chip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 14px; min-width: 0; }
.attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .attach-chip .btn { min-height: 32px; width: 32px; }
.attach-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 13px; }
.composer.blocked { display: block; color: var(--warn); background: var(--warn-soft); font-weight: 600; font-size: 14px; border-top-color: color-mix(in srgb, var(--warn) 25%, transparent); }

.thread-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.thread-empty h2 { font-size: 18px; margin-top: 6px; }

/* ---------- pages ---------- */
.page { flex: 1; overflow-y: auto; padding: 24px clamp(16px, 3vw, 36px) 40px; }
.page.narrow { max-width: 520px; }
.page.center { text-align: center; margin: 0 auto; }
.page-head { margin-bottom: 18px; }
.page-title { font-size: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 16px; }
.card-title { font-size: 16px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.callout { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; margin: -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .6; }
.table .actions { text-align: end; width: 1%; }
.table .nowrap { white-space: nowrap; }
.table .details code { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.cell-user { display: flex; align-items: center; gap: 10px; line-height: 1.35; }
.pad { padding: 8px; }
.status-line { display: flex; align-items: center; gap: 4px; font-weight: 600; margin-bottom: 14px; flex-wrap: wrap; }
.status-line.ok { color: var(--ok); }
.status-line.bad { color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.stat-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-k { color: var(--muted); font-size: 13px; }
.stat.bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.stat.bad .stat-v { color: var(--bad); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --rail: 76px; --list: 300px; }
  .brand-text, .nav a span, .me-text { display: none; }
  .brand, .nav a, .me { justify-content: center; }
  .rail-actions { flex-direction: column; align-items: center; }
  .grid-2 { grid-template-columns: 1fr; }
}
/* Mobile bits that exist on every width but only show on phones. */
.tabbar { display: none; }
.sheet-me, .sheet-links, .sheet-actions { display: none; }

/* ---------- templates and campaigns ---------- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card.narrow { max-width: 640px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.check input { width: auto; margin-top: 3px; }
.num { width: 9em; }
.tpl-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.tpl-text.strong { font-weight: 700; }
.tpl-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.tpl-pick { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.tpl-pick .field, .tpl-pick select { flex: 1; }
.tpl-box { padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border); max-height: 55vh; overflow-y: auto; }
.tpl-box > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); padding: 4px 0; }
.tpl-box[open] > summary { margin-bottom: 10px; }
.tpl-tag { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
/* template header file: one box, one action */
.hdr-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 12px;
  max-width: 340px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.hdr-box.missing { border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.hdr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.hdr-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--text); }
.hdr-title svg { color: var(--muted); }
.hdr-box.missing .hdr-title svg { color: var(--warn); }
.hdr-note { margin: 0; font-size: 13px; color: var(--text-2); }
.hdr-thumb { display: block; width: 100%; }
.hdr-thumb img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.hdr-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.hdr-pick { position: relative; cursor: pointer; }
.hdr-pick:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.hdr-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.hdr-pick.busy { opacity: .7; pointer-events: none; }
.hdr-help { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.tpl-media { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; margin-bottom: 6px; }
.callout.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.js [data-noscript] { display: none; }
.grid-2.tight { gap: 12px; }
.tpl-new { display: flex; flex-direction: column; gap: 16px; }
.btn.danger-text { color: var(--bad); }
.js [data-show-for].off { display: none; }
.btn-rows { display: flex; flex-direction: column; gap: 10px; }
.btn-rows:empty { display: none; }
/* Row like Meta's editor: type, text and remove on the first line; the link, or the
   country and number, on the second. */
.btn-row { display: grid; grid-template-columns: minmax(130px, 170px) minmax(0, 1fr) auto;
  grid-template-areas: "type text rm" "cc value value"; gap: 10px; align-items: end; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.btn-row .f-type { grid-area: type; }
.btn-row .f-text { grid-area: text; }
.btn-row .f-cc { grid-area: cc; }
.btn-row .f-value { grid-area: value; }
.btn-row[data-kind="url"] .f-value { grid-column: 1 / -1; }
.btn-row[data-kind="quick"] { grid-template-areas: "type text rm"; }
.btn-row [data-for].off { display: none; }
.btn-remove { grid-area: rm; font-size: 22px; line-height: 1; }
.tpl-new .card.narrow { max-width: 760px; }
@media (max-width: 560px) {
  .btn-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "type rm" "text text" "cc cc" "value value"; }
  .btn-row[data-kind="quick"] { grid-template-areas: "type rm" "text text"; }
  .btn-row[data-kind="url"] .f-value { grid-column: 1 / -1; }
}
.counted { position: relative; display: block; }
.counted input { padding-inline-end: 52px; width: 100%; }
.counted .count { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.add-btn { align-self: flex-start; }
.pay-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px clamp(12px, 3vw, 36px) 0; padding: 12px 16px; border-radius: var(--radius);
  background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--text); }
.pay-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.pay-text strong { color: var(--bad); }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tpl-tools .search { max-width: 420px; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tpl-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.tpl-item.dim .tpl-id, .tpl-item.dim .tpl-preview { opacity: .75; }
.tpl-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tpl-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.tpl-name { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.tpl-meta { font-size: 12.5px; color: var(--muted); }
.tpl-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-actions { display: flex; gap: 6px; margin-inline-start: auto; }
.tpl-snippet { margin: 8px 0 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tpl-warn { margin: 6px 0 0; font-size: 13px; color: var(--warn); font-weight: 600; }
.tpl-more { margin-top: 6px; }
.tpl-more > summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; width: max-content; }
.tpl-full { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.tpl-delete { align-self: flex-end; }
.tpl-empty { padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.add-btn > summary { list-style: none; }
/* The button sits at the start of the card, so its menu opens toward the inside. */
@media (min-width: 761px) { /* on phones it stays a bottom sheet */
  .add-btn .menu-panel { inset-inline-start: 0; inset-inline-end: auto; width: 220px; gap: 4px; padding: 6px; }
  .add-btn .menu-panel .btn { justify-content: flex-start; }
}
.add-btn > summary::-webkit-details-marker { display: none; }
.conv-number { display: block; font-size: 11.5px; color: var(--accent); margin-top: 1px; }
.num-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.num-filter .chip { text-decoration: none; }

/* ---------- phones (dedicated layout) ----------
   Bottom tab bar instead of the side rail, tables become cards, menus become bottom
   sheets, and every control is at least 44px tall. */
@media (max-width: 760px) {
  :root { --tabbar: 60px; }
  html { scroll-padding-bottom: 80px; }
  body { font-size: 15px; }
  html[lang="ar"] body { font-size: 15.5px; }

  /* controls: 44px targets, 16px text so iOS does not zoom into inputs */
  input, select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; padding: 0 14px; }
  .btn.icon { width: 44px; }
  .search input { min-height: 44px; }

  /* shell: content on top, tab bar below; each pane scrolls on its own */
  body.shell { height: 100dvh; overflow: hidden; }
  .app { display: flex; flex-direction: column; height: 100dvh; }
  .rail { display: none; }
  .main { flex: 1; }
  .flash { margin: 10px 14px 0; }

  .tabbar {
    display: flex; flex: none; align-items: stretch;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar > details { flex: 1; min-width: 0; display: flex; }
  .tab {
    position: relative; flex: 1; min-width: 0; min-height: var(--tabbar);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
  }
  .tab:hover { text-decoration: none; }
  .tab svg { width: 23px; height: 23px; }
  .tab span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.active { color: var(--accent); }
  .tab.active::after {
    content: ""; position: absolute; top: 0; inset-inline: 22%; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--accent);
  }
  .tab-more[open] > .tab { color: var(--accent); }
  /* a conversation owns the whole screen: hide the bar so the composer sits at the bottom */
  body:has(.inbox.has-thread) .tabbar { display: none; }

  /* menus and the More list open as bottom sheets */
  .menu-panel, .menu.end .menu-panel {
    position: fixed; inset-inline: 0; top: auto; bottom: 0; z-index: 60;
    width: auto; max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
    border-width: 1px 0 0; border-radius: 20px 20px 0 0; gap: 12px;
    padding: 12px 16px max(18px, env(safe-area-inset-bottom));
    box-shadow: 0 -16px 40px -8px rgb(0 0 0 / 30%);
  }
  .menu-panel::before {
    content: ""; align-self: center; flex: none; width: 38px; height: 4px; margin-bottom: 4px;
    border-radius: 2px; background: var(--border-strong);
  }
  .menu[open] > summary::before {
    content: ""; position: fixed; inset: 0; z-index: 55; background: rgb(8 12 16 / 50%); cursor: default;
  }
  .menu-panel .btn.sm { width: 100%; min-height: 46px; justify-content: center; }
  .sheet-me, .sheet-links, .sheet-actions { display: flex; }
  .sheet-me { align-items: center; gap: 12px; padding: 2px 4px 10px; border-bottom: 1px solid var(--border); }
  .sheet-me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
  .sheet-me-text .me-name { font-weight: 700; }
  .sheet-links { flex-direction: column; gap: 2px; }
  .sheet-links a {
    display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px;
    border-radius: var(--radius-sm); color: var(--text); font-weight: 600;
  }
  .sheet-links a:hover { text-decoration: none; background: var(--surface-3); }
  .sheet-links a.active { background: var(--accent-soft); color: var(--accent); }
  .sheet-actions { gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .sheet-actions form { flex: 1; }

  /* inbox: one pane at a time */
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-thread .convs { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .convs-head { padding: 14px 14px 10px; gap: 10px; }
  .convs-head .btn { min-height: 40px; }
  .conv-list { padding: 4px 6px 12px; }
  .conv { padding: 12px 10px; min-height: 68px; }
  .conv-name { font-size: 16px; }
  .conv-preview { font-size: 14px; }
  .back-link { display: inline-flex; margin-inline-start: -6px; }

  .thread-head { gap: 10px; padding: 8px; padding-inline: 8px 12px; }
  .thread-head .avatar { width: 38px; height: 38px; }
  .thread-name { font-size: 16px; }
  .thread-sub { gap: 4px 8px; font-size: 12.5px; }
  .thread-sub .chip { flex: none; max-width: 100%; white-space: normal; }
  .msgs { padding: 14px 10px; }
  .bubble { max-width: 88%; }
  .media-img img, .bubble video { max-height: 260px; }

  .tpl-box { padding: 4px 14px; max-height: 52dvh; }
  .tpl-box > summary { min-height: 44px; display: flex; align-items: center; }
  .tpl-box[open] { padding-bottom: 14px; }
  .tpl-pick { flex-direction: column; align-items: stretch; }
  .composer { padding: 8px 10px max(8px, env(safe-area-inset-bottom)); gap: 4px 8px; }
  .composer textarea { min-height: 46px; font-size: 16px; }
  .composer .btn { width: 46px; padding: 0; min-height: 46px; border-radius: 50%; }
  .composer .btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .composer-foot { font-size: 11px; padding: 0 6px; }
  .composer-foot > span:first-child { display: none; }
  .composer-foot { justify-content: flex-end; }
  .composer.blocked { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

  /* pages */
  .page { padding: 16px 14px 28px; }
  .page-title { font-size: 20px; }
  .page-head { margin-bottom: 14px; }
  .page-head.head-row > div { flex: 1 1 100%; }
  .page-head.head-row > form, .page-head.head-row > .row-actions, .page-head.head-row > .btn { flex: 1 1 100%; }
  .page-head.head-row .btn { width: 100%; }
  .row-actions > form { flex: 1; }
  .row-actions .btn { width: 100%; }
  .page-head .row-actions { flex-wrap: nowrap; }
  .card { padding: 16px; }
  .card-form { padding: 16px; }
  .grid-2 { gap: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .num { width: 100%; }
  .secret { white-space: normal; overflow-wrap: anywhere; }
  .callout { padding: 12px 14px; }
  .check input { width: 22px; height: 22px; margin-top: 1px; }

  /* sign-in */
  .auth { place-items: start center; padding: max(24px, 6dvh) 14px 24px; }
  .auth-card { padding: 22px 18px 18px; border-radius: 16px; }

  /* tables that carry actions turn into cards */
  .card.flush { background: none; border: 0; box-shadow: none; padding: 0; }
  .card.flush .table-wrap { margin: 0; overflow: visible; }
  .table.cards, .table.cards tbody { display: block; }
  .table.cards thead { display: none; }
  .table.cards tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; position: relative;
    margin-bottom: 10px; padding: 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  }
  .table.cards tr:last-child td, .table.cards td { padding: 0; border: 0; }
  .table.cards td { display: block; min-width: 0; }
  .table.cards td[data-label]::before {
    content: attr(data-label); margin-inline-end: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600;
  }
  .table.cards td.c-main, .table.cards td.c-wide, .table.cards td.c-name, .table.cards td.c-user { flex: 1 1 100%; }
  .table.cards td.c-main { font-weight: 700; font-size: 15.5px; }
  .table.cards tr.dim { opacity: .7; }
  .table.cards tr.dim td { opacity: 1; }
  .table.cards tr.empty { display: block; }
  .table.cards .details code { display: block; }

  /* templates: [name .... status] / body / meta / action */
  .hdr-pick { flex: 1 1 auto; justify-content: center; min-height: 44px; }

  /* users */
  .users-cards td.actions { position: absolute; inset-block-start: 8px; inset-inline-end: 6px; width: auto; }
  .users-cards td.c-user { padding-inline-end: 44px; }
  .users-cards tbody tr:has(.menu) td.c-user { min-height: 44px; display: flex; align-items: center; }
  .users-cards td[data-label] { flex: 0 0 auto; }
}
@media (max-width: 380px) {
  .tab { font-size: 10.5px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page { padding-inline: 12px; }
}


/* ---------- settings ---------- */
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ov-tile { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ov-tile::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--border-strong); }
.ov-tile.ok::before { background: var(--ok); }
.ov-tile.warn::before { background: var(--warn); }
.ov-tile.bad::before { background: var(--bad); }
.ov-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); }
.ov-tile.ok .ov-icon { background: var(--ok-soft); color: var(--ok); }
.ov-tile.warn .ov-icon { background: var(--warn-soft); color: var(--warn); }
.ov-tile.bad .ov-icon { background: var(--bad-soft); color: var(--bad); }
.ov-k { font-size: 12.5px; color: var(--muted); }
.ov-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-tile.bad .ov-v { color: var(--bad); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-card { display: flex; flex-direction: column; gap: 14px; }
.set-head { display: flex; align-items: flex-start; gap: 12px; }
.set-head > div { flex: 1; min-width: 0; }
.set-head .card-title { margin-bottom: 2px; }
.set-head p { margin: 0; }
.set-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.set-head-action { flex: none; }
.state-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); }
.state-row.bad { background: var(--bad-soft); }
.state-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.state-row.ok strong { color: var(--ok); }
.state-row.bad strong { color: var(--bad); }
.pulse { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.pulse.bad { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
.cap-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.cap-form .num { width: 10em; font-variant-numeric: tabular-nums; }
.hint { margin: 0; font-size: 13px; font-weight: 600; }
.hint.warn { color: var(--warn); }
.num-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.num-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.num-top { display: flex; align-items: center; gap: 10px; }
.num-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.num-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.num-facts dt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.num-facts dd { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.qdot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.q-GREEN { background: var(--ok); }
.q-YELLOW { background: var(--warn); }
.q-RED { background: var(--bad); }
.meter-wrap { display: flex; flex-direction: column; gap: 6px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--accent); }
.id-line { font-size: 11.5px; }
.bill-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bill-totals > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.bill-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bill-v.free { color: var(--ok); }
.bill-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bill-bars li { display: grid; grid-template-columns: minmax(80px, 120px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bill-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.empty-note > div { display: flex; flex-direction: column; min-width: 0; }
.empty-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.empty-icon.ok { background: var(--ok-soft); color: var(--ok); }
.link-out { font-size: 13px; font-weight: 600; align-self: flex-start; }
.conn-list { margin: 0; display: flex; flex-direction: column; }
.conn-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.conn-list > div:last-child { border-bottom: 0; }
.conn-list dt { color: var(--muted); font-size: 13.5px; }
.conn-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.copyable { cursor: copy; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); }
.copyable.copied { background: var(--ok-soft); color: var(--ok); }
.settings .stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (max-width: 900px) { .set-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-tile { grid-template-columns: 1fr; padding: 12px; }
  .ov-icon { grid-row: auto; width: 32px; height: 32px; margin-bottom: 6px; }
  .ov-v { font-size: 16px; }
  .set-head { flex-wrap: wrap; }
  .set-head > div { flex-basis: calc(100% - 48px); }
  .set-head-action { flex-basis: 100%; }
  .set-head-action .btn { width: 100%; }
  .num-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.p0{width:0%} .p1{width:1%} .p2{width:2%} .p3{width:3%} .p4{width:4%} .p5{width:5%} .p6{width:6%} .p7{width:7%} .p8{width:8%} .p9{width:9%} .p10{width:10%} .p11{width:11%} .p12{width:12%} .p13{width:13%} .p14{width:14%} .p15{width:15%} .p16{width:16%} .p17{width:17%} .p18{width:18%} .p19{width:19%} .p20{width:20%} .p21{width:21%} .p22{width:22%} .p23{width:23%} .p24{width:24%} .p25{width:25%} .p26{width:26%} .p27{width:27%} .p28{width:28%} .p29{width:29%} .p30{width:30%} .p31{width:31%} .p32{width:32%} .p33{width:33%} .p34{width:34%} .p35{width:35%} .p36{width:36%} .p37{width:37%} .p38{width:38%} .p39{width:39%} .p40{width:40%} .p41{width:41%} .p42{width:42%} .p43{width:43%} .p44{width:44%} .p45{width:45%} .p46{width:46%} .p47{width:47%} .p48{width:48%} .p49{width:49%} .p50{width:50%} .p51{width:51%} .p52{width:52%} .p53{width:53%} .p54{width:54%} .p55{width:55%} .p56{width:56%} .p57{width:57%} .p58{width:58%} .p59{width:59%} .p60{width:60%} .p61{width:61%} .p62{width:62%} .p63{width:63%} .p64{width:64%} .p65{width:65%} .p66{width:66%} .p67{width:67%} .p68{width:68%} .p69{width:69%} .p70{width:70%} .p71{width:71%} .p72{width:72%} .p73{width:73%} .p74{width:74%} .p75{width:75%} .p76{width:76%} .p77{width:77%} .p78{width:78%} .p79{width:79%} .p80{width:80%} .p81{width:81%} .p82{width:82%} .p83{width:83%} .p84{width:84%} .p85{width:85%} .p86{width:86%} .p87{width:87%} .p88{width:88%} .p89{width:89%} .p90{width:90%} .p91{width:91%} .p92{width:92%} .p93{width:93%} .p94{width:94%} .p95{width:95%} .p96{width:96%} .p97{width:97%} .p98{width:98%} .p99{width:99%} .p100{width:100%}

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