/* ============================================================================
   SHOWMYIP — "military cyber command center" theme
   Self-contained dark HUD styling. No CSS framework dependency.
   ========================================================================= */

:root {
  --bg:           #06080e;
  --bg-2:         #0a0e16;
  --panel:        rgba(18, 24, 34, 0.66);
  --panel-solid:  #0e141d;
  --line:         rgba(150, 170, 195, 0.13);   /* neutral border, not green */
  --line-soft:    rgba(140, 160, 180, 0.08);
  --text:         #cdd7e3;
  --text-dim:     #8b97a8;                       /* lifted for WCAG AA */
  --text-bright:  #f2f5fb;
  --accent:       #00e29a;   /* single accent, used sparingly */
  --accent-2:     #38bdf8;   /* secondary (links) */
  --amber:        #f5b14b;
  --red:          #ff5468;
  --mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: var(--sans);
  /* radius scale */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Visually hidden but available to screen readers (h1s, labels, skip-link). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Skip-to-content link: off-screen until focused. */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--accent); color: #00120c; font-weight: 700;
  padding: 8px 14px; border-radius: 0 0 8px 8px; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

html { -webkit-text-size-adjust: 100%; }

/* Consistent, accessible focus ring */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Background layers: radial glows + faint tactical grid + scanlines */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(0, 255, 163, 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(33, 184, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
  opacity: 0.6;
}

/* ----------------------------------------------------------------- header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.6);
  backdrop-filter: blur(6px);
  /* keep the header (and its avatar dropdown) above page content such as the
     dossier's position:sticky rail, which would otherwise paint over it. */
  position: relative; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); display: inline-flex; align-items: center; }
.brand-mark svg { display: block; }
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--text-bright);
}
.brand-name .accent { color: var(--accent); letter-spacing: inherit; }
.brand-tag {
  font-size: 10px; letter-spacing: 3px; color: var(--text-dim);
  border-left: 1px solid var(--line); padding-left: 12px; margin-left: 4px;
  text-transform: uppercase;
}
.status {
  font-size: 11px; letter-spacing: 2px; color: var(--accent);
  display: flex; align-items: center; gap: 8px; text-transform: uppercase;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(0, 255, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 163, 0); }
}

/* -------------------------------------------------------------- container */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  flex: 1 0 auto;
}

/* ------------------------------------------------------------------- hero */
.hero { text-align: center; margin-bottom: 30px; }
.hero-label {
  font-size: 11px; letter-spacing: 3px; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 14px;
}
.hero-ip {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 18px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.ip-value {
  font-size: clamp(28px, 6vw, 46px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.hero-meta { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.chip {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(33, 184, 255, 0.3);
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(33, 184, 255, 0.06);
}

/* --------------------------------------------------------- lookup teaser */
.lookup-teaser {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto 38px;
  max-width: 760px;
}
.lookup { display: flex; flex: 1 1 460px; min-width: 280px; }
.lookup input {
  flex: 1;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--mono); font-size: 13px;
}
.lookup input::placeholder { color: var(--text-dim); }
.lookup button {
  font-family: var(--display); font-weight: 600; letter-spacing: 0;
  border: 1px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--accent); color: #04130d;
  padding: 0 22px;
  cursor: pointer;
  transition: filter .15s ease;
}
.lookup button:hover { filter: brightness(1.08); background: var(--accent); }
.lookup button:hover { filter: brightness(1.08); }
.soon {
  font-size: 10px; letter-spacing: 2px; color: var(--amber);
  border: 1px dashed rgba(255, 176, 0, 0.4);
  border-radius: 6px; padding: 6px 10px; white-space: nowrap;
}

/* ------------------------------------------------------------- data grid */
.section-title {
  font-family: var(--display); letter-spacing: -0.01em; font-weight: 600;
  font-size: 16px; color: var(--text-bright); text-transform: none;
  margin: 30px 0 14px; display: flex; align-items: center; gap: 10px;
}
.section-title:first-child { margin-top: 0; }
.section-title::before { content: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px 18px 18px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 2px; height: 100%;
  background: var(--accent);
  opacity: 0.28;
}
.card:hover {
  border-color: rgba(0, 255, 163, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.card.span-2 { grid-column: span 2; }
.card-label {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.card-value {
  font-size: 15px; color: var(--text-bright); word-break: break-word;
}
.card-value.small { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.card-endpoint {
  display: inline-block; margin-top: 10px;
  font-size: 11px; color: var(--accent-2); text-decoration: none;
  border: 1px solid rgba(33, 184, 255, 0.25); border-radius: 5px;
  padding: 2px 8px; transition: background .2s, color .2s;
}
.card-endpoint:hover { background: rgba(33, 184, 255, 0.12); color: var(--text-bright); }

/* ------------------------------------------------------------ json panel */
.json-panel {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--panel-solid);
}
.json-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: rgba(0, 255, 163, 0.04);
  font-size: 12px; letter-spacing: 1px; color: var(--text-dim);
}
.json-head .verb {
  color: var(--accent); font-weight: 700;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px;
}
.json-head .json-link { margin-left: auto; color: var(--accent-2); text-decoration: none; font-size: 11px; }
.json-head .json-link:hover { color: var(--text-bright); }
.json-body {
  padding: 16px; font-size: 12.5px; color: #8de8c4;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
  max-height: 220px; overflow: auto;
}

/* ---------------------------------------------------------------- copy btn */
.copy-btn {
  font-family: var(--display); font-weight: 700; letter-spacing: 2px;
  font-size: 11px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer; transition: all .2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------- error box */
.errorbox { text-align: center; padding: 70px 16px; }
.err-code {
  font-family: var(--display); font-weight: 800; font-size: 90px;
  color: var(--accent); line-height: 1; letter-spacing: -0.02em;
}
.err-code.amber { color: var(--amber); }
.err-msg { letter-spacing: 4px; color: var(--text-dim); margin: 14px 0 8px; text-transform: uppercase; }
.err-sub { color: var(--text-dim); margin-bottom: 26px; }
.btn {
  display: inline-block; font-family: var(--display); font-weight: 700; letter-spacing: 2px;
  color: var(--accent); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 8px; padding: 11px 22px;
  background: rgba(0, 255, 163, 0.08); transition: all .2s;
}
.btn:hover { background: rgba(0, 255, 163, 0.18); }
.mono { font-family: var(--mono); color: var(--text-bright); }

/* ----------------------------------------------------------------- footer */
.site-footer {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: 1.5px; color: var(--text-dim);
  background: rgba(5, 8, 14, 0.6);
}
.foot-nav { display: flex; gap: 18px; }
.foot-nav a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
.foot-nav a:hover { color: var(--accent); }

.soon.live { color: var(--accent); border-color: rgba(0, 255, 163, 0.4); }

/* ============================ DOSSIER (lookup) ============================ */
.lookup-bar { max-width: 760px; margin: 0 auto 26px; }
.lookup-bar .lookup { width: 100%; }

.alert {
  max-width: 760px; margin: 0 auto 26px;
  border: 1px solid rgba(255, 77, 94, 0.4); border-radius: 8px;
  background: rgba(255, 77, 94, 0.08); color: #ff9aa6;
  padding: 12px 16px; font-size: 13px;
}
.empty-state { text-align: center; color: var(--text-dim); padding: 40px 0; }
.alert.success { border-color: rgba(0,255,163,0.4); background: rgba(0,255,163,0.08); color: var(--accent); }
.alert.warning { border-color: rgba(255,176,32,0.4); background: rgba(255,176,32,0.08); color: var(--amber); }
.alert.info { border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.08); color: #7dd3fc; }
.msgs { display: flex; flex-direction: column; gap: 10px; }

/* level color tokens */
.level-clean    { --lvl: var(--accent); }
.level-low      { --lvl: #8de8c4; }
.level-elevated { --lvl: var(--amber); }
.level-high     { --lvl: var(--red); }

.dossier-head {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 24px 28px; margin-bottom: 30px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

/* circular score gauge via conic-gradient */
.score-ring {
  --val: 0;
  position: relative; width: 132px; height: 132px; border-radius: 50%;
  flex-shrink: 0;
  background:
    conic-gradient(var(--lvl) calc(var(--val) * 1%), rgba(140, 160, 180, 0.10) 0);
  display: grid; place-items: center;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--lvl) 40%, transparent));
}
.score-inner {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--bg-2); display: grid; place-items: center; text-align: center;
  border: 1px solid var(--line);
}
.score-num { font-family: var(--display); font-weight: 700; font-size: 40px; color: var(--lvl); line-height: 1; }
.score-max { font-size: 11px; color: var(--text-dim); }

.head-meta { flex: 1; min-width: 220px; }
.head-ip {
  font-size: clamp(22px, 4vw, 32px); font-weight: 700; color: var(--text-bright);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.head-level { color: var(--text-dim); font-size: 13px; margin: 6px 0 12px; }
.head-level strong { color: var(--lvl); }

.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--display); font-weight: 700; letter-spacing: 1.5px; font-size: 11px;
  padding: 4px 12px; border-radius: 5px; text-transform: uppercase;
  border: 1px solid currentColor;
}
.b-clean      { color: var(--accent); background: rgba(0, 255, 163, 0.08); }
.b-tor        { color: #c08cff; background: rgba(160, 100, 255, 0.10); }
.b-blocklist  { color: var(--red); background: rgba(255, 77, 94, 0.10); }
.b-datacenter { color: var(--accent-2); background: rgba(33, 184, 255, 0.10); }

.reasons { list-style: none; display: grid; gap: 8px; margin-bottom: 32px; }
.reasons li {
  position: relative; padding: 10px 14px 10px 34px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--text); font-size: 13px;
}
.reasons li::before {
  content: "›"; position: absolute; left: 14px; color: var(--accent); font-weight: 700;
}

.muted-val { color: var(--text-dim); }
.card-endpoint.src {
  color: var(--text-dim); border-color: var(--line-soft); cursor: default;
}
.tlist {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; border: 1px solid currentColor;
}
.tlist-tor { color: #c08cff; }
.tlist-blocklist { color: var(--red); }
.tlist-proxy { color: var(--accent-2); }

/* Sightings sparkline */
.spark {
  display: flex; align-items: flex-end; gap: 3px; height: 60px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 10px 12px; margin-top: 4px;
}
.spark-bar { flex: 1; min-width: 3px; min-height: 3px; border-radius: 2px 2px 0 0; opacity: 0.85; }
.spark-bar.s-low { background: var(--accent); }
.spark-bar.s-mid { background: var(--amber); }
.spark-bar.s-high { background: var(--red); }
.spark-cap { font-size: 11px; letter-spacing: 1px; margin: 8px 0 32px; }

/* Actionable verdict (ALLOW / REVIEW / BLOCK) */
.verdict {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border: 1px solid var(--vc); border-left-width: 4px; border-radius: 10px;
  background: color-mix(in srgb, var(--vc) 8%, transparent);
  padding: 16px 20px; margin: 0 0 30px;
}
.verdict-allow  { --vc: var(--accent); }
.verdict-review { --vc: var(--amber); }
.verdict-block  { --vc: var(--red); }
.verdict-badge {
  font-family: var(--display); font-weight: 700; letter-spacing: 2px; font-size: 18px;
  color: var(--vc); padding: 6px 16px; border: 1px solid var(--vc); border-radius: 7px;
  background: color-mix(in srgb, var(--vc) 12%, transparent); flex-shrink: 0;
}
.verdict-text { display: flex; flex-direction: column; gap: 3px; }
.verdict-text strong { color: var(--text-bright); font-size: 15px; }

.verdict-pill {
  display: inline-block; font-family: var(--display); font-weight: 700;
  font-size: 10px; letter-spacing: 1px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid currentColor;
}
.verdict-pill.allow  { color: var(--accent); }
.verdict-pill.review { color: var(--amber); }
.verdict-pill.block  { color: var(--red); }

/* ============================ OPS DASHBOARD ============================ */
.ops-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 8px;
}
.ops-title {
  font-family: var(--display); font-weight: 700; letter-spacing: 2px;
  font-size: 26px; color: var(--text-bright);
}
.accent { color: var(--accent); }
.cyan { color: var(--accent-2); }
.amber { color: var(--amber); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stat {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 18px 18px 16px; position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.stat-num {
  font-family: var(--display); font-weight: 700; font-size: 32px;
  color: var(--text-bright); line-height: 1.1;
}
.stat-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin-top: 6px;
}

.ops-table-wrap {
  border: 1px solid var(--line); border-radius: 10px; overflow-x: auto;
  background: var(--panel-solid); margin-bottom: 30px;
}
.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table th {
  text-align: left; padding: 11px 16px; color: var(--text-dim);
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  border-bottom: 1px solid var(--line); background: rgba(0, 255, 163, 0.03);
}
.ops-table td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Responsive: stack `.ops-table.stack` rows into cards on small screens */
@media (max-width: 640px) {
  .ops-table.stack thead { display: none; }
  .ops-table.stack, .ops-table.stack tbody, .ops-table.stack tr, .ops-table.stack td { display: block; width: 100%; }
  .ops-table.stack tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .ops-table.stack tr:last-child { border-bottom: none; }
  .ops-table.stack td {
    border: none; padding: 7px 16px; display: flex; align-items: center;
    justify-content: space-between; gap: 16px; text-align: right;
  }
  .ops-table.stack td::before {
    content: attr(data-label); color: var(--text-dim); font-size: 12px;
    font-weight: 500; text-align: left; flex-shrink: 0;
  }
  .ops-table.stack td:empty { display: none; }
}

.dot-status {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.s-ok { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.s-error { background: var(--red); box-shadow: 0 0 8px var(--red); }
.s-running { background: var(--amber); }
.s-never { background: var(--text-dim); }

.pill {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim);
}
.pill.ok { color: var(--accent); border-color: rgba(0, 255, 163, 0.3); }

.score-pill {
  display: inline-block; min-width: 30px; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 12px;
  padding: 2px 8px; border-radius: 5px; border: 1px solid currentColor;
}
.score-pill.clean { color: var(--accent); }
.score-pill.low { color: #8de8c4; }
.score-pill.elev { color: var(--amber); }
.score-pill.high { color: var(--red); }

.ops-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 30px; }
.pager-status { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }

/* ===================== IP DATABASE (ops) ===================== */
.ops-table th a.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.ops-table th a.th-sort:hover { color: var(--accent); }
.sort-arrow { color: var(--accent); font-size: 11px; }
.ip-table .ip-cell { font-size: 13px; color: var(--text-bright); letter-spacing: 0.3px; }
/* status badges */
.st-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
}
.st-badge.clean { color: var(--accent); border-color: rgba(0,255,163,0.35); background: rgba(0,255,163,0.08); }
.st-badge.watch { color: var(--amber); border-color: rgba(245,177,75,0.4); background: rgba(245,177,75,0.08); }
.st-badge.blocked { color: var(--red); border-color: rgba(255,77,94,0.4); background: rgba(255,77,94,0.08); }
.st-score { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.ip-type { font-size: 12px; color: var(--text); }
.threat-tag { margin-left: 6px; font-size: 10px; color: var(--amber); border-color: rgba(245,177,75,0.4); }
.net-link { color: var(--accent-2); text-decoration: none; }
.net-link:hover { text-decoration: underline; }
.geo-flag { font-size: 14px; }
/* dataset tabs (segmented control) */
.ds-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.ds-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  font-size: 13px; color: var(--text-dim); text-decoration: none;
  border: 1px solid transparent; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ds-tab:hover { color: var(--text); }
.ds-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ds-count {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  background: rgba(255,255,255,0.05); border-radius: 999px; padding: 2px 8px;
}
.ds-tab.active .ds-count { color: var(--accent); background: rgba(0,255,163,0.1); }
/* live lookups counter */
.lookup-stats { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.lk-stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px 22px; min-width: 150px; background: var(--panel); }
.lk-stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.lk-stat-num { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--text-bright); line-height: 1; }
.lk-stat-num.lk-bump { animation: lk-bump 0.5s ease; }
@keyframes lk-bump { 0% { color: var(--accent); transform: scale(1.12); } 100% { color: var(--text-bright); transform: scale(1); } }
.lk-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); align-self: center; }
.lk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(0,255,163,0.6); animation: lk-pulse 1.8s infinite; }
@keyframes lk-pulse { 0% { box-shadow: 0 0 0 0 rgba(0,255,163,0.5); } 70% { box-shadow: 0 0 0 8px rgba(0,255,163,0); } 100% { box-shadow: 0 0 0 0 rgba(0,255,163,0); } }
@media (prefers-reduced-motion: reduce) { .lk-dot, .lk-stat-num.lk-bump, .topbar-counter .lk-dot { animation: none; } }
/* compact top-bar live counter (always visible across /ops) */
.topbar-counter {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  background: var(--panel); white-space: nowrap;
}
.topbar-counter:hover { border-color: var(--accent); }
.topbar-counter .tc-num { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text-bright); }
.topbar-counter .tc-label { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-dim); }
.topbar-counter .tc-num.lk-bump { animation: lk-bump 0.5s ease; }

