:root {
    --sidebar-width: 240px;
    --bg: #0e1016;
    --surface: #161922;
    --surface-2: #1c202b;
    --border: #272d3a;
    --text: #e6e8ec;
    --text-muted: #969fb0;
    --accent: #6366f1;
    --accent-hover: #7c83f6;
    --accent-soft: rgba(99, 102, 241, 0.16);
    --danger: #f87171;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ---------- App shell + fixed sidebar ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #0a0c11;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.875rem;
}

.sidebar-brand {
    display: block;
    padding: 0.35rem 0.4rem 0.85rem;
}
/* The ALARM wordmark (same logo as the page watermark) sits in the sidebar. Its PNG
   is a wide mark centered in a black square; object-fit: cover on a wide-short box
   crops away the black padding to just the wordmark band, and mix-blend-mode:
   lighten drops the remaining black field against the near-black sidebar. */
.sidebar-logo {
    display: block;
    width: 100%;
    height: 3.6rem;
    object-fit: cover;
    object-position: center 47%;
    mix-blend-mode: lighten;
}

.sidebar-balance {
    display: block;
    margin: 0 0.5rem 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm, 8px);
    background: rgba(56, 189, 248, 0.12);
    color: #9aa4b4;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.sidebar-balance strong { color: #38bdf8; font-size: 0.95rem; }
.sidebar-balance:hover { background: rgba(56, 189, 248, 0.2); }

