/* ---- Theme ----------------------------------------------------------------- */
:root {
  --bg: #0a0f1c; --panel: #111829; --panel-2: #151e33; --line: #212c45; --line-2: #2a3754;
  --text: #e6eaf2; --muted: #8592ad; --faint: #5d6984;
  --accent: #3d7eff; --accent-2: #14b8a6; --accent-soft: rgba(61,126,255,.14);
  --good: #22c55e; --good-soft: rgba(34,197,94,.13);
  --warn: #f59e0b; --warn-soft: rgba(245,158,11,.14);
  --bad: #ef4444; --bad-soft: rgba(239,68,68,.14);
  --info-soft: rgba(61,126,255,.12);
  --radius: 12px;
  color-scheme: dark;
}
body.light {
  --bg: #f4f6f9; --panel: #fff; --panel-2: #f8fafc; --line: #e4e7ec; --line-2: #d6dbe4;
  --text: #1d2330; --muted: #667085; --faint: #98a2b3;
  --accent: #0b6e4f; --accent-soft: #e3f2ec; --good: #0b6e4f; --good-soft: #e3f2ec;
  --warn: #b54708; --warn-soft: #fef0e1; --bad: #b42318; --bad-soft: #fde9e7; --info-soft: #eaf1fd;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 0 0 1rem; }
h2 { font-size: 1rem; margin: 0 0 .2rem; font-weight: 650; }
.sub { color: var(--muted); font-size: .8rem; margin: 0 0 .9rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.up { color: var(--good); }
.down { color: var(--bad); }

/* ---- Top bar and side menu ---------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.menu-btn { background: none; border: 0; color: var(--text); padding: .3rem; cursor: pointer; display: grid; }
.brandmark { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.brandmark:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .66rem; font-style: normal; letter-spacing: .02em;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brandmark .txt b { display: block; font-size: .92rem; line-height: 1.1; }
.brandmark .txt span { display: block; font-size: .72rem; color: var(--muted); }
.topbar .spacer { flex: 1; }

.drawer { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; background: var(--panel);
  border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .2s ease;
  display: flex; flex-direction: column; padding: 1rem .75rem; overflow-y: auto; }
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); display: none; }
.scrim.open { display: block; }
.drawer .brandmark { padding: .25rem .5rem 1rem; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: 0 .25rem .5rem; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .2rem; border-radius: 9px;
  color: var(--muted); font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); }
.quick a:hover { text-decoration: none; color: var(--text); background: var(--panel-2); }
.quick a.on { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.drawer nav a.top-link, .drawer nav summary { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
  border-radius: 9px; color: var(--muted); font-size: .9rem; cursor: pointer; list-style: none; }
.drawer nav summary::-webkit-details-marker { display: none; }
.drawer nav summary span { flex: 1; }
.drawer nav summary .chev { transition: transform .15s ease; flex: none; }
.drawer nav details[open] > summary .chev { transform: rotate(90deg); }
.drawer nav a.top-link svg, .drawer nav summary > svg:first-child { flex: none; }
.drawer nav a.top-link:hover, .drawer nav summary:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.drawer nav a.top-link.on, .drawer nav summary.on { background: var(--accent-soft); color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.drawer .sub { margin: .15rem 0 .4rem 1.35rem; padding-left: .6rem; border-left: 1px solid var(--line); }
.drawer .sub a { display: block; padding: .38rem .6rem; border-radius: 7px; color: var(--muted); font-size: .84rem; }
.drawer .sub a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.drawer .sub a.on { color: var(--text); background: var(--accent-soft); }
.drawer .subhead { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: .55rem .6rem .15rem; }
.drawer .group { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: .8rem .7rem .25rem; font-weight: 600; }
.drawer .who { padding: .8rem .5rem 0; }
.drawer form { margin-top: .6rem; padding: .25rem .5rem 1rem; }
@media (min-width: 1000px) {
  .drawer { transform: none; }
  .scrim, .menu-btn { display: none !important; }
  .shell { margin-left: 260px; }
  .topbar .brandmark { display: none; }
}

main { max-width: 1180px; margin: auto; padding: 1rem; }

/* ---- Cards & grids ------------------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card .head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .6rem; }
.nowrap { white-space: nowrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g2, .g3 { display: grid; gap: .75rem; margin-bottom: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .g3.stats2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.g3 > .card.metric { padding: .8rem; }
.g3 > .card.metric .title { font-size: .78rem; }
.g3 > .card.metric .big { font-size: 1.35rem; }
.g2 > .card.metric .big { font-size: 1.3rem; white-space: nowrap; }
.g2 > .card, .g3 > .card { margin: 0; }
@media (min-width: 760px) { .g2.wide3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .g3.stack { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; color: var(--text); display: block; min-width: 0; }
.stat:hover { text-decoration: none; border-color: var(--line-2); }
.stat .label { font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: clamp(1.02rem, 4.6vw, 1.25rem); font-weight: 700; margin: .25rem 0 .1rem; overflow-wrap: anywhere; line-height: 1.25; }
.stat .note { font-size: .72rem; color: var(--muted); }
.stat .note a { font-size: .72rem; }

.metric { position: relative; }
.metric .title { color: var(--muted); font-size: .88rem; }
.metric .big { font-size: 1.6rem; font-weight: 700; margin: .35rem 0; }
.metric .icon { position: absolute; top: .9rem; right: .9rem; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.metric .icon svg { width: 16px; height: 16px; }
.icon.good { background: var(--good-soft); color: var(--good); }
.icon.warn { background: var(--warn-soft); color: var(--warn); }
.icon.teal { background: rgba(20,184,166,.14); color: var(--accent-2); }

.compare { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .3rem; }
.compare .row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .45rem 0; font-size: .82rem; }
.compare .row + .row { border-top: 1px dashed var(--line); }
.compare .row b { font-weight: 650; }
.compare .delta { font-size: .74rem; white-space: nowrap; }

.hero { border-radius: var(--radius); padding: 1.1rem 1.1rem 1rem; margin-bottom: 1rem; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #2b6cff 0%, #1d4fd8 45%, #0c7d86 100%); }
.hero h1 { margin: 0 0 .25rem; }
.hero p { margin: 0 0 .85rem; font-size: .82rem; opacity: .9; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero .actions a, .hero .actions button { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff;
  padding: .4rem .75rem; border-radius: 8px; font-size: .82rem; }
.hero .actions a:hover { background: rgba(255,255,255,.22); text-decoration: none; }

.list-row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.rank { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .72rem;
  background: var(--accent-soft); color: var(--accent); }
.rank.teal { background: rgba(20,184,166,.14); color: var(--accent-2); }
.rank.warn { background: var(--warn-soft); color: var(--warn); }
.list-row .who { flex: 1; min-width: 0; }
.list-row .who b { display: block; font-size: .85rem; font-weight: 600; }
.list-row .who span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .amt { text-align: right; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.list-row .amt span { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }

.tabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.tabs button { white-space: nowrap; background: none; border: 0; color: var(--muted); padding: .3rem .6rem; border-radius: 6px; font-size: .74rem; cursor: pointer; }
.tabs button.on { background: var(--line-2); color: var(--text); }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .75rem; }
.trio div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; text-align: center; }
.trio span { display: block; font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.trio b { font-size: .8rem; }
.chart-box { position: relative; height: 210px; }
.donut-box { position: relative; height: 210px; max-width: 260px; margin: .5rem auto 1rem; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 1.5rem; }
.donut-center span { font-size: .75rem; color: var(--muted); }
.legend-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 10px; margin-top: .5rem; border: 1px solid var(--line); }
.legend-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-row .who { flex: 1; }
.legend-row .who b { display: block; font-size: .86rem; }
.legend-row .who span { font-size: .72rem; color: var(--muted); }
.legend-row .num { text-align: right; font-weight: 700; }
.legend-row .num span { display: block; font-size: .7rem; color: var(--muted); font-weight: 400; }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem;
  background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.pill.off { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: .3rem; box-shadow: 0 0 0 3px var(--good-soft); }

/* ---- Tables, badges, forms, buttons --------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
td.num { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.count { display: inline-block; min-width: 28px; text-align: center; padding: .1rem .4rem; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.count.good { background: var(--good-soft); color: var(--good); }
.count.plain { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

.badge { white-space: nowrap; display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.badge.active, .badge.applied, .badge.success, .badge.unused { background: var(--good-soft); color: var(--good); }
.badge.expired, .badge.failed, .badge.suspended { background: var(--bad-soft); color: var(--bad); }
.badge.unmatched, .badge.pending, .badge.new { background: var(--warn-soft); color: var(--warn); }

.btn, button { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: .5rem .9rem;
  border-radius: 8px; font: inherit; cursor: pointer; text-align: center; }
.btn.light, button.light { background: transparent; color: var(--accent); }
.btn.danger, button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.block { display: block; width: 100%; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

form p { margin: 0 0 .8rem; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
input, select, textarea { width: 100%; padding: .55rem .65rem; border: 1px solid var(--line-2); border-radius: 8px; font: inherit;
  background: var(--panel-2); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; }
.helptext { display: block; color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.errorlist { color: var(--bad); margin: .2rem 0; padding-left: 1rem; font-size: .85rem; }
.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }
.inline > * { flex: 1 1 140px; }
.inline > button { flex: 0 0 auto; }
.search { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.search input, .search select { flex: 1 1 160px; width: auto; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: var(--info-soft); }
.messages li.success { background: var(--good-soft); }
.messages li.error { background: var(--bad-soft); }
.alert { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--radius);
  padding: .75rem .9rem; margin-bottom: 1rem; font-size: .88rem; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pager { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }
.empty { text-align: center; color: var(--muted); padding: 1.2rem 0; font-size: .85rem; }

/* ---- Public pages (light) ------------------------------------------------------------- */
.public { max-width: 460px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.public header { text-align: center; margin: .5rem 0 1.25rem; }
.public header b { font-size: 1.3rem; }
.plan-option { display: flex; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: .5rem; background: var(--panel); font-weight: 400; }
.plan-option input { width: auto; }
.plan-option .price { margin-left: auto; font-weight: 700; }
.code { font: 700 2rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .15em; text-align: center; padding: .75rem; background: var(--accent-soft); border-radius: 8px; }
.wide { width: 100%; }
.center { text-align: center; }

/* ---- Shared bits for the new pages ------------------------------------------------------ */
.tabsbar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabsbar a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.tabsbar a.on { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.tabsbar a:hover { text-decoration: none; color: var(--text); }
pre.cmd { background: #05080f; color: #cfe3ff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem;
  font-size: .78rem; white-space: pre-wrap; word-break: break-all; margin: .4rem 0 0; }
body.light pre.cmd { background: #0f172a; }
.checks label { display: flex; gap: .55rem; align-items: center; font-weight: 400; padding: .3rem 0; }
.checks ul { list-style: none; padding: 0; margin: 0; }
.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; word-break: break-all; }
.count-chars { text-align: right; font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ---- Customers, reports and routers pages ------------------------------------------------ */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.pagehead h1 { margin: 0; }
.crumbs { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.crumbs a { color: var(--muted); }
.pagehead .actions, .hero .actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.pagehead .actions .btn, .pagehead .actions button { padding: .4rem .75rem; font-size: .84rem; }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; }
.tabcount { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; font-size: .72rem;
  background: var(--panel-2); color: var(--muted); font-weight: 600; }
.tabsbar a.on .tabcount { background: var(--accent); color: #fff; }
.filters select { flex: 1 1 130px; }
.filters button, .filters .btn { flex: 0 0 auto; }
table.clist td, table.clist th { vertical-align: middle; }
table.clist td.who { min-width: 150px; }
td.pick, th.pick { width: 34px; padding-left: .8rem; }
.kind { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .72rem; font-weight: 600; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent); }
.kind.hotspot { background: rgba(20,184,166,.14); color: var(--accent-2); }
.kind.static { background: var(--warn-soft); color: var(--warn); }
.dotoff { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: .3rem; }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--muted); margin-right: .2rem; background: var(--panel-2); }
.iconbtn:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.badge.online { background: var(--good-soft); color: var(--good); }
.badge.offline { background: var(--bad-soft); color: var(--bad); }
.badge.unknown { background: var(--panel-2); color: var(--muted); }
.hero .actions button { cursor: pointer; font: inherit; font-size: .82rem; }
.hero .actions button:hover { background: rgba(255,255,255,.22); }
.hero .actions form { margin: 0; display: inline; }
.legend { margin-top: .4rem; }
.legend .lrow { display: flex; align-items: center; gap: .5rem; padding: .32rem 0; font-size: .8rem; border-top: 1px dashed var(--line); }
.legend .lrow:first-child { border-top: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .val { font-weight: 650; white-space: nowrap; }
.legend .val span { color: var(--muted); font-weight: 400; margin-left: .3rem; }
.filterbox summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem;
  border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-size: .86rem; background: var(--panel-2); }
.filterbox summary::-webkit-details-marker { display: none; }
.filterbox[open] summary { border-color: var(--accent); }
.filterbox .panel { margin-top: .6rem; }
.filterbox .panel .grid2 { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.filterbox .panel label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.copybox { position: relative; }
.copybox button.copy { position: absolute; top: .5rem; right: .5rem; padding: .2rem .55rem; font-size: .75rem; }
@media print {
  .drawer, .scrim, .topbar, .noprint, .pager, .hero .actions, .tabsbar, .filterbox, .messages { display: none !important; }
  .shell { margin: 0 !important; }
  body, body * { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card, .stat { border: 1px solid #bbb !important; break-inside: avoid; }
  main { max-width: none; padding: 0; }
  .hero { padding: 0 0 .5rem; }
  .table-wrap { overflow: visible; }
  th, td { border-bottom: 1px solid #ccc !important; }
  a { text-decoration: none; }
}


/* ---- Customer details ------------------------------------------------------------------- */
.upper { text-transform: uppercase; letter-spacing: .01em; }
.actionbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin-bottom: 1rem; }
.actionbar form { margin: 0; display: contents; }
@media (min-width: 900px) { .actionbar { grid-template-columns: repeat(8, auto); justify-content: start; } }
.ab { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .5rem .55rem; border-radius: 9px;
  font: inherit; font-size: .78rem; font-weight: 600; line-height: 1.15; text-align: center; border: 1px solid transparent; cursor: pointer;
  color: #fff; background: var(--accent); min-height: 2.6rem; }
.ab:hover { text-decoration: none; filter: brightness(1.08); }
.ab.dark { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.ab.blue { background: #4f5bff; }
.ab.green { background: #16a34a; }
.ab.red { background: var(--bad); }
.ab.orange { background: #f59e0b; color: #1d1300; }
.ab.cyan { background: #0ea5e9; }
.ab.white { background: #fff; color: #1d2330; border-color: #d6dbe4; }
.ab.redsoft { background: #fff1f0; color: #b42318; border-color: #f7c6c1; }
.ab.whitebad { background: #fff6f5; color: #b42318; border-color: #f7c6c1; }
.ab.sm { min-height: 0; padding: .35rem .6rem; font-size: .74rem; }
.ab.wide { flex: 1; width: 100%; }
button.link { background: none; border: 0; color: var(--accent); padding: 0 .3rem; font-size: .8rem; cursor: pointer; }
.cd-grid { display: grid; gap: 1rem; }
@media (min-width: 980px) { .cd-grid { grid-template-columns: minmax(320px, 1fr) 1.4fr; align-items: start; } }
.cd-grid > .card, .cd-grid > div > .card { margin-bottom: 1rem; }
.profile .phead { display: flex; gap: .8rem; align-items: center; margin-bottom: .9rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; font-size: 1.05rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; }
.profile > .two:first-of-type { border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
.cap { font-size: .64rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .15rem; }
.big { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.sect { font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--line); margin: 1rem -1rem .6rem; padding: .8rem 1rem 0; }
.irow { display: flex; gap: .7rem; align-items: flex-start; padding: .35rem 0; font-size: .86rem; }
.irow .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; flex: none;
  font-size: .8rem; color: var(--muted); }
.reveal { background: none; border: 0; padding: 0 .2rem; cursor: pointer; font-size: .85rem; }
.drow { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; background: var(--panel-2);
  border-radius: 8px; margin-bottom: .35rem; font-size: .82rem; }
.drow span { color: var(--muted); }
.btn2 { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: 1rem 0 .45rem; }
.pkgcard .pkg { border-left: 3px solid var(--line-2); border-radius: 10px; background: var(--panel-2); padding: .9rem; margin-top: .6rem; }
.pkgcard .pkg.on { border-left-color: var(--good); }
.pkgcard .pkg .two { font-size: .85rem; }
.rech { margin-top: .8rem; }
.rech summary { cursor: pointer; color: var(--accent); font-size: .86rem; font-weight: 600; }
.rgrid { display: grid; gap: .8rem; margin-top: .7rem; }
@media (min-width: 700px) { .rgrid { grid-template-columns: repeat(3, 1fr); } }
.rgrid form { background: var(--panel-2); border-radius: 10px; padding: .8rem; display: flex; flex-direction: column; gap: .3rem; }
.rgrid label { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.rgrid button { margin-top: .5rem; }
.usage { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin: .4rem 0 .6rem; }
.ustat { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; padding: .22rem 0; }
.ustat span, .ustat b { white-space: nowrap; }
@media (max-width: 520px) { .usage.two { grid-template-columns: 1fr; } .usage.two > div + div { border-top: 1px dashed var(--line); padding-top: .5rem; } }
.ustat span { color: var(--muted); }
.devrow { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-top: 1px dashed var(--line); }
.devrow:first-of-type { border-top: 0; }
.htabs button { padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: transparent;
  font-size: .8rem; font-weight: 500; }
.htabs button.on { background: #4f5bff; color: #fff; border-color: transparent; }
.hcard { border: 1px solid var(--line); border-radius: 10px; padding: .75rem .85rem; margin-bottom: .55rem; background: var(--panel-2); }
.chan { display: inline-block; font-size: .66rem; font-weight: 700; padding: 0 .4rem; border-radius: 5px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--line); }
.chan.whatsapp { background: rgba(37,211,102,.14); color: #25d366; border-color: transparent; }
dialog.sheet { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); color: var(--text); padding: 1.1rem;
  width: min(440px, calc(100vw - 2rem)); }
dialog.sheet::backdrop { background: rgba(0,0,0,.55); }
dialog.sheet label { display: block; font-size: .78rem; color: var(--muted); margin: .6rem 0 .2rem; }
dialog.sheet h2 { margin-top: 0; }
@media print { .actionbar, dialog, .rech, .htabs { display: none !important; } }

/* ---- Send Message pages --------------------------------------------------------------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); margin-bottom: 1rem; max-width: 680px; }
.seg a { text-align: center; padding: .6rem .4rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a.on { background: #4f5bff; color: #fff; }
.seg a:hover { text-decoration: none; }
.fsect { font-size: .8rem; font-weight: 700; color: var(--accent); margin: 1rem 0 .6rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.fsect:first-of-type { border-top: 0; padding-top: 0; margin-top: .2rem; }
.testing .field { background: #fff8eb; color: #3b2a05; border-radius: 10px; padding: .6rem .8rem; }
.testing .helptext { color: #6b5320; }
.ph-card { max-width: 680px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: .35rem .55rem;
  font-size: .76rem; font-weight: 500; text-align: left; }
.chip .mono { color: var(--accent); }
.chip:hover { color: var(--text); border-color: var(--line-2); filter: none; }
.picks { position: absolute; left: 0; right: 0; z-index: 30; margin-top: .25rem; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35); overflow: hidden; }
.pick { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  color: var(--text); padding: .55rem .8rem; font-size: .85rem; }
.pick span { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
.pick:hover { background: var(--panel-2); filter: none; }

/* ---- User Notification ------------------------------------------------------------------- */
.ncards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ncard { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem .2rem; background: var(--panel-2); }
.ncard h3 { margin: 0 0 .6rem; font-size: .95rem; }
.ncard .checks { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.ncard > .helptext { display: block; margin-bottom: .8rem; }
.tpl { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .55rem; background: var(--panel); }
.tpl summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem .9rem; font-weight: 600; font-size: .92rem; }
.tpl summary::-webkit-details-marker { display: none; }
.tpl summary::after { content: "\203A"; color: var(--muted); transition: transform .15s ease; margin-left: .2rem; }
.tpl summary > span:first-child { flex: 1; }
.tpl[open] summary::after { transform: rotate(90deg); }
.tpl[open] summary { border-bottom: 1px solid var(--line); }
.tpl-body { padding: .4rem .9rem .9rem; }
.tpl-body textarea { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.owed { margin-top: .6rem; padding: .45rem .65rem; border-radius: 9px; font-size: .82rem; background: #fff8eb; color: #3b2a05;
  border: 1px solid #f5d9a6; }
dialog.sheet .checks label { display: flex; gap: .5rem; align-items: center; margin: .2rem 0; font-size: .86rem; color: var(--text); }
.tpl .chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: .35rem; }
.tpl .chip { padding: .3rem .5rem; line-height: 1.25; }
.tpl .chip .mono { display: block; font-size: .74rem; overflow-wrap: anywhere; }

/* ---- Remote access ----------------------------------------------------------------------- */
.addr { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 .7rem; }
.addr .mono { font-size: 1.15rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.steps { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.steps li { margin: .2rem 0; }
.warn-text { color: var(--warn); }
button.wide { width: 100%; }
.rem { display: inline-block; margin-top: .2rem; }