/* ===================== SYSTEM HEALTH DASHBOARD ===================== */
.health-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.health-controls { display: flex; align-items: center; gap: 14px; }
.h-toggle { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hchip {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--panel);
}
.hchip.ok { color: var(--accent); border-color: rgba(0,255,163,0.4); background: rgba(0,255,163,0.07); }
.hchip.warn { color: var(--amber); border-color: rgba(245,177,75,0.4); background: rgba(245,177,75,0.07); }
.hchip.crit { color: var(--red); border-color: rgba(255,77,94,0.45); background: rgba(255,77,94,0.08); }
.health-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 1100px) { .health-grid { grid-template-columns: 1fr; } }
.hcard { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 20px 22px; }
.hcard.span2 { grid-column: 1 / -1; }
.hcard-title { font-family: var(--display); font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-bright); margin: 0 0 16px; }
.hcard-title .muted-val { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.hmetric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .hmetric-row { grid-template-columns: 1fr; } }
.hmetric { margin-bottom: 16px; }
.hm-label { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px; }
.hm-label .muted-val { text-transform: none; }
.hm-val { font-family: var(--mono); font-size: 15px; color: var(--text-bright); margin-bottom: 7px; }
.hbar { height: 7px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.5s ease, background 0.3s ease; }
.hbar-fill.ok { background: var(--accent); }
.hbar-fill.warn { background: var(--amber); }
.hbar-fill.crit { background: var(--red); }
.hstat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0; }
@media (max-width: 700px) { .hstat-grid { grid-template-columns: repeat(2, 1fr); } }
.hstat { border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px 13px; background: rgba(255,255,255,0.015); }
.hs-num { display: block; font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text-bright); line-height: 1.1; }
.hs-lab { display: block; font-size: 10.5px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-dim); margin-top: 3px; }
.hsub { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin: 18px 0 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.hsub .muted-val { text-transform: none; letter-spacing: 0; }
.crit-text { color: var(--red); }
.health-grid .ops-table { font-size: 12px; }
.health-grid .ops-table th { padding: 7px 10px; }
.health-grid .ops-table td { padding: 7px 10px; }
/* Constrain the request-volume chart so Chart.js can't grow it unbounded */
.chart-box { position: relative; height: 90px; width: 100%; }
.chart-box canvas { position: absolute; inset: 0; }

/* ---- redesign: banner, reactive pills, infra row, accordions, actions ---- */
.h-banner { display: flex; align-items: flex-start; gap: 12px; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.h-banner.crit { border-color: rgba(255,77,94,0.5); background: rgba(255,77,94,0.08); }
.h-banner.warn { border-color: rgba(245,177,75,0.5); background: rgba(245,177,75,0.07); }
.h-banner.ok { display: none; }
.hb-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #0b0f17; background: var(--red); }
.h-banner.warn .hb-icon { background: var(--amber); }
.h-banner.crit .hb-icon { animation: lk-pulse 1.4s infinite; }
.hb-list { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.hb-item.crit { color: #ff9aa6; }
.hb-item.warn { color: var(--amber); }
.hb-item strong { color: var(--text-bright); }

/* reactive status pills (now anchors with a dot) */
.hchip { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.hchip .hdot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.hchip.ok .hdot { background: var(--accent); }
.hchip.warn .hdot { background: var(--amber); }
.hchip.crit .hdot { background: var(--red); animation: lk-pulse 1.4s infinite; }
.hchip.na { color: var(--text-dim); }

/* affected-card outlines */
.hcard.card-warn { border-color: rgba(245,177,75,0.55); }
.hcard.card-crit { border-color: rgba(255,77,94,0.6); box-shadow: 0 0 0 1px rgba(255,77,94,0.3); animation: card-pulse 1.9s ease-in-out infinite; }
@keyframes card-pulse { 0%,100% { box-shadow: 0 0 0 1px rgba(255,77,94,0.22); } 50% { box-shadow: 0 0 0 3px rgba(255,77,94,0.1); } }
@media (prefers-reduced-motion: reduce) { .hcard.card-crit, .hchip.crit .hdot, .h-banner.crit .hb-icon { animation: none; } }

/* 3-up infrastructure row */
.infra-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
@media (max-width: 1100px) { .infra-row { grid-template-columns: 1fr; } }
#card-db, #card-app { margin-bottom: 16px; }

/* card-header quick actions */
.hcard-title { display: flex; align-items: center; gap: 8px; }
.hcard-act { margin-left: auto; margin-bottom: 0; }
.hact-btn { font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-dim); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.hact-btn:hover { color: var(--accent); border-color: var(--accent); }

/* collapsible accordions (slow queries / tables / replication) */
.hacc { border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 10px; }
.hacc > summary { cursor: pointer; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); list-style: none; display: flex; align-items: center; gap: 8px; }
.hacc > summary::-webkit-details-marker { display: none; }
.hacc > summary::before { content: "▸"; color: var(--text-dim); }
.hacc[open] > summary::before { content: "▾"; }
.hacc[open] > summary { color: var(--text); margin-bottom: 8px; }
.hacc .muted-val { text-transform: none; letter-spacing: 0; }
.acc-badge { font-family: var(--mono); font-size: 10px; color: var(--text-dim); background: rgba(255,255,255,0.06); border-radius: 999px; padding: 1px 8px; }
.acc-badge.crit { color: var(--red); background: rgba(255,77,94,0.14); }

/* denser stat grids */
.hstat-grid-8 { grid-template-columns: repeat(4, 1fr); }
.hstat-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .hstat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .hstat-grid-8, .hstat-grid-6 { grid-template-columns: repeat(2, 1fr); } }

/* zero-muting + anomaly colours */
.hs-num.is-zero { color: var(--text-dim); opacity: 0.5; }
.hs-num.warn-text { color: var(--amber); }
.hs-num.crit-text { color: var(--red); }
.warn-text { color: var(--amber); }

/* chart time-range toggle */
.hsub-flex { display: flex; align-items: center; justify-content: space-between; }
.range-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.range-toggle button { background: none; border: none; color: var(--text-dim); font-size: 11px; padding: 4px 12px; cursor: pointer; font-family: var(--mono); }
.range-toggle button:hover { color: var(--text); }
.range-toggle button.active { background: rgba(0,226,154,0.12); color: var(--accent); }

/* ===================== BREADCRUMB ===================== */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin: 0 0 16px; letter-spacing: 0.3px; }
.breadcrumb [aria-current="page"] { color: var(--text); }
.bc-sep { opacity: 0.5; }

/* =============== TABBED INTERFACE (Payment Gateways; reusable) =============== */
.gw-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gw-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; font-size: 13px; font-weight: 500; color: var(--text-dim); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.gw-tab:hover { color: var(--text); }
.gw-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.gw-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 6px; }
.gw-tab.disabled, .gw-tab.disabled:hover { color: var(--text-dim); opacity: 0.5; cursor: default; }
.gw-soon { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; background: rgba(255,255,255,0.06); color: var(--text-dim); border-radius: 999px; padding: 2px 7px; }
.gw-panel { animation: gw-fade 0.2s ease; }
@keyframes gw-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gw-panel { animation: none; } }
.gw-empty { text-align: center; padding: 60px 24px; border: 1px dashed var(--line); border-radius: 14px; background: rgba(255,255,255,0.012); }
.gw-empty-icon { color: var(--text-dim); margin-bottom: 14px; }
.gw-empty h3 { font-family: var(--display); font-size: 18px; color: var(--text-bright); margin: 0 0 8px; }
.gw-empty p { color: var(--text-dim); font-size: 14px; line-height: 1.6; max-width: 440px; margin: 0 auto 18px; }

/* intro banner */
.gw-intro { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 18px 22px; margin-bottom: 22px; }
.gw-intro-icon { flex: none; width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--accent); background: rgba(0,226,154,0.08); border: 1px solid rgba(0,226,154,0.22); }
.gw-intro p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.6; }

/* status-card description line */
.int-stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

/* credentials: form + help panel */
.gw-cred-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .gw-cred-grid { grid-template-columns: 1fr; } }
.gw-cred-grid .opsform { max-width: none; }
.key-input { display: flex; align-items: stretch; gap: 8px; }
.key-input input { flex: 1; min-width: 0; }
.key-btn { flex: none; width: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--text-dim); cursor: pointer; }
.key-btn:hover { color: var(--accent); border-color: var(--accent); }
.key-btn.on, .key-btn.copied { color: var(--accent); border-color: var(--accent); }
.gw-help { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.015); padding: 20px 22px; }
.gw-help h3 { font-family: var(--display); font-size: 15px; color: var(--text-bright); margin: 0 0 14px; }
.gw-help-links { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gw-help-links a { color: var(--accent-2); text-decoration: none; font-size: 13px; }
.gw-help-links a:hover { text-decoration: underline; }

/* ===================== DASHBOARD POLISH ===================== */
/* Dark, minimal scrollbars everywhere in the dashboard (kills the white one) */
.dash-body * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
.dash-body ::-webkit-scrollbar { width: 9px; height: 9px; }
.dash-body ::-webkit-scrollbar-track { background: transparent; }
.dash-body ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.dash-body ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); background-clip: padding-box; }

/* Sidebar nav: smoother hover/active + a clear active accent bar */
.nav-item { position: relative; transition: background 0.12s ease, color 0.12s ease; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-section { padding: 16px 12px 6px; }

/* ===================== SOFT BADGES (role / status) ===================== */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; padding: 3px 10px; border-radius: 999px; line-height: 1.4; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-owner { color: var(--accent); background: rgba(0,226,154,0.13); }
.badge-agent { color: var(--text); background: rgba(255,255,255,0.07); }
.badge-active { color: var(--accent); background: rgba(0,226,154,0.1); }
.badge-disabled { color: var(--text-dim); background: rgba(255,255,255,0.05); }

/* Capability chips (soft, hover = tooltip) */
.cap-tag { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--accent-2); background: rgba(56,189,248,0.1); border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; cursor: help; }

/* Roomier agents table + right-aligned, secondary action column */
.agents-table td { padding-top: 13px; padding-bottom: 13px; }
.agents-table th:last-child, .agents-table td.row-action { text-align: right; }
.row-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.btn-mini.danger { color: var(--red); }
.btn-mini.danger:hover { color: var(--red); border-color: var(--red); }