.lang-switcher {
    margin: 0 0.5rem 1rem;
    padding: 0.35rem 0.5rem;
    width: calc(100% - 1rem);
    background: var(--surface-2, #1a1f28);
    color: #cbd5e1;
    border: 1px solid var(--border-color, #2a303c);
    border-radius: var(--radius-sm, 8px);
    font-size: 0.85rem;
    cursor: pointer;
}
.auth-topbar { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.auth-topbar .lang-switcher { width: auto; margin: 0; }
.auth-disclaimer {
    margin: -0.25rem 0 0.25rem;
    padding: 0.6rem 0.75rem;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: var(--radius-sm, 8px);
    color: #eab308;
    font-size: 0.82rem;
    line-height: 1.35;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav a {
    color: #9aa4b4;
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }

/* Section labels that group related nav links together (e.g. "Lookup Tools",
   "Checks", "Databases", "Account"). Purely visual — not links, not collapsible. */
.sidebar-group-title {
    margin: 0.6rem 0 0.05rem;
    padding: 0 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #565f70;
}
.sidebar-nav > .sidebar-group-title:first-child { margin-top: 0; }

/* Standalone top-level items (SMS Integrations, Referrals, API Docs) that sit at
   the same visual level as a group title but are still clickable links. */
.sidebar-nav a.sidebar-group-title-link {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #b8c0ce;
}
.sidebar-nav a.sidebar-group-title-link.active { color: #fff; }

.sidebar-foot {
    flex-shrink: 0;
    padding-top: 0.875rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    font-size: 0.78rem;
    color: #6f7788;
    padding: 0 0.5rem 0.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-logout button {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: transparent;
    color: #b8c0ce;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
}
.sidebar-logout button:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.content { flex: 1; min-width: 0; position: relative; }
/* ALARM wordmark watermark behind the app content. The source PNG is a light mark
   on a solid black field, so `mix-blend-mode: lighten` drops the black away against
   the dark theme and only the mark shows; low opacity keeps it subtle. Uses
   position: absolute (NOT fixed) — a fixed element with mix-blend-mode re-composites
   the whole viewport on every scroll frame; absolute scrolls with the content layer
   and is composited once. Non-interactive so it never blocks clicks. */
.content::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100vh;
    background: url("/assets/IMG_5854.PNG") center 42% / min(600px, 62vw) no-repeat;
    mix-blend-mode: lighten;
    opacity: 0.16;
    pointer-events: none;
    z-index: 0;
}
.content-inner { position: relative; z-index: 1; }
/* Let the watermark bleed THROUGH the big content surfaces (cards, sections, stat
   cards, news), not just the gutters: they go translucent so the mark behind
   content-inner shows faintly while text stays readable on the still-dark surface.
   Dense/interactive surfaces (tables, inputs, sidebar) stay solid on purpose. */
.card,
.settings-section,
.stat-card,
.news-card,
.news-article {
    /* Translucent so the watermark bleeds through, but NO backdrop-filter: a blur
       filter re-samples the backdrop for every card on every frame and was the main
       cause of scroll jank. Plain alpha compositing is effectively free. */
    background: rgba(22, 25, 34, 0.72);
}
/* Default a comfortable reading column so forms, cards, news and sparse tables
   don't strand their content across a very wide page. Pages that carry the wide
   12-column reverse-lookup tables opt into extra width via .content-wide (set in
   layout.html) so those tables breathe instead of squishing into a vertical stack. */
.content-inner { max-width: 1120px; margin: 0 auto; padding: 2rem 2.5rem 3rem; }
.content-inner.content-wide { max-width: 1520px; }

h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
h2 { font-size: 1.1rem; font-weight: 650; margin: 2rem 0 0.75rem; }

/* ---------- Auth pages ---------- */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: radial-gradient(1000px 500px at 50% -10%, #1b1f3a 0%, var(--bg) 55%);
}
/* ALARM wordmark reads as branding above the sign-in card. The source PNG is a light
   mark on solid black, so mix-blend-mode: lighten drops the black away and only the
   mark shows over the gradient. */
.auth-body::before {
    content: "";
    position: fixed;
    top: 6%;
    left: 50%;
    width: min(360px, 66vw);
    height: 200px;
    transform: translateX(-50%);
    background: url("/assets/IMG_5854.PNG") center / contain no-repeat;
    mix-blend-mode: lighten;
    opacity: 0.55;
    pointer-events: none;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow);
}
.auth-brand { font-size: 1.3rem; font-weight: 700; text-align: center; letter-spacing: -0.02em; color: #fff; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin: 0.35rem 0 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-form label span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.auth-form input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--surface-2);
    color: var(--text);
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-alt { text-align: center; margin: 1.25rem 0 0; font-size: 0.88rem; color: var(--text-muted); }
.auth-alt a { font-weight: 600; text-decoration: none; }

/* ---------- Buttons ---------- */

.btn-primary,
button.primary,
.content .primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}
.btn-primary:hover,
button.primary:hover,
.content .primary:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: #fff; }
.btn-primary:disabled, button.primary:disabled, .btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }

/* Colour-coded compact action buttons used in result-table cells so each action
   reads by colour at a glance: accent = primary action (Open / run a check),
   danger = destructive (Delete). */
.btn-accent {
    background: var(--accent-soft);
    color: #c7c9ff;
    border: 1px solid rgba(99, 102, 241, 0.45);
    padding: 0.32rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-accent:hover { background: rgba(99, 102, 241, 0.3); color: #fff; border-color: var(--accent); }
.btn-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.32);
    padding: 0.32rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); color: #fff; border-color: rgba(248, 113, 113, 0.55); }
.btn-accent:disabled, .btn-danger:disabled { opacity: 0.55; cursor: not-allowed; }

/* Visible keyboard focus everywhere (mouse clicks stay clean via :focus-visible). */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ---------- Page intro + cards ---------- */

.page-desc { color: var(--text-muted); margin: -0.6rem 0 1.5rem; font-size: 0.92rem; max-width: 68ch; }
/* The results summary reuses .page-desc but sits in a flex bar — don't cap it. */
.lookup-results-bar .page-desc { max-width: none; }

/* ---------- Meta bar: price / balance chips + inline actions ---------- */
/* Replaces the dense "Per check: $X · Balance: $Y · Top up · …" sentences under a
   page title with scannable chips, so the key numbers read at a glance and the
   actions look like the links they are. */
.meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: -0.3rem 0 1.5rem; }
.meta-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; font-size: 0.82rem; color: var(--text-muted);
}
.meta-chip strong { color: var(--text); font-weight: 650; }
.meta-chip.chip-accent { background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.4); color: #c7c9ff; }
.meta-chip.chip-good { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.meta-bar .meta-link {
    font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--accent);
    padding: 0.35rem 0.6rem; border-radius: 999px; border: 1px solid transparent;
}
.meta-bar .meta-link:hover { background: var(--surface-2); border-color: var(--border); color: var(--accent-hover); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.lookup-card { padding: 1.25rem 1.4rem; margin-bottom: 1.5rem; max-width: 780px; }
.lookup-form { display: flex; flex-direction: column; gap: 0.9rem; }
.lookup-actions { display: flex; justify-content: flex-end; }

.results-title { font-size: 1.05rem; font-weight: 650; margin: 1.5rem 0 0.5rem; }
.table-card { overflow-x: auto; margin-top: 0.5rem; border-radius: var(--radius); }
/* Sparse tables (a handful of columns — CS/$$N results, history, active plans)
   shouldn't stretch edge-to-edge on a wide page; cap them to a readable width and
   left-align. The 12-column reverse-lookup tables opt out via .lookup-table. */
.table-card:not(:has(table.lookup-table)) { max-width: 1040px; }
table.data-table:not(.lookup-table) { max-width: 1040px; }
/* SMS page: centered content but wide table like phone-lookup */
.content-wide .table-card,
.content-wide table.data-table { max-width: none; }

.recheck-btn,
.view-all-values-btn,
.view-history-btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}
.recheck-btn:hover,
.view-all-values-btn:hover,
.view-history-btn:hover { border-color: var(--accent); color: #fff; }

/* ---------- Cards / sections ---------- */

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 640px;
    box-shadow: var(--shadow);
}
.settings-form,
.settings-form-inline { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.settings-form label,
.settings-form-inline label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.settings-form input,
.settings-form textarea,
.settings-form select,
.settings-form-inline input,
.settings-form-inline textarea,
.settings-form-inline select {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: var(--surface-2);
    color: var(--text);
}
.settings-form input:focus,
.settings-form textarea:focus,
.settings-form select:focus,
.settings-form-inline input:focus,
.settings-form-inline textarea:focus,
.settings-form-inline select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.api-key-value { display: block; margin-top: 0.4rem; word-break: break-all; font-family: ui-monospace, monospace; }
.api-docs-link { text-decoration: none; font-weight: 600; }

.text-muted { color: var(--text-muted); }

/* ---------- Stats ---------- */

.stats-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 2rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    flex: 1;
    min-width: 150px;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.25rem; }

/* ---------- News ---------- */

.news-list { display: flex; flex-direction: column; gap: 1rem; }
.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}
.news-card-date { color: var(--text-muted); font-size: 0.78rem; }
.news-card-title { margin: 0.3rem 0 0.4rem; font-size: 1.05rem; color: #fff; }
.news-card-summary { color: #c3cad6; margin: 0 0 0.6rem; }
.news-card-read { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.news-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
}
.back-link { display: inline-block; margin-bottom: 1rem; color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 500; }

/* ---------- Tables ---------- */

table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
table.data-table th,
table.data-table td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
table.data-table thead th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
table.data-table tbody tr { transition: background 0.1s; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--surface-2); }
table.data-table tbody td { vertical-align: middle; }
table.data-table tbody td:first-child { font-weight: 500; }
table.data-table td[data-copy] { cursor: pointer; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; }
table.data-table td[data-copy]:hover { color: var(--accent); }
/* In the reverse-lookup table every value cell is copy-on-click, but only the
   query (phone/email) keeps the monospace look — names, addresses and dates read
   better in the normal font. A subtle hover underline hints they're copyable. */
table.lookup-table td[data-copy] { font-family: inherit; font-size: 0.86rem; }
/* The query cell wraps (instead of forcing a wide row) so a long entry never
   stretches the table into a horizontal scroll. */
table.lookup-table td.lookup-query { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; white-space: normal; overflow-wrap: anywhere; min-width: 7rem; }
table.lookup-table td[data-copy]:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* Empty-state cell (colspan "No rows yet.") reads as a calm centered message
   rather than a lonely left-aligned line. */
table.data-table td[colspan] { text-align: center; padding: 2.25rem 1rem; color: var(--text-muted); }

/* Keep each row on a single line so cells never collapse into a vertical stack
   ("съезжают в столбик"). The .table-card wrapper scrolls horizontally only when
   the viewport is genuinely too narrow; on wide screens the table stretches to
   fill the available width (width:100% above). */
table.data-table th,
table.data-table td { white-space: nowrap; }
/* The two genuinely long columns (Full Name, Address) may wrap — with a minimum
   width — so they widen on large screens and wrap gracefully instead of forcing a
   very wide horizontal scroll on smaller ones. Scoped to the lookup tables so the
   nowrap default still applies to every other data-table. */
table.lookup-table td.col-wrap { white-space: normal; min-width: 10rem; }
table.lookup-table td.col-addr { min-width: 13rem; }
/* Tighter cells + compact action buttons keep the 12 columns inside the width so
   the CS and Option columns never get pushed off-screen behind a horizontal scroll. */
table.lookup-table th,
table.lookup-table td { padding: 0.6rem 0.65rem; }
table.data-table .btn-secondary,
table.data-table .btn-accent,
table.data-table .btn-danger { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
/* The Option column stacks its buttons vertically (Open / Copy / Delete) so the
   column stays narrow — no more horizontal scrollbar under the wide table — and
   every action reads as a full, labelled button instead of a cryptic glyph. */
table.lookup-table td.col-actions { white-space: normal; }
.row-actions { display: flex; flex-direction: column; gap: 0.3rem; align-items: stretch; min-width: 4.75rem; }
.row-actions > button { width: 100%; text-align: center; white-space: nowrap; }
/* On mid-width screens drop the low-value submit-time column (still one click away
   in the detail modal) so the actionable Status / CS / Option columns stay visible
   without horizontal scrolling. "Checked" is the 9th column of the lookup table. */
@media (max-width: 1560px) {
    table.lookup-table th:nth-child(9),
    table.lookup-table td:nth-child(9) { display: none; }
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #2a303c;
    color: #b8c0ce;
}
.badge-success { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.badge-fail { background: rgba(248, 113, 113, 0.18); color: #f87171; }
.badge-recheck { background: rgba(250, 204, 21, 0.18); color: #facc15; }
.badge-na { background: #2a303c; color: #9aa4b4; }
.badge-frozen { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.badge-warn { background: rgba(250, 204, 21, 0.18); color: #facc15; }

/* ---------- Alerts ---------- */

.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; }
.alert-error { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }
.alert-success { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); margin-bottom: 1rem; }
/* Neutral, informational notice (feature-in-development banners etc.) — reads as
   calm context on the dark theme, not an error. */
.alert-info { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); margin-bottom: 1rem; }
.alert-info strong { color: var(--text); }

/* ---------- Pagination ---------- */

.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; font-size: 0.88rem; }
.pagination a { color: var(--accent); text-decoration: none; font-weight: 500; }
.pagination .disabled { color: #5b6376; }
.pagination-status { color: var(--text-muted); }

/* ---------- Lookup input ---------- */

textarea.lookup-input {
    width: 100%;
    min-height: 130px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--surface-2);
    color: var(--text);
}
textarea.lookup-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Amount presets (payment) ---------- */

.amount-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.amount-preset-btn {
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}
.amount-preset-btn.selected { border-color: var(--accent); color: #fff; background: var(--accent-soft); font-weight: 600; }

/* ---------- Modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    /* Scale to the viewport: full width on phones, capped on desktop so long
       address / phone values get room instead of wrapping word-by-word. */
    width: min(920px, 94vw);
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
/* Compact modals (e.g. plan purchase confirm) opt back into a narrow width. */
.modal-box.plan-confirm-box { width: min(420px, 94vw); }
.modal-close { float: right; cursor: pointer; border: none; background: none; font-size: 1.25rem; color: var(--text-muted); line-height: 1; }

/* The second modal convention: .modal / .modal-dialog, used by the $$N,
   Driver License and CS Check pages. Those pages toggle the element's inline
   `style.display` directly ("" to open, "none" to close) rather than adding an
   .open class, so this rule deliberately carries NO display:none of its own —
   the markup's inline style is what hides it, and clearing that inline value
   must fall through to the `display: flex` below. Adding display:none here
   would leave those modals permanently invisible. */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); }
.modal-dialog {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: min(560px, 94vw);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1.25rem; }

/* Plan purchase confirmation modal */
.plan-confirm-box { max-width: 420px; }
.plan-confirm-box h3 { margin: 0 0 1rem; }
.plan-confirm-line { margin: 0.35rem 0; font-size: 0.95rem; }
.plan-confirm-line strong { color: var(--text, #e5e7eb); }
.plan-confirm-price strong { color: #38bdf8; font-size: 1.1rem; }
.plan-confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.4rem; }
.plan-confirm-actions .btn-secondary,
.plan-confirm-actions .btn-primary { padding: 0.5rem 1.1rem; }

/* Search-form instructions / hints */
.lookup-hint {
    background: var(--surface-2, #1a1f28);
    border: 1px solid var(--border-color, #2a303c);
    border-radius: var(--radius-sm, 8px);
    padding: 0.65rem 0.9rem;
    margin: 0.25rem 0 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted, #9aa4b4);
    line-height: 1.5;
    max-width: 780px;
}
.lookup-hint code { color: #38bdf8; background: rgba(56, 189, 248, 0.08); padding: 0.05rem 0.3rem; border-radius: 4px; }
.lookup-hint .hint-block {
    margin: 0.45rem 0 0.3rem;
    padding: 0.55rem 0.75rem;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 6px;
    white-space: pre;
    color: #cbd5e1;
    font-size: 0.82rem;
}
.nn-mass-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    user-select: none;
}
.nn-mass-toggle input { width: 1rem; height: 1rem; }

/* ---------- Base search pages ($$N Base / DL Base / EIN Base) ---------- */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem 1rem;
}
.field-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.field-grid input, .field-grid select {
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.9rem;
}
.field-grid input:focus, .field-grid select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.base-loader {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.base-loader.active { display: flex; }
.base-loader .lookup-spinner { width: 1.1em; height: 1.1em; border-width: 3px; }
.base-locked {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    text-align: center;
}
.base-locked p { margin: 0 0 0.9rem; color: var(--text-muted); }

/* Multi-owner CS column: "Check all owners" + a clearly-labelled per-owner list
   (a two-column "Owner N | score" grid — replaces the cryptic "O1:711 O2" strip). */
.cs-owner-list {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.3rem 0.6rem;
    align-items: center;
    padding: 0.4rem 0.55rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.cs-owner-list .co-name { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.cs-owner-list .co-val { justify-self: start; }
.cs-owner-list .badge { font-size: 0.72rem; padding: 0.1rem 0.45rem; }
.cs-owner-list .co-dash { color: var(--text-muted); font-size: 0.8rem; }
/* Clickable "SSN needed" badge: looks like the badge, but reset from the browser's
   default button chrome and marked interactive (pointer + dotted underline). Opens
   the detail modal on that owner with the SSN field focused. */
button.cs-ssn-needed {
    border: none;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
button.cs-ssn-needed:hover { filter: brightness(1.12); text-decoration-style: solid; }
.lookup-del-btn { padding: 0.25rem 0.5rem; }

/* Local run id + submit-time columns in the lookup results table. */
table.data-table td.lookup-id { font-weight: 600; color: var(--text-muted); width: 2.5rem; text-align: right; }
table.data-table td.lookup-when { font-size: 0.8rem; white-space: nowrap; }

/* A query that finished with no owner — muted so it clearly reads as empty. */
table.data-table tbody tr.lookup-row-empty td { color: var(--text-muted); }
table.data-table tbody tr.lookup-row-empty td:first-child { font-weight: 500; color: var(--text); }

/* Owner pagination inside the detail modal (one owner per page). */
.owner-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.4rem 0.6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.owner-pager .btn-secondary { padding: 0.35rem 0.75rem; }
.owner-pager .btn-secondary:disabled { opacity: 0.4; cursor: default; }
.owner-page-label { font-weight: 600; color: var(--text); font-size: 0.9rem; }

/* Address history: reported window on its own line, address below it. */
.addr-history { display: flex; flex-direction: column; gap: 0.6rem; }
.addr-item { display: flex; flex-direction: column; }
.addr-when { font-size: 0.78rem; color: var(--text-muted); }
.addr-line { color: var(--text); }

/* Section headings inside the modal (Address history, Education & Employment). */
h5.modal-section {
    margin: 1.1rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 650;
    color: #fff;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
/* Owner detail fields as a clean two-column "label | value" grid: the label
   column is only as wide as its longest label, the value column takes all the
   remaining width so addresses / phone lists stay on one line as long as the
   modal is wide enough, and wrap gracefully (not mid-word overflow) when not. */
dl.owner-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 1.25rem;
    row-gap: 0.4rem;
    align-items: baseline;
    margin: 0.5rem 0 0;
}
dl.owner-fields dt {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
dl.owner-fields dd {
    margin: 0;
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* On narrow screens the two columns get cramped — stack label above value. */
@media (max-width: 520px) {
    dl.owner-fields {
        grid-template-columns: 1fr;
        row-gap: 0.15rem;
    }
    dl.owner-fields dt { margin-top: 0.5rem; }
    dl.owner-fields dt:first-of-type { margin-top: 0; }
}

/* Per-owner CS / $$N check buttons in the lookup detail modal */
.owner-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.35rem 0 0.7rem; }
/* SMS service searchable combobox */
.sms-combo { position: relative; }
.sms-combo input { width: 100%; }
.sms-combo-list {
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 40;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 0.25rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.sms-combo-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.sms-combo-item:last-child { border-bottom: none; }
.sms-combo-item:hover { background: var(--accent-soft); color: #fff; }
.sms-combo-empty { padding: 0.6rem 0.7rem; color: var(--text-muted); font-size: 0.88rem; }

.owner-ssn-input {
    width: 130px;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.85rem;
}
.owner-ssn-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.owner-checks .owner-check-result { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.owner-check-result .hint-block { flex-basis: 100%; margin: 0.35rem 0 0; max-height: 220px; overflow: auto; }
.modal-box pre {
    background: var(--surface-2);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.8rem;
    color: #c3cad6;
}

/* Reverse-lookup results bar (summary + filter/clear controls). */
.lookup-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.lookup-results-bar .page-desc { margin: 0; }
.lookup-results-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.lookup-results-controls select {
    margin-left: 0.4rem;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
}
.lookup-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    color: var(--accent);
    text-decoration: underline;
}
.lookup-toggle:hover { color: var(--accent-hover); }
.lookup-owner-summary { color: var(--text-muted); margin: 0 0 0.75rem; }
.lookup-owner {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}
.lookup-owner:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.lookup-owner h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }

/* ---------- Plans / subscriptions ---------- */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.plan-card.plan-combo { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.plan-card.plan-popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); position: relative; }
.plan-badge { align-self: flex-start; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; background: var(--accent); color: #fff; padding: 0.2rem 0.6rem; border-radius: 999px; }
.plan-card h3 { margin: 0; font-size: 1.05rem; }
.plan-caps { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.plan-cap { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); padding: 0.15rem 0.45rem; border-radius: 999px; }
.plan-cap.auto { color: #4ade80; border-color: rgba(34,197,94,0.35); }
.plan-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.plan-note { margin: 0; font-size: 0.76rem; color: var(--text-muted); }
.plan-options { display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto; }
.plan-option { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.65rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.plan-option .po-label { color: var(--text-muted); font-size: 0.85rem; }
.plan-option .po-price { font-weight: 600; margin-left: auto; }
.plan-buy { padding: 0.35rem 0.75rem; font-size: 0.82rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.plan-buy:hover { background: var(--accent-hover); }
.plan-buy:disabled { opacity: 0.6; cursor: default; }
.subs-active { margin: 1rem 0; }

/* ---------- SMS page ---------- */
/* The "Count + Rent" row sits on one line; the count input stays compact instead
   of stretching to the full form width. */
.sms-field-row { display: flex; align-items: center; gap: 0.75rem; }
.sms-inline-label { flex-direction: row !important; align-items: center; gap: 0.4rem !important; margin: 0; font-size: 0.85rem; }
.sms-count-input { width: 4.5rem; }
.sms-note { font-size: 0.82rem; margin: 0.2rem 0 0; }
/* Per-provider billing-model explainer under the provider picker. Green = cancellable
   (refunds), amber = buy-outright (no refund) so the distinction is obvious at a glance. */
.sms-provider-info {
    font-size: 0.85rem;
    line-height: 1.45;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 0.1rem 0 0.2rem;
}
.sms-provider-info.sms-info-ok { background: rgba(46, 160, 67, 0.10); border-color: rgba(46, 160, 67, 0.45); }
.sms-provider-info.sms-info-warn { background: rgba(210, 153, 34, 0.12); border-color: rgba(210, 153, 34, 0.5); }
.sms-empty-toggle { cursor: pointer; }
.sms-empty-toggle input { margin: 0; }
/* Rented-numbers header aligns to the (capped) results table below it rather than
   stretching the filter to the far edge of the page. */
.sms-results-head { max-width: 1040px; margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* ---------- CR check page ---------- */
.cr-format { margin-top: 0; }
/* Status text sits to the LEFT of the action button on its own baseline instead of
   colliding with the right-aligned button. */
.cr-actions { justify-content: flex-start; align-items: center; gap: 0.75rem; }
.cr-status { margin: 0; }
.cr-log {
    display: none;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #c3cad6;
}

/* ---------- Streaming lookup progress ---------- */
.lookup-loading { font-size: 0.8rem; animation: lookupPulse 1.1s ease-in-out infinite; }
@keyframes lookupPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

/* Compact inline spinner for still-streaming table rows (replaces the wordy
   "loading more…" note next to the status badge). */
.lookup-spinner {
    display: inline-block;
    width: 0.72em;
    height: 0.72em;
    margin-left: 0.4rem;
    vertical-align: -0.08em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: 0.5;
    animation: lookupSpin 0.7s linear infinite;
}
@keyframes lookupSpin { to { transform: rotate(360deg); } }

/* ---------- Mobile / responsive ---------- */

/* Hamburger + off-canvas drawer are desktop-hidden; they only engage on phones. */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
    /* The sidebar is fixed/off-canvas on phones, so the shell no longer needs to be a
       flex row — block layout guarantees the content is exactly the viewport width
       (a flex row was leaving the content wider than the screen → sideways scroll). */
    html, body { max-width: 100%; overflow-x: hidden; }
    .app-shell { display: block; }
    .content { width: 100%; }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0.6rem;
        left: 0.6rem;
        z-index: 60;
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.15rem;
        line-height: 1;
        color: var(--text);
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        box-shadow: var(--shadow);
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 55;
        width: 250px;
        max-width: 82vw;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 54;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

    /* Content spans full width; leave headroom for the fixed hamburger. */
    .content-inner,
    .content-inner.content-wide { max-width: 100%; padding: 3.4rem 0.9rem 2rem; }
    .content::before { left: 0; opacity: 0.1; }
    h1 { font-size: 1.3rem; margin-bottom: 1rem; }
    h2 { font-size: 1.02rem; }
    .lookup-card, .settings-section { padding: 1rem; max-width: 100%; }
    .lookup-hint { max-width: 100%; }
    .modal-box { padding: 1.1rem; }
    .amount-presets { flex-wrap: wrap; }
    .sms-field-row { flex-wrap: wrap; }
    /* Safety net: clip any stray horizontal overflow so the page never scrolls
       sideways on a phone. */
    .content { overflow-x: hidden; }
    .lookup-results-bar { flex-direction: column; align-items: stretch; }
    .lookup-results-controls { flex-wrap: wrap; }
    .table-card:has(table:not(.lookup-table)) { max-width: 100%; }
}

/* Wide reverse-lookup table → stacked "Label: value" cards (no x-scroll on phones). */
@media (max-width: 700px) {
    .table-card:has(table.lookup-table) { overflow-x: visible; }
    table.lookup-table,
    table.lookup-table tbody,
    table.lookup-table tr,
    table.lookup-table td { display: block; width: auto; }
    table.lookup-table thead { display: none; }
    table.lookup-table { border: none; box-shadow: none; background: none; }
    table.lookup-table tr {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        margin-bottom: 0.75rem;
        padding: 0.45rem 0.85rem;
        box-shadow: var(--shadow);
    }
    table.lookup-table tr.lookup-row-empty { opacity: 0.75; }
    /* Each cell is a block "Label: value" line — value flows after the label and
       wraps naturally, so long names/addresses never force a horizontal scroll. */
    table.lookup-table td {
        border: none !important;
        padding: 0.28rem 0;
        white-space: normal;
        overflow-wrap: anywhere;
        min-width: 0;
    }
    table.lookup-table td::before {
        content: attr(data-label) ": ";
        color: var(--text-muted);
        font-weight: 600;
        margin-right: 0.4rem;
    }
    /* Cells with no label (the action stack) drop the "Label:" prefix and go full width. */
    table.lookup-table td[data-label=""]::before { content: none; }
    table.lookup-table td.col-actions { padding-top: 0.5rem; }
    table.lookup-table td.col-actions .row-actions { width: 100%; min-width: 0; }
    table.lookup-table td.lookup-id { color: var(--text-muted); }
}

@media (max-width: 560px) {
    .stat-card { min-width: 0; }
    .stats-row { gap: 0.6rem; }
    .meta-bar { gap: 0.35rem; }
    .lookup-results-controls { flex-wrap: wrap; }
    .plan-option { flex-wrap: wrap; }
}

/* ---------- Plans cart ---------- */
.plan-add {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: #c7c9ff;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.plan-add:hover { background: rgba(99, 102, 241, 0.28); color: #fff; }

.cart-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 45;
    width: 320px;
    max-width: calc(100vw - 2rem);
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    padding: 0.9rem 1rem;
}
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.cart-head strong { font-size: 0.95rem; }
.cart-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; text-decoration: underline; }
.cart-clear:hover { color: var(--danger); }
.cart-items { display: flex; flex-direction: column; gap: 0.35rem; max-height: 40vh; overflow-y: auto; margin-bottom: 0.6rem; }
.cart-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.cart-item-name { flex: 1; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.cart-item-price { font-weight: 600; color: #38bdf8; }
.cart-item-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0.2rem; }
.cart-item-del:hover { color: var(--danger); }
.cart-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.cart-foot strong { color: #38bdf8; font-size: 1.05rem; }
.cart-modal-items { margin: 0.5rem 0 0.75rem; }

@media (max-width: 700px) {
    .cart-panel { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; width: auto; max-width: none; }
}

/* ---------- SMS provider setup guide ---------- */
.sms-guide-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0;
    margin-left: 0.5rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sms-guide-btn:hover { color: var(--accent-hover); }
.sms-guide-box { width: min(540px, 94vw); }
.sms-guide-body { color: #c3cad6; font-size: 0.9rem; line-height: 1.55; }
.sms-guide-body ol { padding-left: 1.2rem; margin: 0.5rem 0 0; }
.sms-guide-body li { margin: 0.4rem 0; }
.sms-guide-body code { color: #38bdf8; background: rgba(56, 189, 248, 0.1); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
.sms-guide-body a { font-weight: 600; }
.sms-guide-body strong { color: var(--text); }

.sms-tv-fields { display: flex; flex-direction: column; gap: 0.5rem; }
.sms-tv-field-label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.sms-tv-field-label span { margin-bottom: 0.1rem; }
.sms-tv-field-label input { margin: 0; }

.sms-timer { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; color: var(--text); font-weight: 500; }
.sms-ssn { font-size: 0.85rem; padding: 0.25rem 0.4rem; }
.sms-modal-cs { font-size: 0.85rem; padding: 0.35rem 0.7rem; margin-left: 0.5rem; }

/* Compact table buttons on SMS page */
.data-table button.btn-secondary { padding: 0.35rem 0.65rem; font-size: 0.82rem; white-space: nowrap; }
.data-table button.sms-open { background: var(--accent); color: #fff; }
.data-table button.sms-open:hover { background: var(--accent-hover); }

/* ---------- Filter bar (History) ---------- */
.filter-bar { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 1.25rem; flex-wrap: wrap; }
.filter-bar select,
.filter-bar input[type="text"] {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--surface-2);
    color: var(--text);
}
.filter-bar input[type="text"] { flex: 1; min-width: 12rem; max-width: 380px; }
.filter-bar select:focus,
.filter-bar input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.clear-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.clear-link:hover { color: var(--accent); }
@media (max-width: 560px) {
    .filter-bar input[type="text"] { min-width: 0; max-width: none; width: 100%; }
}

/* ---------- API docs page ---------- */
.code-block {
    background: var(--surface-2, #0f1117);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.code-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0 0; }
.code-tab {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}
.code-tab.active { background: var(--surface-2, #0f1117); color: var(--text); font-weight: 600; }
.docs-list { line-height: 1.7; margin: 0.3rem 0 0 1.1rem; }
.docs-list code, .page-desc code, .data-table code { background: var(--surface-2, #0f1117); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }

/* API endpoint blocks */
.api-endpoint-block {
    background: var(--surface-2, #0f1117);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}
.api-endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.api-method {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.api-method-post {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.api-method-get {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.api-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}
.api-desc {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.api-endpoint-block .code-block {
    margin: 0.5rem 0 0;
}
.api-endpoint-block .text-muted {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.api-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
}

/* ---------- Referrals page ---------- */
.referral-link-row { display: flex; gap: 0.5rem; align-items: center; }
.referral-link-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.referral-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1rem 0; }
.referral-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.referral-withdraw { display: flex; gap: 0.5rem; align-items: center; }
.referral-withdraw input { width: 120px; }

/* ---------- Highlighted "Plans" nav item ---------- */
.sidebar-nav a.nav-plans {
    font-weight: 700;
    color: #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.04));
    border: 1px solid rgba(251, 191, 36, 0.35);
    margin: 0.15rem 0;
    letter-spacing: 0.01em;
}
.sidebar-nav a.nav-plans::before { content: "★ "; opacity: 0.9; }
.sidebar-nav a.nav-plans:hover { background: rgba(251, 191, 36, 0.22); color: #fff; }
.sidebar-nav a.nav-plans.active { background: #d97706; color: #fff; border-color: #d97706; }

/* ---------- Reverse paywall modal ---------- */
.modal-box.paywall-box { width: min(440px, 94vw); text-align: center; }
.paywall-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 0.4rem; }
.paywall-title { margin: 0 0 0.6rem; font-size: 1.2rem; }
.paywall-body { margin: 0 0 0.8rem; line-height: 1.55; color: var(--text); }
.paywall-body b { color: #fbbf24; }
.paywall-balance {
    display: inline-block;
    margin: 0 auto 0.7rem;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    background: var(--surface-2, #1c202b);
    border: 1px solid var(--border);
    font-size: 0.95rem;
}
.paywall-cta { margin: 0 0 1.1rem; color: var(--text-muted); font-size: 0.9rem; }
.paywall-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.paywall-actions .paywall-plans { text-decoration: none; padding: 0.6rem 1.3rem; font-weight: 600; }

/* ---------- Browser Check (/browserleak) ---------- */

.bl-free-banner { display: flex; flex-direction: column; gap: 0.35rem; }

.bl-tabs { display: flex; gap: 0.5rem; margin: 1.25rem 0 1rem; flex-wrap: wrap; }
.bl-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
}
.bl-tab.active { color: var(--text); border-color: var(--accent); background: var(--surface-alt, var(--surface)); }

/* The check runs on its own origin (see browserleak.js) — give the embedded
   page real room, it renders a full multi-section report inside. */
.bl-frame-wrap { margin-top: 1rem; }
.bl-frame {
    width: 100%;
    height: 1100px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0e1117;
}

.bl-summary { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.bl-score { font-size: 2rem; font-weight: 700; }
.bl-score-good { color: #35c07a; }
.bl-score-warn { color: #e0a33a; }
.bl-score-bad { color: #e4455f; }
.bl-verdict { color: var(--text-muted); margin-bottom: 0.5rem; }
.bl-findings { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.bl-findings li { margin: 0.2rem 0; }
.bl-f-critical, .bl-f-high { color: #e4455f; }
.bl-f-medium { color: #e0a33a; }
.bl-f-low { color: var(--text-muted); }

.bl-score-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.bl-score-label { color: var(--text-muted); }
.bl-score-scale { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.bl-score-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.bl-score-btn:hover { border-color: var(--accent); }
.bl-score-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.bl-avg { float: right; color: var(--text-muted); font-size: 0.9rem; font-weight: 400; }
.bl-rev-list { display: flex; flex-direction: column; gap: 0.75rem; }
.bl-rev { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.9rem; }
.bl-rev-head { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.3rem; }
.bl-rev-score { color: var(--accent); font-weight: 600; }
.bl-rev-body { color: var(--text-muted); overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .bl-frame { height: 80vh; }
}

/* ---------- Browser Check standalone shell (no login, no sidebar) ---------- */

.bl-standalone-body { min-height: 100vh; background: var(--bg); }
.bl-standalone-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #0a0c11;
    flex-wrap: wrap;
}
.bl-standalone-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
}
.bl-standalone-brand img { height: 26px; width: 26px; border-radius: 6px; }
.bl-standalone-nav { display: flex; align-items: center; gap: 1rem; }
.bl-standalone-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.bl-standalone-nav a:hover { color: var(--text); }
.bl-standalone-wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.bl-standalone-wrap h1 { margin-top: 0; }