/* ===================== SIDE DRAWER (capability reference) ===================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 80; display: flex; justify-content: flex-end; }
.drawer-overlay[hidden] { display: none; }
.drawer { width: min(420px, 92vw); height: 100%; background: var(--panel-solid); border-left: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: -24px 0 48px rgba(0,0,0,0.45); animation: drawer-in 0.22s ease; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2 { font-family: var(--display); font-size: 16px; margin: 0; color: var(--text-bright); }
.drawer-close { background: none; border: none; color: var(--text-dim); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.drawer-close:hover { color: var(--text); }
.drawer-body { padding: 16px 22px 24px; overflow-y: auto; }
.capref-item { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.capref-item:last-child { border-bottom: none; }
.capref-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.capref-top strong { color: var(--text-bright); font-size: 13px; }
.capref-item p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.55; }

/* ===================== CONFIRM MODAL (custom confirm()) ===================== */
.cmodal-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.6); }
.cmodal-overlay[hidden] { display: none; }
.cmodal { width: min(420px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,0.5); animation: cmodal-in 0.16s ease; }
@keyframes cmodal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmodal { animation: none; } }
.cmodal-title { font-family: var(--display); font-size: 17px; color: var(--text-bright); margin: 0 0 10px; }
.cmodal-msg { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }
.cmodal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cmodal-danger { border-color: rgba(255,77,94,0.5) !important; background: rgba(255,77,94,0.13) !important; color: var(--red) !important; }
.cmodal-danger:hover { background: rgba(255,77,94,0.22) !important; }
.btn-mini.disabled { opacity: 0.4; pointer-events: none; }

/* ============================ NETWORK INTELLIGENCE ============================ */
.b-proxy { color: var(--accent-2); background: rgba(33, 184, 255, 0.10); }
.card-value.danger { color: var(--red); }
.stat-num.amber { color: var(--amber); }

.net-link { color: var(--accent-2); text-decoration: none; border-bottom: 1px dashed rgba(33,184,255,0.4); }
.net-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.net-report, .net-browse { max-width: 1000px; margin: 0 auto; }
.net-crumb { font-size: 13px; margin-bottom: 18px; }
.net-crumb a { color: var(--text-dim); text-decoration: none; }
.net-crumb a:hover { color: var(--accent); }

.net-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; margin-bottom: 10px; }
.net-sub { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin: 22px 0 12px; }
.net-examples { display: flex; flex-direction: column; gap: 8px; }
.net-example {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 9px 14px; text-decoration: none; color: var(--text); font-size: 13px;
}
.net-example:hover { border-color: rgba(0,255,163,0.4); background: var(--panel-solid); }

.net-countries { display: flex; flex-direction: column; gap: 10px; }
.net-country {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 11px 14px; font-size: 14px; color: var(--text);
}
.net-flag { font-size: 18px; margin-right: 6px; }

/* Browse landing */
.net-hero { text-align: center; max-width: 720px; margin: 10px auto 36px; }
.net-h1 { font-family: var(--display); font-weight: 700; letter-spacing: 2px; font-size: clamp(30px, 5vw, 46px); color: var(--text-bright); }
.net-lede { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin: 14px auto 26px; max-width: 580px; }
.net-search { max-width: 620px; margin: 0 auto; }

.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.net-card {
  display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 18px 20px; position: relative; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.net-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--lvl), transparent);
}
.net-card:hover { border-color: color-mix(in srgb, var(--lvl) 50%, var(--line)); transform: translateY(-2px); }
.net-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.net-asn { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text-bright); letter-spacing: 1px; }
.net-risk { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 1.5px; color: var(--lvl); }
.net-org { color: var(--text); font-size: 13px; margin: 8px 0 12px; min-height: 34px; }
.net-card-stats { display: flex; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.net-card-stats .amber { color: var(--amber); }

@media (max-width: 820px) { .net-cols { grid-template-columns: 1fr; } }

/* Landing: explore-the-database band */
.mk-explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 56px; }
.mk-explore-card {
  display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); padding: 22px 24px; transition: border-color .15s ease, transform .15s ease;
}
.mk-explore-card:hover { border-color: rgba(0,255,163,0.4); transform: translateY(-2px); }
.mk-explore-card h3 { font-family: var(--display); font-weight: 700; letter-spacing: .5px; font-size: 19px; color: var(--text-bright); margin: 0 0 8px; }
.mk-explore-card p { color: var(--text-dim); font-size: 13.5px; margin: 0; line-height: 1.5; }

/* Email template editor */
.email-preview { width: 100%; height: 540px; border: 1px solid var(--line); border-radius: 10px; background: #0a0e12; display: block; }
.opsform textarea.mono-area { font-family: var(--mono); font-size: 12px; line-height: 1.5; }

/* Audit timeline */
.timeline { position: relative; margin: 6px 0 26px; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: flex; gap: 16px; padding: 4px 0 16px 0; }
.tl-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin: 5px 0 0 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--bg-2); flex-shrink: 0; }
.tl-security .tl-dot { background: var(--red); }
.tl-billing  .tl-dot { background: var(--accent); }
.tl-agent    .tl-dot { background: var(--amber); }
.tl-customer .tl-dot { background: var(--accent-2); }
.tl-body { flex: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 11px 15px; }
.tl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-action { font-size: 12px; color: var(--text-bright); }
.tl-cat { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.tl-time { font-size: 12px; margin-left: auto; }
.tl-summary { font-size: 14px; color: var(--text); margin: 5px 0 4px; }
.tl-meta { font-size: 12px; }

/* Agent permission checklist */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cap-item {
  display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--panel-solid);
}
.cap-item:hover { border-color: rgba(0,255,163,0.35); }
.cap-item input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }

/* Staff "Ops Panel" cross-links from the customer dashboard */
.ops-link { color: var(--accent-2) !important; border-color: rgba(33,184,255,0.4) !important; }
.ops-nav .nav-label { color: var(--accent-2); }
.ops-nav .nav-ico { color: var(--accent-2); }

/* Developer docs */
.dev-doc { max-width: 920px; margin: 0 auto; }
.dev-head { margin-bottom: 24px; }
.dev-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dev-jump a {
  font-size: 12px; letter-spacing: .5px; text-decoration: none; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
}
.dev-jump a:hover { color: var(--accent); border-color: rgba(0,255,163,0.4); }
.dev-steps { list-style: none; counter-reset: step; display: grid; gap: 12px; margin: 4px 0 22px; }
.dev-steps li {
  position: relative; padding: 12px 16px 12px 50px; counter-increment: step;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 14px;
}
.dev-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,255,163,0.12); border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--display); font-weight: 700; font-size: 12px;
}
.code-tabs { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; background: var(--panel-solid); }
.code-tabbar { display: flex; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.code-tab {
  background: none; border: none; border-right: 1px solid var(--line); cursor: pointer;
  color: var(--text-dim); font-family: var(--display); font-weight: 700; letter-spacing: 1px;
  font-size: 12px; padding: 10px 18px;
}
.code-tab:hover { color: var(--text); }
.code-tab.active { color: var(--accent); background: rgba(0,255,163,0.07); }
.code-panel { display: none; margin: 0; padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text); overflow-x: auto; white-space: pre; }
.code-panel.active { display: block; }

/* Country pages */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg-btn {
  text-decoration: none; color: var(--text-dim); font-size: 13px; letter-spacing: .5px;
  padding: 9px 18px; border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.seg-btn.active { color: var(--accent); background: rgba(0,255,163,0.10); }
.country-flag {
  font-size: 64px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(0,0,0,0.4));
}

/* ============================ BULK LOOKUP ============================ */
.bulk-form { margin: 4px 0 22px; }
.bulk-form textarea {
  width: 100%; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.7; resize: vertical;
}
.bulk-form textarea:focus { outline: none; border-color: rgba(0,255,163,0.45); box-shadow: 0 0 0 3px rgba(0,255,163,0.08); }
.bulk-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.bulk-hint { font-size: 12px; }
.bulk-summary { font-size: 13px; color: var(--text-dim); letter-spacing: .5px; }
.bulk-count { font-family: var(--display); font-weight: 700; color: var(--text-bright); font-size: 16px; }
.bulk-net { max-width: 260px; }

.bulk-locked {
  text-align: center; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); padding: 44px 28px; margin-top: 6px;
}
.bulk-lock-ico {
  width: 54px; height: 54px; margin: 0 auto 16px; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,255,163,0.3); border-radius: 14px;
  background: rgba(0,255,163,0.06);
}
.bulk-lock-ico svg { width: 28px; height: 28px; }

@keyframes bulk-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bulk-reveal { animation: bulk-rise .45s ease both; }
.bulk-reveal .ops-table tbody tr { animation: bulk-rise .4s ease both; }
.bulk-reveal .ops-table tbody tr:nth-child(1) { animation-delay: .02s; }
.bulk-reveal .ops-table tbody tr:nth-child(2) { animation-delay: .05s; }
.bulk-reveal .ops-table tbody tr:nth-child(3) { animation-delay: .08s; }
.bulk-reveal .ops-table tbody tr:nth-child(4) { animation-delay: .11s; }
.bulk-reveal .ops-table tbody tr:nth-child(5) { animation-delay: .14s; }
.bulk-reveal .ops-table tbody tr:nth-child(6) { animation-delay: .17s; }
.bulk-reveal .ops-table tbody tr:nth-child(7) { animation-delay: .20s; }
.bulk-reveal .ops-table tbody tr:nth-child(8) { animation-delay: .23s; }
@media (prefers-reduced-motion: reduce) { .bulk-reveal, .bulk-reveal .ops-table tbody tr { animation: none; } }

/* ============================ AUTH / NAV ============================ */
.header-right { display: flex; align-items: center; gap: 18px; }
.auth-nav { display: flex; align-items: center; gap: 14px; }
.auth-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 13px; letter-spacing: 1px;
}
.auth-nav a:hover { color: var(--accent); }
.auth-nav .signup-link {
  color: var(--accent); border: 1px solid rgba(0, 255, 163, 0.4);
  padding: 6px 14px; border-radius: 6px;
}
.auth-nav .signup-link:hover { background: rgba(0, 255, 163, 0.1); }
.logout-form { display: inline; margin: 0; }
.logout-form button {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px; padding: 0;
}
.logout-form button:hover { color: var(--red); }

.auth-wrap { display: flex; justify-content: center; padding: 30px 0; }
.auth-card {
  width: 100%; max-width: 420px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel);
  padding: 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.auth-title {
  font-family: var(--display); font-weight: 700; letter-spacing: 1px;
  font-size: 24px; color: var(--text-bright); margin-bottom: 6px;
}
.auth-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 22px; }
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}
.form-row input {
  width: 100%; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; color: var(--text);
  font-family: var(--mono); font-size: 14px;
}
.form-row input:focus { outline: 1px solid var(--accent); }
.field-err { color: var(--red); font-size: 12px; margin-top: 5px; }
/* Live password-validation states (auth-password.js) */
.pw-feedback:not(:empty) { margin-top: 5px; }
.form-row input.is-invalid { border-color: var(--red); }
.form-row input.is-invalid:focus { outline-color: var(--red); }
.form-row input.is-valid { border-color: var(--accent); }
.btn-full {
  width: 100%; font-family: var(--display); font-weight: 700; letter-spacing: 2px;
  border: 1px solid var(--accent); border-radius: 8px;
  background: rgba(0, 255, 163, 0.12); color: var(--accent);
  padding: 13px; cursor: pointer; margin-top: 6px;
}
.btn-full:hover { background: rgba(0, 255, 163, 0.2); }
.auth-alt { text-align: center; margin-top: 18px; color: var(--text-dim); font-size: 13px; }
.auth-alt a, .auth-link { color: var(--accent-2); text-decoration: none; }
.auth-alt a:hover, .auth-link:hover { text-decoration: underline; }

.plan-limits { display: flex; gap: 8px; flex-wrap: wrap; }
.msgs { margin-bottom: 18px; }

/* ticket thread */
.thread { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; background: var(--panel); }
.msg.staff { border-color: rgba(0, 255, 163, 0.35); background: rgba(0, 255, 163, 0.05); }
.msg.customer { border-color: rgba(33, 184, 255, 0.3); background: rgba(33, 184, 255, 0.04); }
.msg-head { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.msg-body { color: var(--text); font-size: 14px; line-height: 1.55; }
.apikey { font-family: var(--mono); color: var(--accent); font-size: 13px; word-break: break-all; }
.btn-mini {
  display: inline-block; text-decoration: none; line-height: 1.2; vertical-align: middle;
  font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: 11px;
  padding: 3px 9px; margin-left: 6px; border: 1px solid var(--line);
  background: none; color: var(--text-dim); border-radius: 5px; cursor: pointer;
}
.btn-mini:hover { color: var(--accent); border-color: var(--accent); }

.keyreveal {
  border: 1px solid rgba(0, 255, 163, 0.4); background: rgba(0, 255, 163, 0.06);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 26px;
}
.key-value { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.key-value code { font-family: var(--mono); color: var(--accent); font-size: 14px; word-break: break-all; }
.newkey-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

/* ============================ DASHBOARD SHELL ============================ */
.dash-body { display: block; }
.dash-layout {
  display: grid; grid-template-columns: 248px 1fr; min-height: 100vh;
  transition: grid-template-columns .18s ease;
}
body.sidebar-collapsed .dash-layout { grid-template-columns: 70px 1fr; }

.dash-sidebar {
  background: #07090f; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.dash-brand { padding: 18px 16px; border-bottom: 1px solid var(--line); }
.dash-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.dash-brand-link .brand-mark { color: var(--accent); }
.dash-brand-link .brand-text {
  font-family: var(--display); font-weight: 800; letter-spacing: 0.04em;
  font-size: 17px; color: var(--text-bright); white-space: nowrap;
}
.dash-brand-link .brand-text .accent { color: var(--accent); letter-spacing: inherit; }
/* Wordmark must stay legible even when the OS forces a white/high-contrast
   background — never let the near-white letters disappear on white. */
@media (forced-colors: active) {
  .brand-name, .dash-brand-link .brand-text { color: CanvasText; }
  .brand-name .accent, .dash-brand-link .brand-text .accent { color: LinkText; }
}
.dash-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-section {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; color: var(--text-dim); text-decoration: none;
  font-size: 13px; letter-spacing: 0.4px; white-space: nowrap; cursor: pointer;
}
.nav-item:hover { background: rgba(0,255,163,0.06); color: var(--text); }
.nav-item.active { background: rgba(0,255,163,0.10); color: var(--accent); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { display: flex; width: 20px; height: 20px; flex-shrink: 0; color: var(--text-dim); }
.dash-sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .dash-sidebar-foot { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
body.sidebar-collapsed .dash-brand { text-align: center; padding: 18px 0; }

.dash-main { display: flex; flex-direction: column; min-width: 0; }
.dash-topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 26px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
  background: rgba(5,8,14,0.85); backdrop-filter: blur(8px);
}
.sidebar-toggle {
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 8px; padding: 7px; cursor: pointer; display: flex;
}
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }
.dash-title { font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: 20px; color: var(--text-bright); }
.dash-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.dash-content { padding: 26px; width: 100%; max-width: 1240px; }
/* The global reset zeroes <p> margins; restore breathing room in dash content
   (fixes "← Back to …" links sitting flush against the section below). */
.dash-content p { margin-bottom: 16px; }
.dash-content p:last-child { margin-bottom: 0; }
.dash-content section[id] { scroll-margin-top: 80px; }

/* charts */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 30px; }
.chart-card {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 18px 20px;
}
.chart-card h3 {
  font-family: var(--display); font-weight: 600; letter-spacing: 1px;
  font-size: 14px; color: var(--text-bright); margin-bottom: 14px;
}
.chart-holder { position: relative; height: 210px; }

/* access control */
.toggle-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: #1a2230; border: 1px solid var(--line);
  border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 4px; top: 3px;
  background: var(--text-dim); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: rgba(0,255,163,0.2); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(21px); background: var(--accent); }
.ip-note {
  font-size: 13px; color: var(--text-dim); line-height: 1.55;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(255,255,255,0.015); padding: 12px 16px; margin-bottom: 16px;
}

/* compact key/value status row (e.g. Integrations) */
.int-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.int-stat { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 14px 16px; min-width: 0; }
.int-stat-label { font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 9px; }
.int-stat-value { font-size: 15px; font-weight: 600; color: var(--text-bright); display: flex; align-items: center; gap: 8px; min-width: 0; }
.int-acct { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pill.amber-pill { color: var(--amber); border-color: rgba(245,177,75,0.4); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 26px; }
.inline-form input[type=text] {
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-family: var(--mono); font-size: 13px;
}
.btn-sm {
  display: inline-block; text-decoration: none; line-height: 1.2; vertical-align: middle;
  font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: 12px;
  border: 1px solid var(--accent); border-radius: var(--r-sm); background: rgba(0,226,154,0.12);
  color: var(--accent); padding: 9px 14px; cursor: pointer;
}
.btn-sm:hover { background: rgba(0,226,154,0.2); }
.btn-danger { border: 1px solid rgba(255,77,94,0.4); background: none; color: var(--red); border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-size: 12px; }
.btn-danger:hover { background: rgba(255,77,94,0.12); }

/* buttons never wrap their label; standalone action rows lay out in a flex row */
.btn, .btn-sm, .btn-mini, .btn-danger, .btn-full, .btn-primary, .btn-ghost, .price-cta, .copy-btn { white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ============================ TABLE TOOLBAR ============================ */
.table-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar-search { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-search input[type="text"], .toolbar-search select {
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-family: var(--mono); font-size: 13px;
}
.toolbar-search input[type="text"] { min-width: 220px; }
.toolbar-search input:focus, .toolbar-search select:focus { outline: 1px solid var(--accent); }
.toolbar-search .muted-val { font-size: 12px; }
.toolbar-action { margin-left: auto; }

/* ============================ OPS FORMS ============================ */
.opsform { max-width: 600px; }
.opsform .form-row { margin-bottom: 14px; }
.opsform label {
  display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}
.opsform input[type=text], .opsform input[type=number], .opsform input[type=url],
.opsform input[type=email], .opsform input[type=password],
.opsform select, .opsform textarea {
  width: 100%; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
  font-family: var(--mono); font-size: 13px;
}
.opsform input:focus, .opsform select:focus, .opsform textarea:focus { outline: 1px solid var(--accent); }
.opsform .checkbox-row { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.opsform .checkbox-row label { margin: 0; }
.opsform input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.opsform .form-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.opsform.mail-form { max-width: 760px; }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; border: 1px solid rgba(255,77,79,0.35); border-radius: 12px;
  background: rgba(255,77,79,0.05); padding: 18px 22px; max-width: 760px;
}
.danger-zone-text { max-width: 520px; }
.danger-zone-text strong { color: var(--red); display: block; margin-bottom: 4px; }
.danger-zone-text p { margin: 0; font-size: 13px; line-height: 1.5; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }
/* RadioSelect (delivery mode) renders as a <ul> — lay it out as cards */
.opsform ul#id_mode { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 520px; }
.opsform ul#id_mode li { margin: 0; }
.opsform ul#id_mode label { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); cursor: pointer; }
.opsform ul#id_mode input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ============================ PRICING ============================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 16px; }
.price-card { padding: 26px 20px; }

/* paid plans: clean 4-up row → 2 → 1 */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plan-grid { grid-template-columns: 1fr; } }

/* free callout banner */
.free-banner {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: center;
  border: 1px solid rgba(0,226,154,0.25); border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(0,226,154,0.07), rgba(56,189,248,0.035));
  padding: 34px 40px; margin-bottom: 36px;
}
.free-banner-eyebrow { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.free-banner-main h2 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.5vw, 34px); letter-spacing: -0.02em; color: var(--text-bright); margin-bottom: 12px; }
.free-banner-sub { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin-bottom: 22px; max-width: 480px; }
.free-banner-perks { list-style: none; display: grid; gap: 11px; }
.free-banner-perks li { font-size: 14px; color: var(--text); padding-left: 26px; position: relative; }
.free-banner-perks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 760px) { .free-banner { grid-template-columns: 1fr; padding: 28px 24px; gap: 22px; } }
.price-card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 28px 24px; display: flex; flex-direction: column;
}
.price-card.featured { border-color: rgba(0,226,154,0.45); box-shadow: 0 16px 44px rgba(0,0,0,0.4); }
.price-badge {
  align-self: flex-start; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(0,255,163,0.4); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 12px;
}
.price-name { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; font-size: 18px; color: var(--text-bright); }
.price-amount { font-family: var(--display); font-weight: 800; font-size: 40px; color: var(--text-bright); letter-spacing: -0.02em; margin: 10px 0 2px; }
.price-amount .per { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.price-quota { font-size: 12px; color: var(--text-dim); margin-bottom: 18px; }
.price-features { list-style: none; display: grid; gap: 9px; margin-bottom: 22px; flex: 1; }
.price-features li { font-size: 13px; color: var(--text); padding-left: 22px; position: relative; }
.price-features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.price-cta {
  text-align: center; text-decoration: none; font-family: var(--display); font-weight: 700;
  letter-spacing: 1px; border-radius: 8px; padding: 12px; border: 1px solid var(--accent);
  color: var(--accent); background: rgba(0,255,163,0.1);
}
.price-cta:hover { background: rgba(0,255,163,0.2); }
.price-card.featured .price-cta { background: var(--accent); color: #04120c; }

/* pricing: comparison table + FAQ */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 56px; background: var(--panel); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.cmp-table th, .cmp-table td { padding: 14px 18px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; color: var(--text-dim); }
.cmp-table thead th { color: var(--text-bright); font-weight: 600; border-bottom: 1px solid var(--line); }
.cmp-table tbody td { color: var(--text); }
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table td.yes { color: var(--accent); }

.faq { max-width: 740px; margin: 0 auto 48px; display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; color: var(--text-bright); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; flex-shrink: 0; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--text-dim); padding: 0 0 16px; line-height: 1.65; font-size: 14px; margin: 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 70px 1fr; }
  .brand-text, .nav-label, .nav-section, .dash-sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
}
@media (max-width: 760px) { .ops-cols { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .brand-tag { display: none; }
  .card.span-2 { grid-column: span 1; }
  .site-header, .site-footer { padding: 14px 18px; }
  .dossier-head { gap: 18px; padding: 18px; }
}

/* ============================ MARKETING / LANDING ============================ */
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; letter-spacing: 0; }
.main-nav a:hover { color: var(--text-bright); }
.nav-cluster { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: var(--r-sm); padding: 6px; cursor: pointer; align-items: center;
}
.nav-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* --- header role zones: public nav | divider | account actions --- */
.nav-sep { width: 1px; height: 24px; background: var(--line); flex: none; }
/* Dashboard = primary client action (accent pill) */
.auth-nav .nav-dash {
  display: inline-flex; align-items: center; gap: 7px; letter-spacing: 0.3px;
  color: var(--accent); border: 1px solid rgba(0,255,163,0.35);
  background: rgba(0,255,163,0.07); padding: 7px 14px; border-radius: 8px;
}
.auth-nav .nav-dash:hover { background: rgba(0,255,163,0.15); color: var(--accent); }
/* Ops = staff/admin (amber accent — deliberately different from client green) */
.auth-nav .nav-ops {
  display: inline-flex; align-items: center; gap: 7px; letter-spacing: 0.3px;
  color: var(--amber); border: 1px solid rgba(245,177,75,0.4);
  background: rgba(245,177,75,0.08); padding: 7px 12px; border-radius: 8px;
}
.auth-nav .nav-ops:hover { background: rgba(245,177,75,0.16); color: var(--amber); }
.nav-dash svg, .nav-ops svg, .nav-logout svg { width: 15px; height: 15px; flex: none; }
/* Identity + session: avatar anchors the zone, logout is a quiet utility */
.account-cluster { display: inline-flex; align-items: center; gap: 10px; }
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--panel-solid); border: 1px solid var(--line);
  color: var(--text-bright); font-family: var(--display); font-weight: 700; font-size: 12px;
}
.auth-nav .nav-logout {
  display: inline-flex; align-items: center; gap: 7px; background: none;
  border: 1px solid transparent; color: var(--text-dim); cursor: pointer;
  padding: 6px 8px; border-radius: 7px;
}
.auth-nav .nav-logout:hover { color: var(--red); background: rgba(255,77,94,0.08); }
.nav-logout-label { display: none; }   /* icon-only on desktop, labelled on mobile */

/* ===================== ACCOUNT MENU (avatar dropdown) ===================== */
.acct-menu { position: relative; display: inline-flex; }
button.user-avatar { cursor: pointer; padding: 0; }
button.user-avatar:hover { border-color: var(--accent); color: var(--accent); }
button.user-avatar[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.acct-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; min-width: 232px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.5); padding: 6px; animation: acct-in 0.14s ease;
}
.acct-dropdown[hidden] { display: none; }
@keyframes acct-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .acct-dropdown { animation: none; } }
.acct-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.acct-head-av {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-bright);
}
.acct-head-av img { width: 100%; height: 100%; object-fit: cover; }
.acct-head-id { min-width: 0; }
.acct-name { font-size: 13px; color: var(--text-bright); font-weight: 600; word-break: break-word; line-height: 1.3; }
.acct-email { font-size: 12px; color: var(--text-dim); word-break: break-all; margin-top: 1px; }
.acct-role { font-size: 10px; color: var(--accent-2); letter-spacing: 0.6px; text-transform: uppercase; margin-top: 3px; font-weight: 600; }
.acct-item-staff svg { color: var(--accent-2); }
.acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; letter-spacing: 0.2px;
  color: var(--text); text-decoration: none; background: none; border: none;
  cursor: pointer; text-align: left; font-family: inherit;
}
.acct-item:hover { background: rgba(255,255,255,0.05); color: var(--text-bright); }
.acct-item svg { width: 15px; height: 15px; flex: none; color: var(--text-dim); }
.acct-logout-form { margin: 0; }
.acct-logout { color: var(--red); border-top: 1px solid var(--line-soft); border-radius: 0; margin-top: 4px; padding-top: 11px; }
.acct-logout svg { color: var(--red); }
.acct-logout:hover { background: rgba(255,77,94,0.08); color: var(--red); }

.mk-hero { text-align: center; padding: 26px 0 34px; }
.mk-eyebrow { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.mk-h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 6vw, 56px); line-height: 1.06; letter-spacing: -0.025em; color: var(--text-bright); margin-bottom: 18px; }
.mk-h1 .accent { color: var(--accent); }
.mk-sub { font-size: clamp(16px, 2vw, 19px); color: var(--text-dim); max-width: 660px; margin: 0 auto 26px; line-height: 1.6; }
.mk-lookup { max-width: 560px; margin: 0 auto 14px; }
.mk-hero-meta { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }
.mk-hero-meta a { color: var(--accent-2); text-decoration: none; }
.mk-sep { margin: 0 8px; opacity: 0.5; }
.red-t { color: var(--red); }

.mk-cta-row { display: flex; gap: 14px; justify-content: center; }
.btn-primary { font-family: var(--display); font-weight: 600; letter-spacing: 0; text-decoration: none; background: var(--accent); color: #04130d; padding: 12px 24px; border-radius: var(--r-sm); display: inline-block; transition: filter .15s ease, transform .15s ease; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { font-family: var(--display); font-weight: 600; letter-spacing: 0; text-decoration: none; color: var(--text-bright); border: 1px solid var(--line); padding: 11px 24px; border-radius: var(--r-sm); display: inline-block; background: rgba(255,255,255,0.02); transition: background .15s ease, border-color .15s ease; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: rgba(150,170,195,0.3); }

.mk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 56px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.mk-stats > div { text-align: center; }
.mk-stat-num { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--text-bright); }
.mk-stat-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }

.mk-section-title { font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: clamp(22px, 3vw, 30px); color: var(--text-bright); text-align: center; margin: 0 0 28px; }

.mk-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.mk-feature { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 24px; transition: border-color .2s, transform .2s; }
.mk-feature:hover { border-color: rgba(0, 255, 163, 0.4); transform: translateY(-3px); }
.mk-ico { display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: rgba(0, 255, 163, 0.1); color: var(--accent); margin-bottom: 14px; }
.mk-ico svg { width: 20px; height: 20px; }
.mk-feature h3 { font-family: var(--display); font-weight: 600; letter-spacing: 0.5px; font-size: 17px; color: var(--text-bright); margin-bottom: 8px; }
.mk-feature p { font-size: 13.5px; color: var(--text); line-height: 1.55; }
.mk-feature code { color: var(--accent); font-size: 12px; }

.mk-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.mk-step { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 24px; }
.mk-step-n { font-family: var(--display); font-weight: 700; font-size: 20px; color: #04120c; background: var(--accent); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.mk-step h3 { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--text-bright); margin-bottom: 6px; }
.mk-step p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.mk-api { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: center; margin-bottom: 56px; }
.mk-code { margin: 0; }

.mk-usecases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 56px; }
.mk-usecase { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 20px; border-top: 2px solid var(--accent); }
.mk-usecase h3 { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--text-bright); margin-bottom: 8px; }
.mk-usecase p { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.mk-prose { max-width: 760px; margin: 0 auto 56px; }
.mk-prose p { font-size: 14.5px; color: var(--text); line-height: 1.7; margin-bottom: 14px; }

.mk-final-cta { text-align: center; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 48px 24px; margin-top: 30px; }
.mk-final-cta h2 { font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: clamp(24px, 4vw, 34px); color: var(--text-bright); margin-bottom: 10px; }
.mk-final-cta p { color: var(--text-dim); margin-bottom: 24px; }

@media (max-width: 880px) {
  .site-header { position: relative; }
  .nav-toggle { display: inline-flex; }
  .nav-cluster {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); padding: 6px 0;
  }
  body.nav-open .nav-cluster { display: flex; }
  .nav-cluster .main-nav { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-cluster .main-nav a { padding: 13px 22px; font-size: 15px; }
  .nav-cluster .main-nav a:hover { background: rgba(255,255,255,0.03); }
  .nav-cluster .auth-nav {
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 12px 22px 10px; border-top: 1px solid var(--line); margin-top: 4px;
  }
  .nav-cluster .auth-nav a, .nav-cluster .logout-form, .nav-cluster .logout-form button { display: block; padding: 6px 0; text-align: left; }
  .nav-cluster .signup-link { text-align: center; padding: 10px; }
  /* header role zones on mobile: drop the divider, group identity inline, label logout */
  .nav-sep { display: none; }
  .nav-cluster .nav-dash, .nav-cluster .nav-ops { justify-content: center; margin: 4px 0; }
  .nav-cluster .account-cluster { display: flex; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
  .nav-cluster .nav-logout { padding: 6px 0; }
  .nav-logout-label { display: inline; }
  .mk-features, .mk-steps { grid-template-columns: 1fr 1fr; }
  .mk-stats, .mk-usecases { grid-template-columns: 1fr 1fr; }
  .mk-api { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .mk-features, .mk-steps, .mk-stats, .mk-usecases { grid-template-columns: 1fr; }
  .mk-cta-row { flex-direction: column; align-items: center; }
}

/* ============================ DOSSIER MAP ============================ */
.geo-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 30px; align-items: stretch; }
.geo-row.no-map { grid-template-columns: 1fr; }
.ip-map { height: 300px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0a0e16; }
.ip-map .leaflet-container { background: #0a0e16; height: 100%; font-family: var(--mono); }
.geo-details { display: flex; flex-direction: column; gap: 14px; }
.geo-details .card { flex: 1; }
.map-pin span { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #04120c; box-shadow: 0 0 0 4px rgba(0, 255, 163, 0.25), 0 0 14px var(--accent); }
.leaflet-control-zoom a { background: var(--panel-solid) !important; color: var(--accent) !important; border-color: var(--line) !important; }
@media (max-width: 760px) { .geo-row { grid-template-columns: 1fr; } .ip-map { height: 240px; } }

/* ============================ DOSSIER REVEAL (cyber) ============================ */
@keyframes mk-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mk-scan { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
@keyframes mk-blink { 50% { opacity: 0; } }

.dossier > * { opacity: 0; animation: mk-reveal .5s cubic-bezier(.2,.7,.2,1) forwards; }
.dossier > *:nth-child(1) { animation-delay: .00s; }
.dossier > *:nth-child(2) { animation-delay: .10s; }
.dossier > *:nth-child(3) { animation-delay: .18s; }
.dossier > *:nth-child(4) { animation-delay: .26s; }
.dossier > *:nth-child(5) { animation-delay: .34s; }
.dossier > *:nth-child(6) { animation-delay: .42s; }
.dossier > *:nth-child(7) { animation-delay: .50s; }
.dossier > *:nth-child(8) { animation-delay: .58s; }
.dossier > *:nth-child(9) { animation-delay: .66s; }
.dossier > *:nth-child(n+10) { animation-delay: .74s; }

/* one-time scan sweep across the score header */
.dossier-head { position: relative; overflow: hidden; }
.dossier-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(0,255,163,0.14) 50%, transparent 70%);
  transform: translateX(-110%); animation: mk-scan 1.1s ease .25s 1;
}
.score-num { font-variant-numeric: tabular-nums; }

/* analysis status line */
.scan-status {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.scan-status .caret { width: 8px; height: 13px; background: var(--accent); display: inline-block; animation: mk-blink 1s steps(1) infinite; }
.scan-status .muted-val { color: var(--text-dim); letter-spacing: 1px; }

/* example chips on the empty state */
.try-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.try-chips a {
  font-family: var(--mono); font-size: 12px; color: var(--accent-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; transition: all .2s;
}
.try-chips a:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,255,163,0.06); }

@media (prefers-reduced-motion: reduce) {
  .dossier > * { opacity: 1 !important; animation: none !important; }
  .dossier-head::after { display: none; }
}

/* --- Legal pages (Terms / Privacy) --------------------------------------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 56px;
  color: var(--text);
  line-height: 1.7;
}
.legal-head { margin: 8px 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.legal-head h1 { margin: 0 0 6px; font-size: 30px; color: var(--text-bright); }
.legal-meta { margin: 0; color: var(--text-dim); font-size: 13px; }
.legal h2 {
  margin: 30px 0 10px;
  font-size: 18px;
  color: var(--text-bright);
  scroll-margin-top: 80px;
}
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin: 0 0 8px; }
.legal a { color: var(--accent-2); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal-foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 14px;
}

.auth-fineprint {
  margin: 12px 2px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
}
.auth-fineprint a { color: var(--accent-2); text-decoration: none; }
.auth-fineprint a:hover { text-decoration: underline; }

/* --- Unverified-email banner (dashboard) --------------------------------- */
.verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 176, 0, 0.38);
  background: rgba(255, 176, 0, 0.08);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
}
.verify-banner-ico { color: #ffb000; flex: 0 0 auto; display: inline-flex; }
.verify-banner-txt { flex: 1 1 auto; }
.verify-banner-txt strong { color: var(--text-bright); margin-right: 4px; }
.verify-banner-act { margin: 0; flex: 0 0 auto; }
@media (max-width: 560px) {
  .verify-banner { flex-wrap: wrap; }
  .verify-banner-act { width: 100%; }
  .verify-banner-act .btn-sm { width: 100%; }
}

/* --- In-dashboard plans page (price-cta variants) ------------------------ */
.price-cta.as-btn {
  width: 100%;
  cursor: pointer;
  font-size: inherit;
  font-family: var(--display);
}
.price-cta.is-current {
  border-color: var(--line);
  color: var(--text-dim);
  background: transparent;
  cursor: default;
}
.price-card.featured .price-cta.is-current {
  background: transparent;
  color: var(--accent);
  border-color: rgba(0,226,154,0.45);
}
/* Free hero (dashboard): the CTA is a natural-width button on the left, not the
   full-width card button — keep it from competing with the paid upgrade CTAs. */
.free-banner .price-cta { display: inline-block; width: auto; align-self: flex-start; }
.free-banner-main form { display: inline-block; margin: 0; }
.free-banner.is-current-plan { border-color: rgba(0,226,154,0.5); background: linear-gradient(135deg, rgba(0,226,154,0.10), rgba(56,189,248,0.05)); }
/* De-emphasised action (Downgrade to Free): muted outline, never accent-bright. */
.price-cta.ghost { border-color: var(--line); color: var(--text-dim); background: transparent; }
.price-cta.ghost:hover { border-color: var(--line-soft); color: var(--text-bright); background: rgba(150,170,195,0.06); }
.plan-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 13px;
}

/* --- Overview: quota bar, plan card, quick-start, topbar --------------- */
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.card-plan-limits {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 11px 0 2px; font-size: 11.5px; color: var(--text-dim);
}
.card-plan-limits span:not(:last-child)::after {
  content: "·"; margin-left: 8px; opacity: 0.5;
}
.quota-bar {
  height: 6px; border-radius: 999px; margin: 12px 0 8px;
  background: rgba(150, 170, 195, 0.12); overflow: hidden;
}
.quota-bar-fill {
  display: block; height: 100%; border-radius: 999px; min-width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.chart-empty-note { text-align: center; color: var(--text-dim); font-size: 13px; margin: 12px 0 2px; }

.code-copy {
  margin-left: auto; align-self: center; margin-right: 8px;
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 5px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 1px; padding: 3px 11px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.code-copy:hover { color: var(--text-bright); border-color: var(--accent-2); }
.code-copy.copied { color: var(--accent); border-color: var(--accent); }
.quickstart-note { margin-top: 11px; font-size: 13px; color: var(--text-dim); }
.quickstart-note .mono { color: var(--text); }

/* Topbar: align external-tool chips with Logout, separated by a divider. */
.dash-topbar-right .card-endpoint { margin-top: 0; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.topbar-sep { width: 1px; height: 22px; background: var(--line); flex: none; }

/* === Unified header pill buttons (landing nav + dashboard topbars) === */
.hpill {
  display: inline-flex; align-items: center; gap: 7px; line-height: 1.2;
  font-size: 13px; letter-spacing: 0.3px; text-decoration: none; cursor: pointer;
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--text-dim); background: var(--panel); white-space: nowrap;
}
.hpill:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.hpill svg { width: 15px; height: 15px; flex: none; }
.hpill-accent { color: var(--accent); border-color: rgba(0,255,163,0.35); background: rgba(0,255,163,0.07); }
.hpill-accent:hover { color: var(--accent); background: rgba(0,255,163,0.15); border-color: rgba(0,255,163,0.5); }
.hpill-admin { color: var(--amber); border-color: rgba(245,177,75,0.4); background: rgba(245,177,75,0.08); }
.hpill-admin:hover { color: var(--amber); background: rgba(245,177,75,0.16); }
/* icon-only logout utility (matches the landing logout) */
.hlogout {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; color: var(--text-dim);
  cursor: pointer; padding: 6px; border-radius: 7px;
}
.hlogout:hover { color: var(--red); background: rgba(255,77,94,0.08); }
.hlogout svg { width: 16px; height: 16px; }
/* topbar wraps gracefully; pills go icon-only on narrow screens */
.dash-topbar { flex-wrap: wrap; }
@media (max-width: 760px) {
  .dash-topbar-right .hpill-label { display: none; }
  .dash-topbar-right .hpill { padding: 7px 9px; }
}

/* --- Ops overview: billing monitor ------------------------------------- */
.ops-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; margin: 0 0 22px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  border: 1px solid var(--line); background: var(--panel);
}
.ops-banner.warn { border-color: rgba(255,176,0,0.38); background: rgba(255,176,0,0.07); }
.ops-banner strong { color: var(--text-bright); }
.ops-banner a { color: var(--accent-2); text-decoration: none; }
.ops-banner a:hover { text-decoration: underline; }

.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.stat.warn::before   { background: linear-gradient(90deg, var(--amber), transparent); }
.stat.danger::before { background: linear-gradient(90deg, var(--red), transparent); }
.stat.cyan::before   { background: linear-gradient(90deg, var(--accent-2), transparent); }
.stat-num.danger { color: var(--red); }

.due-badge {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap;
}
.due-badge.soon    { color: var(--amber); border-color: rgba(255,176,0,0.4); background: rgba(255,176,0,0.06); }
.due-badge.overdue { color: var(--red);   border-color: rgba(255,84,104,0.4); background: rgba(255,84,104,0.06); }

/* ============================ TEAM CHAT ============================ */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #04130d; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
body.sidebar-collapsed .nav-badge { display: none; }

.chat {
  display: flex; gap: 0; height: calc(100vh - 124px); min-height: 460px;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--panel-solid); box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}
/* keep the `hidden` attribute authoritative: several chat elements set
   display:flex, which would otherwise override [hidden]{display:none} and leave
   the reply bar / search panel / thread visible when they should be hidden. */
.chat [hidden] { display: none !important; }

/* --- left: conversation list --- */
.chat-list-pane {
  width: 290px; flex-shrink: 0; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; background: rgba(255,255,255,0.022);
}
.chat-list-head { padding: 13px; border-bottom: 1px solid var(--line); }
.chat-search, .chat-text-input {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-solid); color: var(--text-bright); font-size: 13px; font-family: inherit;
}
.chat-search:focus, .chat-text-input:focus { outline: none; border-color: rgba(0,226,154,0.5); }
.chat-list-section { display: flex; flex-direction: column; min-height: 0; }
.chat-list-section:first-of-type { flex: 0 0 auto; }
/* divider + breathing room between the Channels / Direct messages groups */
.chat-list-section + .chat-list-section { border-top: 1px solid var(--line-soft); }
.chat-list-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 8px; font-size: 10.5px; letter-spacing: 1.6px;
  text-transform: uppercase; font-weight: 600; color: var(--text-dim);
}
.chat-add {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--text-dim); cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.chat-add:hover { color: var(--accent); border-color: rgba(0,226,154,0.4); }
.chat-list { overflow-y: auto; padding: 4px 8px 10px; }
.chat-list-empty { padding: 10px 14px; font-size: 12px; color: var(--text-dim); }
.chat-label-actions { display: flex; align-items: center; gap: 4px; }

/* sidebar sections */
.chat-sec { margin-bottom: 2px; }
.chat-sec-head { display: flex; align-items: center; }
.chat-sec-toggle {
  flex: 1; display: flex; align-items: center; gap: 6px; border: none; background: transparent;
  color: var(--text-dim); cursor: pointer; padding: 6px 8px; border-radius: 7px; text-align: left;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
}
.chat-sec-toggle:hover { color: var(--text); }
.chat-sec-caret { font-size: 9px; transition: transform .12s ease; }
.chat-sec-caret.collapsed { transform: rotate(-90deg); }
.chat-sec-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sec-count { color: var(--text-dim); font-weight: 500; }
.chat-sec-menu {
  flex-shrink: 0; border: none; background: transparent; color: var(--text-dim); cursor: pointer;
  font-size: 15px; padding: 2px 6px; border-radius: 6px; opacity: 0; transition: opacity .12s ease;
}
.chat-sec-head:hover .chat-sec-menu { opacity: 1; }
.chat-sec-menu:hover { background: rgba(255,255,255,0.08); color: var(--text-bright); }
.chat-sec-body { padding-left: 4px; }
.chat-sec-input { padding: 4px 6px; }
.chat-sec-input input {
  width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(0,226,154,0.5);
  background: var(--panel-solid); color: var(--text-bright); font-size: 13px; font-family: inherit;
}
.chat-sec-input input:focus { outline: none; }

/* row move handle (channels) */
.chat-row-menu {
  flex-shrink: 0; border: none; background: transparent; color: var(--text-dim); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 6px; opacity: 0; transition: opacity .12s ease;
}
.chat-row:hover .chat-row-menu { opacity: 1; }
.chat-row-menu:hover { background: rgba(255,255,255,0.1); color: var(--text-bright); }

/* shared little popup menu (move-to-section, section options) */
.chat-popup {
  position: fixed; z-index: 4100; min-width: 200px; max-width: 230px; padding: 5px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.55);
}
.chat-popup-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); padding: 6px 9px 4px; }
.chat-popup-item {
  width: 100%; text-align: left; border: none; background: transparent; color: var(--text-bright);
  font-size: 13px; padding: 8px 9px; border-radius: 7px; cursor: pointer;
}
.chat-popup-item:hover { background: rgba(255,255,255,0.06); }
.chat-popup-item.danger { color: var(--red); }
.chat-popup-item.danger:hover { background: rgba(255,84,104,0.1); }

.chat-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: none; background: transparent; border-radius: 9px; cursor: pointer; text-align: left;
  color: var(--text); transition: background .12s ease;
}
.chat-row:hover { background: rgba(255,255,255,0.04); }
.chat-row.active { background: rgba(0,255,163,0.08); }
.chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-row-title { font-size: 13.5px; font-weight: 600; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent);
  color: #04130d; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.chat-avatar {
  position: relative; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0,226,154,0.18), rgba(56,189,248,0.14));
  color: var(--text-bright); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
/* channels read as a hash tile (rounded square), DMs as round avatars */
.chat-avatar.is-channel {
  border-radius: 9px; background: rgba(0,226,154,0.10); color: var(--accent);
  font-size: 17px; font-weight: 700;
}
.chat-row .chat-avatar.is-channel { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.chat-row.active .chat-avatar.is-channel { background: rgba(0,226,154,0.14); color: var(--accent); }
/* uploaded avatar photo — fills any round/rounded avatar container */
.chat-avatar-img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.chat-msg-avatar[data-profile], .chat-head-icon[data-profile] { cursor: pointer; }
.chat-head-icon.has-img { background: transparent; overflow: hidden; }
/* profile card popover */
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 18px; text-align: center; min-width: 200px; }
.profile-av { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; background: rgba(255,255,255,0.06); color: var(--text-bright); margin-bottom: 4px; }
.profile-name { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--text-bright); }
.profile-email { font-size: 12.5px; color: var(--text-dim); }
.profile-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.profile-status .chat-presence-dot { position: static; }
.profile-card .btn-sm { margin-top: 10px; }
/* ============================ ACCOUNT SETTINGS ============================ */
/* Unified identity / profile header card */
.acct-hero {
  position: relative; display: flex; align-items: center; gap: 20px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 20px 22px; margin-bottom: 22px;
}
.acct-hero-av { margin: 0; position: relative; }
.avatar-drop { position: relative; display: block; width: 76px; height: 76px; border-radius: 50%; cursor: pointer; outline: none; }
.avatar-drop:focus-visible { box-shadow: 0 0 0 3px rgba(0,226,154,0.35); }
.avatar-drop.is-drag { box-shadow: 0 0 0 3px var(--accent); }
.avatar-img {
  width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, rgba(0,226,154,0.2), rgba(56,189,248,0.15)); color: var(--text-bright);
}
.avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel-solid); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s;
}
.avatar-cam svg { width: 14px; height: 14px; }
.avatar-drop:hover .avatar-cam { color: var(--accent); border-color: var(--accent); }
.avatar-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.avatar-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.acct-hero-info { flex: 1; min-width: 0; }
.acct-hero-name { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text-bright); }
.acct-hero-email { font-size: 13px; color: var(--text-dim); margin-top: 2px; word-break: break-all; }
.acct-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.acct-chip {
  font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
  color: var(--text-dim); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px;
}
.acct-chip.is-ok { color: var(--accent); border-color: rgba(0,226,154,0.4); }
.acct-chip.is-warn { color: #ffb000; border-color: rgba(255,176,0,0.4); }
.acct-hero-since { font-size: 12px; color: var(--text-dim); }
.acct-hero-remove { position: absolute; top: 14px; right: 16px; margin: 0; }
@media (max-width: 560px) {
  .acct-hero { flex-direction: column; text-align: center; }
  .acct-hero-meta { justify-content: center; }
  .acct-hero-remove { position: static; margin-top: 8px; }
}

/* Tabbed sections */
.set-tabs {
  display: none; gap: 4px; border-bottom: 1px solid var(--line);
  margin-bottom: 22px; flex-wrap: wrap;
}
.set-tabs-wrap.tabs-ready .set-tabs { display: flex; }
.set-tab {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-dim); cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.3px;
  padding: 10px 14px; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
}
.set-tab svg { width: 15px; height: 15px; }
.set-tab:hover { color: var(--text); }
.set-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.set-tabs-wrap.tabs-ready .set-panel:not(.is-active) { display: none; }

/* Settings cards */
.set-card {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 20px 22px; margin-bottom: 16px; max-width: 760px;
}
.set-card-head { margin-bottom: 16px; }
.set-card-title { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--text-bright); margin: 0; }
.set-card-title.is-danger { color: var(--red); }
.set-card-sub { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 6px 0 0; max-width: 600px; }
.set-card-danger { border-color: rgba(255,77,79,0.35); background: rgba(255,77,79,0.05); }
.set-form { max-width: none; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; line-height: 1.5; }
.label-opt { text-transform: none; letter-spacing: 0; font-size: 10px; font-weight: 400; color: var(--text-dim); opacity: 0.85; margin-left: 5px; }
.pw-rules ul { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 2px; }
.pw-rules li { font-size: 12px; color: var(--text-dim); }
.user-avatar.has-img { padding: 0; overflow: hidden; }
.user-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-presence-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-dim); border: 2px solid var(--panel-solid);
}
.chat-presence-dot.is-online { background: var(--accent); }

/* --- right: thread --- */
.chat-thread-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chat-empty {
  margin: auto; text-align: center; color: var(--text-dim); padding: 40px; max-width: 360px;
}
.chat-empty-ico { color: rgba(0,226,154,0.4); margin-bottom: 8px; }
.chat-empty h2 { font-family: var(--display); color: var(--text-bright); font-size: 20px; margin-bottom: 6px; }
.chat-empty p { font-size: 13.5px; line-height: 1.6; }

.chat-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-thread-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
  background: rgba(255,255,255,0.015);
}
.chat-head-icon {
  width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 17px; font-weight: 700; color: var(--accent); background: rgba(0,226,154,0.10);
}
.chat-head-icon.is-dm { background: transparent; border-radius: 50%; }
.chat-head-icon .chat-presence-dot { position: static; width: 10px; height: 10px; border: none; }
.chat-thread-title { font-family: var(--display); font-weight: 700; font-size: 15.5px; color: var(--text-bright); }
/* metadata pushed right + de-emphasised (a quiet chip / link, not a headline) */
.chat-head-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chat-meta-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.chat-meta-chip svg { width: 13px; height: 13px; }
.chat-meta-dim { font-size: 12px; color: var(--text-dim); }

.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; }
.chat-load-more {
  align-self: center; margin-bottom: 12px; padding: 6px 14px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim); border-radius: 999px;
}
.chat-load-more:hover { color: var(--accent); border-color: rgba(0,226,154,0.4); }

/* Team chat: every message is left-aligned with the sender's avatar + name
   (incl. your own — a small "you" tag distinguishes it). Not a 1:1 messenger. */
.chat-msg { display: flex; gap: 9px; margin-bottom: 14px; max-width: 82%; }
.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.07); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.chat-msg-main { display: flex; flex-direction: column; min-width: 0; }
.chat-msg-author { font-size: 11.5px; color: var(--text-dim); margin-bottom: 3px; padding-left: 2px; }
.chat-msg-you { font-size: 10px; color: var(--accent); background: rgba(0,226,154,0.12); border-radius: 4px; padding: 0 5px; margin-left: 5px; letter-spacing: 0.3px; }
.chat-bubble {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 9px 13px; font-size: 13.5px; color: var(--text); line-height: 1.5; word-wrap: break-word;
}
.chat-bubble-body { white-space: normal; }
.chat-msg-time { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; padding: 0 4px; }

/* system notices (joins/leaves/renames) */
.chat-sys { text-align: center; margin: 10px 0; }
.chat-sys span {
  display: inline-block; font-size: 11.5px; color: var(--text-dim);
  background: rgba(255,255,255,0.04); border-radius: 999px; padding: 4px 12px;
}

/* date separators */
.chat-date-sep { text-align: center; margin: 16px 0 12px; }
.chat-date-sep span {
  font-size: 11px; color: var(--text-dim); background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
}

/* grouped (consecutive same-sender) messages */
.chat-msg { position: relative; }
.chat-msg.grouped { margin-top: -8px; margin-bottom: 4px; }
.chat-msg-avatar.is-spacer { background: transparent; }

/* hover actions on own messages */
.chat-msg-actions {
  position: absolute; top: -12px; display: none; gap: 2px; z-index: 2;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 2px;
}
.chat-msg-actions { right: 0; }
.chat-msg:hover .chat-msg-actions { display: flex; }
.chat-msg-act {
  border: none; background: transparent; cursor: pointer; font-size: 12px;
  padding: 3px 7px; border-radius: 6px; color: var(--text-dim);
}
.chat-msg-act:hover { background: rgba(255,255,255,0.06); color: var(--text-bright); }
.chat-msg-act.ci-armed { color: var(--amber); }

/* edited / deleted */
.chat-edited { color: var(--text-dim); font-size: 10px; }
.chat-bubble-deleted { color: var(--text-dim); font-style: italic; background: transparent; border-style: dashed; }

/* inline edit */
.chat-edit { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.chat-edit-input {
  width: 100%; resize: vertical; min-height: 52px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(0,226,154,0.5); background: var(--panel-solid); color: var(--text-bright);
  font-family: inherit; font-size: 13.5px;
}
.chat-edit-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* @mentions in rendered messages */
.chat-mention { color: var(--accent); background: rgba(0,226,154,0.08); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.chat-mention.is-me { color: var(--amber); background: rgba(255,176,0,0.14); }

/* mention autocomplete popup */
.chat-composer { position: relative; }
.chat-mention-pop {
  position: absolute; left: 16px; bottom: 100%; margin-bottom: 6px; width: 248px;
  max-height: 210px; overflow-y: auto; padding: 4px; z-index: 50;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.chat-mention-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.chat-mention-row.active, .chat-mention-row:hover { background: rgba(0,255,163,0.1); }
.chat-mention-row .chat-avatar { width: 26px; height: 26px; font-size: 10px; }
.chat-mention-name { font-size: 13px; color: var(--text-bright); }

/* reply quote shown above a message */
.chat-reply-quote {
  display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; padding: 4px 10px;
  border-left: 2px solid var(--accent); border-radius: 4px; background: rgba(255,255,255,0.03);
  cursor: pointer; max-width: 100%;
}
.chat-reply-author { font-size: 11px; color: var(--accent); font-weight: 600; }
.chat-reply-snippet { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

/* reactions under a bubble */
.chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chat-react {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel-solid);
  color: var(--text); cursor: pointer;
}
.chat-react span { color: var(--text-dim); font-size: 11px; }
.chat-react:hover { border-color: rgba(0,226,154,0.4); }
.chat-react.mine { border-color: rgba(0,226,154,0.5); background: rgba(0,226,154,0.12); }
.chat-react.mine span { color: var(--text-bright); }

/* reply bar above the composer */
.chat-reply-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 7px 10px;
  border-radius: 8px; background: rgba(0,226,154,0.06); border: 1px solid rgba(0,226,154,0.25);
}
.chat-replybar-txt { flex: 1; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-replybar-txt strong { color: var(--text-bright); }
.chat-replybar-x { border: none; background: transparent; color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-replybar-x:hover { color: var(--text-bright); }

/* emoji palette popup */
.chat-emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.chat-emoji-btn { border: none; background: transparent; font-size: 18px; padding: 5px; border-radius: 7px; cursor: pointer; }
.chat-emoji-btn:hover { background: rgba(255,255,255,0.08); }

/* jump-to-message flash */
.chat-msg-flash .chat-bubble { animation: chatFlash 1.2s ease; }
@keyframes chatFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(0,226,154,0.4); } }

/* rich text in messages */
.chat-bubble a { color: var(--accent); text-decoration: underline; word-break: break-word; }
.chat-code { font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 5px; }
/* fenced ``` code blocks */
.chat-codeblock {
  margin: 6px 0 2px; padding: 10px 12px; border-radius: 8px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--text-bright);
}
.chat-codeblock code { font-family: inherit; background: none; padding: 0; white-space: pre; color: inherit; }
.chat-cb-lang { display: block; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }

/* video huddles (embedded Jitsi) */
.chat-head-btn {
  margin-left: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-solid); color: var(--text-dim); cursor: pointer;
}
.chat-head-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-callcard {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 2px;
  border: 1px solid rgba(0,226,154,0.3); background: rgba(0,226,154,0.06); border-radius: 12px;
}
.chat-callcard-ico { font-size: 18px; line-height: 1; }
.chat-callcard-txt { font-size: 13px; color: var(--text); }
.chat-callcard-join {
  margin-left: auto; border: 1px solid var(--accent); background: rgba(0,226,154,0.14);
  color: var(--accent); font-family: var(--display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.5px; padding: 6px 14px; border-radius: 7px; cursor: pointer;
}
.chat-callcard-join:hover { background: rgba(0,226,154,0.24); }
.chat-call-modal { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: rgba(4,7,12,0.96); }
.chat-call-modal[hidden] { display: none; }
.chat-call-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: var(--panel-solid);
}
.chat-call-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulseDot 1.6s ease infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.chat-call-title { font-family: var(--display); font-weight: 700; color: var(--text-bright); font-size: 14px; }
.chat-call-leave { margin-left: auto; }
.chat-call-frame { flex: 1; min-height: 0; }
.chat-call-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* slash-command popup */
.chat-slash-pop {
  position: absolute; left: 16px; bottom: 100%; margin-bottom: 6px; width: 300px;
  max-height: 240px; overflow-y: auto; padding: 4px; z-index: 50;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.chat-slash-pop[hidden] { display: none; }
.chat-slash-row { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.chat-slash-row.active, .chat-slash-row:hover { background: rgba(0,255,163,0.1); }
.chat-slash-cmd { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.chat-slash-desc { font-size: 11.5px; color: var(--text-dim); }

/* drag-and-drop upload overlay */
.chat-thread { position: relative; }
.chat-drop-hint {
  position: absolute; inset: 8px; z-index: 30; display: none; align-items: center; justify-content: center;
  background: rgba(8,12,18,0.86); border: 2px dashed rgba(0,226,154,0.6); border-radius: var(--r-md); pointer-events: none;
}
.chat-thread.drag-over .chat-drop-hint { display: flex; }
.chat-drop-hint span { font-size: 15px; color: var(--accent); font-weight: 600; }

/* new-messages divider */
.chat-new-sep { text-align: center; margin: 14px 0; position: relative; }
.chat-new-sep::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: rgba(255,84,104,0.3); }
.chat-new-sep span {
  position: relative; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--red); background: var(--panel-solid); padding: 2px 10px; border-radius: 999px;
}

/* jump-to-latest button */
.chat-jump {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 86px; z-index: 20;
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(0,226,154,0.5);
  background: var(--panel-solid); color: var(--accent); font-size: 12px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.chat-jump:hover { background: rgba(0,226,154,0.1); }

/* muted conversation */
.chat-row.muted .chat-row-title, .chat-row.muted .chat-row-sub { opacity: 0.55; }
.chat-row-muted { font-size: 11px; opacity: 0.7; }

/* message search results */
.chat-search-results { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-search-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-bright); font-weight: 600; }
.chat-search-close { border: none; background: transparent; color: var(--text-dim); font-size: 20px; line-height: 1; cursor: pointer; }
.chat-search-close:hover { color: var(--text-bright); }
.chat-search-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-search-item { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px; border: none; background: transparent; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.chat-search-item:hover { background: rgba(255,255,255,0.04); }
.chat-search-meta { font-size: 11.5px; color: var(--text-dim); }
.chat-search-snippet { font-size: 13px; color: var(--text); }

/* notification sound toggle (bell panel) */
.notif-head-actions { display: flex; align-items: center; gap: 8px; }
.notif-sound { border: none; background: transparent; cursor: pointer; font-size: 14px; padding: 2px 5px; border-radius: 6px; opacity: 0.7; }
.notif-sound.on { opacity: 1; }
.notif-sound:hover { background: rgba(255,255,255,0.06); }

.chat-bubble-atts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.chat-att-img img { max-width: 240px; max-height: 220px; border-radius: 8px; display: block; }
.chat-att-file {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-solid); text-decoration: none; color: var(--text);
}
.chat-att-file:hover { border-color: rgba(0,226,154,0.4); }
.chat-att-ext {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent);
  border: 1px solid rgba(0,226,154,0.35); border-radius: 5px; padding: 4px 6px; min-width: 34px; text-align: center;
}
.chat-att-meta { display: flex; flex-direction: column; min-width: 0; }
.chat-att-name { font-size: 12.5px; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chat-att-size { font-size: 11px; color: var(--text-dim); }

.chat-typing { padding: 0 18px 6px; font-size: 12px; color: var(--text-dim); font-style: italic; min-height: 18px; }

/* one cohesive input pill: [paperclip] [textarea] [send] in a single container */
.chat-composer { padding: 12px 16px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.chat-composer-box {
  display: flex; align-items: flex-end; gap: 4px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel-solid);
  padding: 4px 5px; transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-composer-box:focus-within { border-color: rgba(0,226,154,0.5); box-shadow: 0 0 0 3px rgba(0,226,154,0.08); }
.chat-attach, .chat-send {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; cursor: pointer; border: none;
  display: flex; align-items: center; justify-content: center; background: transparent;
}
.chat-attach { color: var(--text-dim); }
.chat-attach:hover { color: var(--accent); background: rgba(0,226,154,0.08); }
.chat-send { background: var(--accent); color: #04130d; }
.chat-send:hover { filter: brightness(1.08); }
.chat-send:disabled { opacity: 0.45; cursor: default; filter: none; }
.chat-input {
  flex: 1; resize: none; max-height: 140px; min-height: 22px; padding: 7px 6px;
  border: none; background: transparent; color: var(--text-bright);
  font-family: inherit; font-size: 13.5px; line-height: 1.45;
}
.chat-input:focus { outline: none; }
.chat-attach-tray { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-tray-chip {
  font-size: 11.5px; color: var(--text-dim); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-solid);
}

/* --- modals (reuse .cmodal-overlay/.cmodal) --- */
.chat-field { margin-bottom: 14px; text-align: left; }
.chat-field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.chat-member-picker {
  max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: 9px; padding: 5px;
}
.chat-check {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-bright);
}
.chat-check:hover { background: rgba(255,255,255,0.05); }
.chat-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; flex-shrink: 0; margin: 0;
  border: 1.5px solid var(--line); border-radius: 5px; background: var(--panel-solid);
  cursor: pointer; position: relative; transition: border-color .12s ease, background .12s ease;
}
.chat-check input[type="checkbox"]:hover { border-color: rgba(0,226,154,0.5); }
.chat-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.chat-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px;
  border: solid #04130d; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.chat-check .chat-avatar { width: 28px; height: 28px; font-size: 11px; }
.chat-check span { flex: 1; }

/* public / private visibility chooser */
.chat-vis { display: flex; flex-direction: column; gap: 8px; }
.chat-vis-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; transition: border-color .12s ease, background .12s ease;
}
.chat-vis-opt:hover { border-color: rgba(0,226,154,0.4); }
.chat-vis-opt input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.chat-vis-opt span { display: flex; flex-direction: column; gap: 1px; }
.chat-vis-opt strong { font-size: 13px; color: var(--text-bright); font-weight: 600; }
.chat-vis-opt small { font-size: 11.5px; color: var(--text-dim); }
.chat-vis-opt:has(input:checked) { border-color: rgba(0,226,154,0.55); background: rgba(0,226,154,0.05); }

/* private-channel tile tint (lock) */
.chat-avatar.is-channel.is-private { background: rgba(255,176,0,0.10); }
.chat-head-icon.is-private { background: rgba(255,176,0,0.12); }
.chat-member-list { max-height: 300px; overflow-y: auto; margin-top: 10px; }
.chat-member-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: none;
  background: transparent; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text);
}
.chat-member-row:hover { background: rgba(255,255,255,0.05); }

/* channel details modal */
.cmodal-wide { max-width: 460px; width: 92vw; }
.ci-members-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ci-members-head label { margin-bottom: 0; }
#ci-add-picker { margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
#ci-add-picker .btn-mini { margin-top: 6px; }
.ci-member { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.ci-member-name { flex: 1; font-size: 13px; color: var(--text-bright); display: flex; align-items: center; gap: 8px; }
.ci-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.ci-remove { border: none; background: transparent; color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 6px; }
.ci-remove:hover { color: var(--red); background: rgba(255,84,104,0.08); }
.ci-actions { display: flex; align-items: center; gap: 8px; }
.ci-spacer { flex: 1; }
.ci-armed { border-color: var(--amber) !important; color: var(--amber) !important; }

/* back button (mobile only) */
.chat-back { display: none; border: none; background: transparent; color: var(--text-dim); cursor: pointer; padding: 2px; margin-right: 2px; border-radius: 7px; align-items: center; justify-content: center; }
.chat-back:hover { color: var(--text-bright); background: rgba(255,255,255,0.06); }

/* account health banners (quota / payment / cancellation) */
.acct-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; border-radius: var(--r-md); margin-bottom: 18px; border: 1px solid var(--line);
}
.acct-banner-txt { flex: 1; font-size: 13.5px; color: var(--text); min-width: 200px; }
.acct-banner-txt strong { color: var(--text-bright); }
.acct-banner.is-warn { border-color: rgba(255,176,0,0.4); background: rgba(255,176,0,0.07); }
.acct-banner.is-danger { border-color: rgba(255,84,104,0.4); background: rgba(255,84,104,0.07); }
.card-warn { border-color: rgba(255,176,0,0.45); background: rgba(255,176,0,0.05); }

/* onboarding checklist (overview) */
.onboard { border: 1px solid rgba(0,226,154,0.25); border-radius: var(--r-md); background: linear-gradient(135deg, rgba(0,226,154,0.06), rgba(56,189,248,0.03)); padding: 18px 22px; margin-bottom: 26px; }
.onboard-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.onboard-head strong { font-family: var(--display); font-size: 16px; color: var(--text-bright); }
.onboard-head span { font-size: 13px; color: var(--text-dim); }
.onboard-steps { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.onboard-steps li { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--text); }
.onboard-steps li.done { color: var(--text-dim); }
.onboard-check { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--text-dim); }
.onboard-steps li.done .onboard-check { background: var(--accent); color: #04130d; border-color: var(--accent); }

/* API console */
.api-console { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-solid); overflow: hidden; margin-bottom: 30px; }
.api-console-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.api-method { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent); border: 1px solid rgba(0,226,154,0.4); border-radius: 5px; padding: 3px 7px; }
.api-method-post { color: var(--amber); border-color: rgba(255,176,0,0.4); }
.api-url { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.api-ip { font-family: var(--mono); font-size: 12.5px; width: 130px; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text-bright); }
.api-ip:focus { outline: none; border-color: rgba(0,226,154,0.5); }
.api-console-bar .btn-sm { margin-left: auto; }
.api-curl { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.api-curl pre { font-family: var(--mono); font-size: 12px; color: var(--text-dim); white-space: pre-wrap; word-break: break-all; margin: 0; }
.api-curl .code-copy { position: absolute; top: 8px; right: 10px; }
.api-resp { padding: 12px 14px; }
.api-resp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-family: var(--mono); font-size: 12px; }
.api-ok { color: var(--accent); }
.api-err { color: var(--red); }
.api-resp pre { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* connection / privacy signal chips (lookup dossier) */
.conn-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.conn-flag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim); background: transparent;
}
.conn-flag.on { color: var(--red); border-color: rgba(255,84,104,0.45); background: rgba(255,84,104,0.08); }

/* customer usage analytics */
.usage-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; align-items: start; }
@media (max-width: 760px) { .usage-split { grid-template-columns: 1fr; } }
.chart-holder-sm { height: 240px; }
.usage-type { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.usage-type-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-solid); }
.usage-type-row span { color: var(--text-dim); font-size: 13px; }
.usage-type-row strong { font-family: var(--display); font-size: 20px; color: var(--text-bright); }

/* keyboard focus rings */
.chat-row:focus-visible, .chat-msg-act:focus-visible, .chat-react:focus-visible,
.chat-add:focus-visible, .chat-sec-toggle:focus-visible, .chat-row-menu:focus-visible,
.chat-send:focus-visible, .chat-attach:focus-visible, .chat-back:focus-visible,
.notif-bell-btn:focus-visible, .chat-member-row:focus-visible, .chat-search:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

@media (max-width: 760px) {
  .chat { height: calc(100vh - 96px); }
  /* one pane at a time: list, or the open thread */
  .chat-list-pane { width: 100%; max-width: none; border-right: none; }
  .chat-thread-pane { display: none; }
  .chat.show-thread .chat-list-pane { display: none; }
  .chat.show-thread .chat-thread-pane { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-msg { max-width: 90%; }
  .notif-panel { width: min(320px, 92vw); }
  .smip-toasts { left: 12px; right: 12px; max-width: none; }
}

/* --- app-wide notification toasts (DMs / @mentions) --- */
.smip-toasts {
  position: fixed; top: 16px; right: 16px; z-index: 4000;
  display: flex; flex-direction: column; gap: 10px; max-width: 330px; pointer-events: none;
}
.smip-toast {
  pointer-events: auto; position: relative; padding: 12px 34px 12px 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px;
  background: var(--panel-solid); box-shadow: 0 14px 36px rgba(0,0,0,0.5);
  opacity: 0; transform: translateX(18px); transition: opacity .2s ease, transform .2s ease;
}
.smip-toast.show { opacity: 1; transform: none; }
.smip-toast.clickable { cursor: pointer; }
.smip-toast.clickable:hover { border-color: rgba(0,226,154,0.45); }
.smip-toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-bright); }
.smip-toast-body { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; word-wrap: break-word; }
.smip-toast-close {
  position: absolute; top: 5px; right: 8px; border: none; background: transparent;
  color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 5px;
}
.smip-toast-close:hover { color: var(--text-bright); }
@media (max-width: 520px) { .smip-toasts { left: 12px; right: 12px; max-width: none; } }

/* --- notification center (bell dropdown) --- */
.notif-bell { position: relative; }
.notif-bell-btn { position: relative; padding: 8px; }
.notif-bell-btn svg { width: 18px; height: 18px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 60vh; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.5); z-index: 200;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid);
}
.notif-head span { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.notif-readall { border: none; background: transparent; color: var(--accent); font-size: 11.5px; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { padding: 6px; }
.notif-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: var(--text-dim); }
.notif-item {
  width: 100%; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  border: none; background: transparent; border-radius: 8px; padding: 9px 10px;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(0,226,154,0.06); }
.notif-item.unread .notif-item-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: middle;
}
.notif-item-title { font-size: 13px; color: var(--text-bright); }
.notif-item-snippet { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== API DOCS (developers v2) ===================== */
/* Wide 3-column reference: sticky section nav | prose | code, breaking out of
   the 1080px container (no transform, so the sticky nav behaves). */
.api-docs {
  width: min(1340px, 95vw);
  margin-left: calc((100% - min(1340px, 95vw)) / 2);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* --- left rail --- */
.api-nav { position: sticky; top: 16px; align-self: start; font-size: 13px; }
.api-nav-group + .api-nav-group { margin-top: 18px; }
.api-nav-title {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 7px; padding-left: 12px;
}
.api-nav-link, .api-nav-ext {
  display: block; color: var(--text-dim); text-decoration: none;
  padding: 5px 12px; line-height: 1.45; border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0; transition: color .15s, border-color .15s, background .15s;
}
.api-nav-link:hover, .api-nav-ext:hover { color: var(--text); }
.api-nav-link.is-active {
  color: var(--text-bright); border-left-color: var(--accent);
  background: rgba(0, 226, 154, 0.06);
}
.api-nav-ext { color: var(--accent-2); }

.api-main { min-width: 0; }

/* --- hero --- */
.api-hero { padding-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.api-hero h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.01em;
  font-size: clamp(28px, 4vw, 40px); color: var(--text-bright);
}
.api-hero .accent { color: var(--accent); }
.api-lede { color: var(--text-dim); font-size: 15px; line-height: 1.65; max-width: 640px; margin: 12px 0 18px; }
.api-facts { display: flex; flex-wrap: wrap; gap: 12px 30px; }
.api-fact { display: flex; flex-direction: column; gap: 2px; }
.api-fact-k { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.api-fact-v { font-family: var(--mono); font-size: 13px; color: var(--text-bright); }

/* --- section + endpoint split --- */
.api-section { scroll-margin-top: 18px; padding: 30px 0; border-bottom: 1px solid var(--line-soft); }
.api-section:last-child { border-bottom: none; }
.api-h2 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em;
  font-size: 20px; color: var(--text-bright); margin-bottom: 6px;
}
.api-sub { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-bottom: 18px; max-width: 640px; }
.api-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 30px; align-items: start; }
.api-prose, .api-code-col { min-width: 0; }

.api-steps { list-style: none; counter-reset: s; display: grid; gap: 11px; margin: 4px 0 0; }
.api-steps li { position: relative; counter-increment: s; padding-left: 30px; color: var(--text); font-size: 13.5px; line-height: 1.55; }
.api-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--text-dim); font-size: 11px; font-family: var(--mono);
  display: grid; place-items: center;
}
.api-steps strong { color: var(--text-bright); font-weight: 600; }

/* method line + params */
.api-method { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.api-verb {
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 6px; border: 1px solid currentColor;
}
.api-verb.get { color: #6fd3a6; background: rgba(0, 226, 154, 0.07); }
.api-verb.post { color: #7fb4f0; background: rgba(56, 189, 248, 0.07); }
.api-path { color: var(--text-bright); word-break: break-all; }
.api-path .var { color: var(--amber); }
.api-params { display: grid; gap: 0; margin-top: 8px; }
.api-param { display: grid; grid-template-columns: auto auto auto; gap: 0 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.api-param:last-child { border-bottom: none; }
.api-param-name { font-family: var(--mono); font-size: 13px; color: var(--text-bright); }
.api-param-type { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.api-param-req { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--amber); }
.api-param-desc { grid-column: 1 / -1; color: var(--text-dim); font-size: 12.5px; margin-top: 3px; line-height: 1.5; }

/* --- editor (code + JSON) --- */
.editor { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-solid); overflow: hidden; margin-bottom: 16px; }
.editor:last-child { margin-bottom: 0; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
.editor-dots { display: inline-flex; gap: 6px; }
.editor-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.editor-title { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 7px; }
.editor-title .ok { color: #6fd3a6; }
.editor-title .api-verb { font-size: 10px; padding: 2px 7px; }
.editor-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.editor-btn {
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  border-radius: 6px; padding: 3px 9px; font-size: 11px; cursor: pointer;
  font-family: var(--mono); line-height: 1; transition: color .15s, border-color .15s, background .15s;
}
.editor-btn:hover { color: var(--text-bright); border-color: var(--line); background: rgba(255, 255, 255, 0.03); }

/* language tabs — subtle active state (shade + border, no loud accent) */
.editor-tabs { display: inline-flex; gap: 2px; }
.editor-tabs .code-tab {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-dim); font-family: var(--display); font-weight: 600;
  font-size: 11.5px; letter-spacing: 0.3px; padding: 4px 11px; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.editor-tabs .code-tab:hover { color: var(--text); background: transparent; }
.editor-tabs .code-tab.active {
  color: var(--text-bright); background: rgba(255, 255, 255, 0.05); border-color: var(--line);
}

/* body: optional line-number gutter + code */
.editor-main { min-width: 0; }
.editor-main.has-gutter { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.editor.is-folded .editor-main { display: none; }
.editor-gutter {
  margin: 0; user-select: none; text-align: right;
  padding: 12px 10px 12px 14px; border-right: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  color: var(--text-dim); opacity: 0.4; white-space: pre;
}
.editor-code {
  margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.65; color: var(--text); white-space: pre; overflow-x: auto;
}
/* tabbed request panels live in a plain (non-grid) editor-main */
.editor-main .code-panel { display: none; }
.editor-main .code-panel.active { display: block; }

/* JSON syntax tints (monochrome-friendly) */
.j-k { color: #9fb4cc; }   /* keys */
.j-s { color: #8de8c4; }   /* strings */
.j-n { color: #f5b14b; }   /* numbers */
.j-b { color: #c08cff; }   /* bool / null */
.j-p { color: var(--text-dim); }  /* punctuation */

/* ultra-thin, low-contrast scrollbar that blends in */
.editor-code, .code-panel, .json-body {
  scrollbar-width: thin; scrollbar-color: rgba(150, 170, 195, 0.25) transparent;
}
.editor-code::-webkit-scrollbar, .code-panel::-webkit-scrollbar,
.json-body::-webkit-scrollbar { width: 8px; height: 8px; }
.editor-code::-webkit-scrollbar-thumb, .code-panel::-webkit-scrollbar-thumb,
.json-body::-webkit-scrollbar-thumb {
  background: rgba(150, 170, 195, 0.18); border-radius: 8px;
}
.editor-code::-webkit-scrollbar-thumb:hover { background: rgba(150, 170, 195, 0.32); }
.editor-code::-webkit-scrollbar-track { background: transparent; }

/* --- clean reference tables (dividers, no heavy grid) --- */
.api-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.api-table th {
  text-align: left; font-weight: 500; font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim); padding: 0 16px 10px;
  border-bottom: 1px solid var(--line);
}
.api-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); vertical-align: top; line-height: 1.5; }
.api-table tr:last-child td { border-bottom: none; }
.api-table td.mono, .api-table td .mono { font-family: var(--mono); color: var(--text-bright); font-size: 12.5px; }
.api-table .num, .api-table th.num { text-align: right; }
.api-table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-bright); white-space: nowrap; }
.api-unit { color: var(--text-dim); font-size: 11px; margin-left: 4px; }

/* desaturated verdict tags */
.tag {
  display: inline-block; font-family: var(--display); font-weight: 700;
  font-size: 10px; letter-spacing: 1px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--text-dim); background: rgba(255, 255, 255, 0.03);
}
.tag-allow { color: #7fbfa3; border-color: rgba(0, 226, 154, 0.25); }
.tag-review { color: #c9a86a; border-color: rgba(245, 177, 75, 0.25); }
.tag-block { color: #cf8a93; border-color: rgba(255, 84, 104, 0.28); }

/* responsive collapse */
@media (max-width: 1024px) {
  .api-docs { width: 100%; margin-left: 0; grid-template-columns: 1fr; gap: 0; }
  .api-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
  .api-nav-group { margin: 0; display: contents; }
  .api-nav-title { display: none; }
  .api-nav-link, .api-nav-ext { border-left: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
  .api-nav-link.is-active { border-color: var(--accent); background: rgba(0, 226, 154, 0.06); }
  .api-split { grid-template-columns: 1fr; gap: 18px; }
}


/* ===================== COMPACT TACTICAL DOSSIER (lookup) ===================== */
/* Dense single-screen dashboard: breaks out wide, metadata in a grid so the
   page fits a desktop without scrolling. */
.dossier.lkx {
  width: min(1340px, 95vw);
  margin-left: calc((100% - min(1340px, 95vw)) / 2);
  display: flex; flex-direction: column; gap: 12px;
}
.lkx-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lkx-search { flex: 1; min-width: 240px; max-width: 560px; }
.lkx-statusline { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; white-space: nowrap; }

/* threat strip */
.lkx-strip {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.3fr) auto;
  align-items: center; gap: 26px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); padding: 14px 22px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.lkx-threat { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.lkx-threat-top { display: flex; align-items: baseline; gap: 12px; }
.lkx-score { font-family: var(--mono); font-weight: 700; font-size: 34px; line-height: 1; color: var(--lvl); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.lkx-max { font-size: 14px; color: var(--text-dim); letter-spacing: 0; }
.lkx-leveltag { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 2px; color: var(--lvl); padding: 3px 9px; border: 1px solid currentColor; border-radius: 4px; }

/* segmented LED bar */
.lkx-led {
  --val: 0; position: relative; height: 20px; border-radius: 3px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(140,160,180,0.10) 0 11px, transparent 11px 15px);
}
.lkx-led::before {
  content: ""; position: absolute; inset: 0; width: calc(var(--val) * 1%);
  background: repeating-linear-gradient(90deg, var(--lvl) 0 11px, transparent 11px 15px);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--lvl) 55%, transparent));
}

/* ip + verdict */
.lkx-ip { min-width: 0; border-left: 1px solid var(--line); padding-left: 24px; }
.lkx-ip-row { display: flex; align-items: center; gap: 12px; }
.lkx-ip-val { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); color: var(--text-bright); word-break: break-all; }
.lkx-ip-meta { margin-top: 7px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lkx-vrd { display: flex; align-items: center; gap: 14px; border-left: 1px solid var(--line); padding-left: 24px; }
.lkx-vrd .verdict-badge { font-size: 15px; padding: 5px 13px; }
.lkx-vrd-meta { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-dim); }
.lkx-vrd-meta strong { color: var(--text-bright); font-size: 13px; }
.lkx-fraud { white-space: nowrap; }

/* metadata grid */
.lkx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.lkx-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 13px 15px; min-width: 0; }
.lkx-card-h { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text); margin-bottom: 10px; }
.lkx-card-h svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.lkx-card-h--sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--text-dim); }
.lkx-card-h--sub svg { color: var(--amber); }
.lkx-rows { margin: 0; display: flex; flex-direction: column; }
.lkx-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.lkx-row:last-child { border-bottom: none; }
.lkx-row dt { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.lkx-row dd { margin: 0; font-size: 12.5px; color: var(--text-bright); word-break: break-word; line-height: 1.4; }
.lkx-row .conn-flags { gap: 5px; }
.ok-tag { color: var(--accent); font-size: 12px; }
.lkx-reasons { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.lkx-reasons li { position: relative; padding-left: 15px; font-size: 12px; color: var(--text); line-height: 1.45; }
.lkx-reasons li::before { content: "\203A"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }

/* lazy map */
.lkx-map-btn { margin-top: 12px; width: 100%; font-family: var(--mono); font-size: 12px; letter-spacing: .5px; color: var(--text-dim); background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px; cursor: pointer; transition: color .15s, border-color .15s; }
.lkx-map-btn:hover:not(:disabled) { color: var(--accent); border-color: rgba(0, 226, 154, 0.4); }
.lkx-map.ip-map { height: 150px; margin-top: 12px; }

/* request telemetry strip */
.lkx-tel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.lkx-tel-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 8px 11px; text-decoration: none; position: relative; transition: border-color .15s; }
.lkx-tel-cell:hover { border-color: rgba(33, 184, 255, 0.4); }
.lkx-tel-wide { grid-column: span 2; }
.lkx-tel-k { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.lkx-tel-v { font-size: 12px; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lkx-node { position: absolute; top: 7px; right: 9px; font-family: var(--mono); font-size: 9.5px; color: var(--accent-2); }

/* slim API terminal footer */
.lkx-term { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-solid); overflow: hidden; }
.lkx-term > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .3px; color: var(--text-dim); }
.lkx-term > summary::-webkit-details-marker { display: none; }
.lkx-term .lkx-prompt { color: var(--accent); display: inline-block; transition: transform .15s; }
.lkx-term[open] .lkx-prompt { transform: rotate(90deg); }
.lkx-term .verb { color: var(--accent); font-weight: 700; }
.lkx-term-open { margin-left: auto; color: var(--accent-2); text-decoration: none; font-size: 11px; }
.lkx-term .json-body { border-top: 1px solid var(--line); max-height: 300px; margin: 0; }

/* fraud-risk band pill */
.fraud-band { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 1px; padding: 2px 8px; border-radius: 5px; border: 1px solid currentColor; }
.fraud-minimal, .fraud-low { color: var(--accent); }
.fraud-medium { color: var(--amber); }
.fraud-high, .fraud-critical { color: var(--red); }

/* responsive */
@media (max-width: 1024px) {
  .dossier.lkx { width: 100%; margin-left: 0; }
  .lkx-strip { grid-template-columns: 1fr; gap: 16px; }
  .lkx-ip, .lkx-vrd { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .lkx-grid { grid-template-columns: 1fr; }
  .lkx-tel { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .lkx-tel { grid-template-columns: 1fr; } .lkx-tel-wide { grid-column: span 1; } }
