/* ==========================================================================
   AdFlex — SaaS design system (light, blue accents)
   ========================================================================== */

/* ---------- fonts ---------- */
@font-face {
    font-family: 'InterVar';
    src: url('../fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eef3ff;
    --blue-pill: #dce9fb;
    --ink: #0f172a;
    --ink-2: #1e293b;
    --body: #475569;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --radius: 14px;
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --font: 'InterVar', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--body);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }
body.nav-open, body.sidebar-open { overflow: hidden; }

a { color: var(--blue); text-decoration: none; }
/* v3: no underline on hover — links highlight by colour only */
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 12px; font-weight: 700; }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }

p { margin: 0 0 14px; }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }

/* visually hidden, but available to screen readers */
.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; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.btn-primary { background: var(--blue); color: #fff !important; box-shadow: 0 6px 18px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--blue-dark); color: #fff !important; text-decoration: none; }

.btn-outline { background: #fff; border-color: #bfdbfe; color: var(--ink-2) !important; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue) !important; text-decoration: none; }

.btn-soft { background: var(--blue-pill); color: var(--blue-dark) !important; }
.btn-soft:hover { background: #cfe0f9; text-decoration: none; }

.btn-green { background: var(--green); color: #fff !important; }
.btn-green:hover { background: #15803d; color: #fff !important; text-decoration: none; }

.btn-red { background: var(--red); color: #fff !important; }
.btn-red:hover { background: #b91c1c; color: #fff !important; text-decoration: none; }

.btn-red-soft { background: var(--red-soft); color: var(--red) !important; }
.btn-red-soft:hover { text-decoration: none; }

.btn-white { background: #fff; color: var(--blue) !important; border-color: transparent; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

.input, select.input, textarea.input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 92px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.input-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input-invalid { border-color: var(--red) !important; }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--body); }
.checkbox input { margin-top: 3px; accent-color: var(--blue); }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }

/* ---------- cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat-card .value { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.red { color: var(--red); }
.stat-card .delta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.data { min-width: 640px; font-size: 13.5px; }
/* An empty-state-only table doesn't need the wide layout — hide the header row
   (its nowrap columns stretch the table) and keep the message compact on mobile */
table.data:has(> tbody > tr:only-child .table-empty) { min-width: 0; }
table.data:has(> tbody > tr:only-child .table-empty) thead { display: none; }
table.data th {
    background: var(--bg-soft);
    color: var(--ink-2);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #f8fafc; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 34px 16px; text-align: center; color: var(--muted); }

/* ---------- badges ---------- */
.badge {
    display: inline-block;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 11px;
    white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: #15803d; }
.badge-red { background: var(--red-soft); color: #b91c1c; }
.badge-amber { background: var(--amber-soft); color: #b45309; }
.badge-slate { background: #eef2f7; color: #475569; }
.badge-blue { background: var(--blue-pill); color: var(--blue-dark); }

/* ---------- alerts ---------- */
.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 0 0 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); color: #14532d; border-color: #bbf7d0; }
.alert-error, .alert-danger { background: var(--red-soft); color: #7f1d1d; border-color: #fecaca; }
.alert-info { background: var(--blue-soft); color: #1e3a8a; border-color: #bfdbfe; }
.alert-warning { background: var(--amber-soft); color: #78350f; border-color: #fde68a; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- floating toast notifications ---------- */
.toast-stack {
    position: fixed;
    top: 66px;
    right: 18px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}
.toast-stack .alert {
    pointer-events: auto;
    margin: 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    color: var(--ink-2);
    animation: toast-in .22s cubic-bezier(.21, 1.02, .73, 1);
}
.toast-stack .alert.alert-error { animation: toast-in-red .22s cubic-bezier(.21, 1.02, .73, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-in-red { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast-stack .alert.toast-out { opacity: 0; transform: translateX(24px); transition: opacity .25s ease, transform .25s ease; }
.toast-stack .alert .toast-close {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: .65;
    cursor: pointer;
    padding: 0;
}
.toast-stack .alert .toast-close:hover { opacity: 1; background: rgba(15, 23, 42, .07); }
@media (max-width: 720px) {
    .toast-stack { top: 62px; right: 12px; }
}

/* ---------- misc ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.code-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The code itself lives in its own scroll area, so the copy button never
   rides with the code and never overlaps it, no matter how long the value is. */
.code-box-text {
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    white-space: pre;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}
.code-box-text::-webkit-scrollbar { height: 7px; }
.code-box-text::-webkit-scrollbar-thumb { background: #475569; border-radius: 999px; }
.code-box-text::-webkit-scrollbar-track { background: transparent; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--blue-pill);
    color: var(--blue-dark);
    border-radius: 999px;
    padding: 6px 15px;
    font-size: 13.5px;
    font-weight: 600;
}

.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
    padding: 9px 16px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none !important;
}
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.tabs a:hover { color: var(--ink); text-decoration: none; }

/* ---------- public site ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 18px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo img { height: 26px; width: auto; display: block; }
.logo-env { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #94a3b8; padding: 3px 8px; border: 1px solid #33415580; border-radius: 6px; }
.app-sidebar .logo img { height: 28px; }
.auth-card .logo img { height: 28px; }
.site-footer .logo img { height: 26px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 13px;
    border-radius: 8px;
    color: var(--body);
    font-weight: 500;
    font-size: 14.5px;
    text-decoration: none !important;
}
.main-nav a:hover { color: var(--blue); background: var(--blue-soft); }
.main-nav a.active { color: var(--blue); font-weight: 700; }

.site-footer {
    background: #0f172a;
    color: #94a3b8;
    margin-top: auto;
    padding: 46px 0 28px;
    font-size: 13.5px;
}
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .bottom { border-top: 1px solid #1e293b; margin-top: 30px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.hero {
    background: linear-gradient(160deg, #eef3ff 0%, #ffffff 70%);
    padding: 72px 0 56px;
    position: relative;
    overflow: hidden;
}
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 46px; margin-bottom: 18px; }
.hero h1 .accent { color: var(--blue); }
.hero .grid .lead { font-size: 17px; color: var(--body); max-width: 520px; margin-bottom: 28px; text-wrap: pretty; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

/* ---------- inner-page hero (centered intro on public pages) ---------- */
.hero.hero-center { padding: 60px 0 52px; }
.hero-center .section-head { max-width: 720px; margin: 0 auto; }
.hero-center .section-head .pill { margin-bottom: 18px; }
.hero-center .section-head h1 {
    font-size: clamp(28px, 3.2vw, 40px);
    margin-bottom: 14px;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.hero-center .section-head .lead {
    font-size: 16.5px;
    color: var(--body);
    max-width: 620px;
    margin: 0 auto;
    text-wrap: pretty;
}

/* balanced line breaks for headings everywhere */
h1, h2, h3, h4 { text-wrap: balance; }

.hero-art { position: relative; min-height: 380px; }
.hero-art .blob {
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: #c7daf8;
    filter: blur(70px);
    opacity: .7;
    top: -30px; right: -20px;
}
.browser-mock {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    transform: rotate(-2deg);
    margin: 30px auto 0;
}
.browser-mock .bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.browser-mock .dot { width: 10px; height: 10px; border-radius: 50%; }
.browser-mock .body { padding: 16px 18px 22px; }
.skel { border-radius: 6px; background: #eef2f7; margin: 8px 0; height: 10px; }
.skel.short { width: 55%; }
.skel.mid { width: 75%; }

.popup-mock {
    position: absolute;
    right: -8px;
    top: 130px;
    width: 250px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    transform: rotate(3deg);
    overflow: hidden;
}
.popup-mock .head { background: linear-gradient(120deg, #3b82f6, #60a5fa); padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; }
.popup-mock .x { color: #fff; font-weight: 700; font-size: 15px; line-height: 1; }
.popup-mock .inner { padding: 14px 16px; }
.btn-mock { margin-top: 10px; background: var(--blue); border-radius: 8px; height: 26px; }

.trust-strip { display: flex; gap: 0; border-top: 1px solid var(--line); background: #fff; }
.trust-strip .item { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 10px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.trust-strip .item + .item { border-left: 1px solid var(--line); }
.trust-strip svg { width: 19px; height: 19px; color: var(--blue); flex: none; }

.section { padding: 70px 0; }
.section.tight { padding: 46px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 30px; margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 16px; text-wrap: pretty; }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.role-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.role-card .icon-tile {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--blue-pill);
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.role-card .icon-tile.green { background: var(--green-soft); }
.role-card .icon-tile svg { width: 26px; height: 26px; color: var(--blue); }
.role-card .icon-tile.green svg { color: var(--green); }
.role-card .go {
    margin-left: auto;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--blue-pill);
    color: var(--blue-dark);
    display: flex; align-items: center; justify-content: center;
    flex: none;
    font-size: 17px;
}
.role-card h3 { margin-bottom: 5px; }
.role-card p { margin: 0; color: var(--muted); font-size: 14px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feature-card .icon-tile { width: 42px; height: 42px; border-radius: 11px; background: var(--blue-pill); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature-card .icon-tile svg { width: 20px; height: 20px; color: var(--blue); }
.feature-card h3 { font-size: 16px; }
.feature-card p { font-size: 13.5px; color: var(--muted); margin: 0; }

.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; position: relative; }
.step-card .num { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.step-card h3 { font-size: 15px; }
.step-card p { font-size: 13px; color: var(--muted); margin: 0; }

.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stats-band .cell { text-align: center; padding: 18px 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.stats-band .value { font-size: 26px; font-weight: 800; color: var(--blue); }
.stats-band .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

.prose { max-width: 840px; }
.prose h2 { margin-top: 34px; }
.prose h3 { margin-top: 26px; }
.prose p, .prose li { color: var(--body); font-size: 15px; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.faq-item .q { padding: 15px 18px; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.faq-item .q::after { content: '+'; color: var(--blue); font-weight: 800; }
.faq-item.open .q::after { content: '–'; }
.faq-item .a { display: none; padding: 0 18px 16px; color: var(--body); font-size: 14px; }
.faq-item.open .a { display: block; }

/* ---------- auth pages ---------- */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg, #eef3ff, #fff 65%); padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 30px; }
.auth-card .logo { justify-content: center; display: flex; margin-bottom: 22px; }
.auth-card h1 { font-size: 21px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 16px; }
.auth-foot { text-align: center; font-size: 13.5px; margin-top: 18px; color: var(--muted); }

/* ---------- app (dashboard) layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.app-sidebar .logo { padding: 6px 10px 18px; }
.app-sidebar .nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #94a3b8; padding: 16px 12px 7px; }
.app-sidebar a.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--body);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none !important;
}
.app-sidebar a.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.app-sidebar a.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.app-sidebar a.nav-item svg { width: 17px; height: 17px; flex: none; }
.app-sidebar .sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px;
    padding: 0 26px; height: 60px;
}
.app-topbar .who { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
/* topbar titles must never push the right-side controls off screen */
.app-topbar > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-pill); color: var(--blue-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.app-content { padding: 26px; max-width: 1220px; width: 100%; }

.app-sidebar .nav-badge { margin-left: auto; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 7px; }

/* ---------- charts ---------- */
.chart-card { position: relative; }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { max-width: 100%; }

.range-tabs { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.range-tabs a, .range-tabs button {
    border: none; background: transparent; border-radius: 999px;
    padding: 5px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
    text-decoration: none !important; cursor: pointer; font-family: var(--font);
}
.range-tabs a.active, .range-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(15,23,42,.08); }

/* ---------- progress ---------- */
.progress { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }

/* ---------- copy button ---------- */
.copy-btn { flex: 0 0 auto; background: rgba(37, 99, 235, .92); color: #fff; border: none; border-radius: 7px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: var(--font); transition: background .15s ease; }
.copy-btn:hover { background: var(--blue-dark); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 13px; color: var(--body);
    text-decoration: none !important;
}
.pagination li a:hover { border-color: var(--blue); color: var(--blue); }
.pagination li.active span { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .stat-grid, .stats-band { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .step-grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer .cols { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
}

/* Compact, professional mobile footer (v3) */
@media (max-width: 720px) {
    .site-footer { padding: 34px 0 18px; font-size: 13px; }
    .site-footer .container { padding: 0 18px; }
    .site-footer .cols { grid-template-columns: 1fr 1fr; gap: 20px 14px; }
    .site-footer .cols > div:first-child { grid-column: 1 / -1; }
    .site-footer .cols > div:first-child .logo { margin-bottom: 12px; }
    .site-footer .cols > div:first-child p { max-width: 100%; margin-top: 6px; font-size: 12.5px; line-height: 1.55; }
    .site-footer h4 { font-size: 11px; letter-spacing: .07em; margin-bottom: 9px; }
    .site-footer .cols a { font-size: 13px; line-height: 1.9; }
    .site-footer .bottom {
        margin-top: 20px;
        padding-top: 14px;
        flex-direction: column;
        text-align: center;
        gap: 4px;
        font-size: 12px;
    }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .app-sidebar { position: fixed; left: -300px; width: 280px; z-index: 100; transition: left .22s ease; box-shadow: none; }
    .app-sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .app .menu-toggle { display: flex; }
    .hero .grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
    .role-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ---------- public site: mobile burger + drawer ---------- */
.header-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.nav-burger .nav-burger-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--ink-2);
    transition: transform .18s ease, opacity .18s ease;
}
.nav-burger.open .nav-burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open .nav-burger-bar:nth-child(2) { opacity: 0; }
.nav-burger.open .nav-burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    z-index: 45; /* below the sticky header so the burger (X) stays clickable */
    opacity: 0;
    transition: opacity .2s ease;
}
.mobile-nav-backdrop.show { display: block; }
.mobile-nav-backdrop.on { opacity: 1; }

.mobile-nav {
    position: fixed;
    top: 67px; /* just below the sticky header */
    right: -280px;
    width: 272px;
    max-width: 86vw;
    height: calc(100dvh - 67px);
    background: #fff;
    z-index: 46;
    padding: 14px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transition: right .22s ease;
    border-top: 1px solid var(--line);
}
.mobile-nav.open { right: 0; }
.mobile-nav a {
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
}
.mobile-nav a:hover { background: var(--bg-soft); }
.mobile-nav a.active { color: var(--blue); background: var(--blue-soft); }
.mobile-nav hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 12px 0;
}
.mobile-nav .btn { margin: 4px 0; justify-content: center; }

@media (max-width: 860px) {
    .main-nav { display: none; }
    .nav-burger { display: flex; }
}

@media (max-width: 640px) {
    .stat-grid, .stat-grid.cols-3, .stats-band { grid-template-columns: repeat(2, 1fr); }
    .stat-grid.cols-2 { grid-template-columns: 1fr; }
    .feature-grid, .step-grid { grid-template-columns: 1fr; }
    .trust-strip { flex-direction: column; }
    .trust-strip .item + .item { border-left: none; border-top: 1px solid var(--line); }
    .app-content { padding: 18px 14px; }
    .page-head h1 { font-size: 20px; }
    .popup-mock { display: none; }
}

/* ---------- skeleton/loading ---------- */
.loading-bar { height: 3px; background: linear-gradient(90deg, transparent, var(--blue), transparent); position: fixed; top: 0; left: 0; right: 0; z-index: 200; display: none; }
.loading-bar.on { display: block; animation: slide 1.2s infinite linear; }
@keyframes slide { from { background-position: -200px 0; } to { background-position: 200px 0; } }

/* ==========================================================================
   v2 — dropdowns, filters, geo picker, sidebar UX, spacing rhythm
   ========================================================================== */

/* ---------- vertical rhythm between dashboard blocks ---------- */
.app-content > * + .card,
.app-content > * + .form-card,
.app-content > * + .stat-grid,
.app-content > * + .table-wrap,
.app-content > * + .alert { margin-top: 16px; }
.app-content > .alert { margin-bottom: 0; }

/* ---------- unified filter bar (v3) — one filter component on every page ----------
   Markup contract (identical everywhere):
   <form|div class="filter-bar">
       <div class="filter-field [filter-field--grow]">
           <label class="filter-label" for="id">Label</label>
           <select|input class="filter-select|filter-input" id="id">
       </div>
       <div class="filter-submit"><button>Apply</button></div>   (forms only)
   </form|div>
   Nav selects keep the data-nav-base behaviour, submit forms use data-autosubmit. */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
/* A second bar directly below (custom date range) continues the same panel */
.filter-bar + .filter-bar { margin-top: -8px; }

.filter-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
    margin: 0;
}
.filter-field--grow { flex: 1 1 220px; }

.filter-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    margin: 0;
}

.filter-select,
.filter-input {
    height: 38px;
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 36px;
    transition: border-color .15s, box-shadow .15s;
}
.filter-input { flex: 1 1 120px; }
.filter-date  { flex: 1 1 120px; max-width: 175px; }
.filter-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 0 1 auto;
    min-width: 170px;
    max-width: 260px;
    padding-right: 34px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.filter-submit { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.filter-note { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.filter-hint { margin: -8px 0 16px; font-size: 13px; color: var(--muted); }

/* Chart header selects share the same control style */
.chart-range-select { min-width: 150px; max-width: 190px; }

/* ---------- filters card (v4) — outlined fields with notched labels ----------
   Markup contract (identical everywhere):
   <form class="filters" method="get" action="…" data-autosubmit aria-label="…">
       <div class="filters-head"><svg/><h2 class="filters-title">Filters</h2></div>
       <div class="filters-grid">
           <div class="fbox [fbox--full]">
               <label class="fbox-label" for="id">Label</label>
               <select|input class="fbox-control" id="id" name="…">
           </div>
       </div>
       <div class="filters-actions">
           <button class="filters-apply" type="submit">Apply</button>
           <a class="filters-reset" href="…">Reset</a>
       </div>
   </form>
   Selects auto-submit on change (data-autosubmit); Apply submits text/date fields. */
.filters {
    margin: 0 0 16px;
    padding: 18px 20px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.filters-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: var(--ink);
}
.filters-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--ink);
}
.filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
}
@media (min-width: 720px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
}

.fbox {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    min-height: 52px;
    transition: border-color .15s, box-shadow .15s;
}
.fbox--full { grid-column: 1 / -1; }
.fbox-label {
    position: absolute;
    top: -9px;
    left: 12px;
    padding: 0 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    color: var(--muted);
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
}
.fbox-control {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    font-family: var(--font);
    font-size: 16px;
    color: var(--ink);
    outline: none;
}
select.fbox-control {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 42px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.fbox:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.fbox:focus-within .fbox-label { color: var(--blue); }

.filters-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}
.filters-apply {
    height: 46px;
    padding: 0 32px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.filters-apply:hover { background: var(--ink-2); }
.filters-apply:active { transform: translateY(1px); }
.filters-apply:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15, 23, 42, .25); }
.filters-reset {
    padding: 10px 2px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.filters-reset:hover { color: var(--ink); }
.filters-note {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 719px) {
    .filters { padding: 14px 14px 16px; }
    .filters-head { margin-bottom: 14px; }
    .fbox { min-height: 48px; }
    .fbox-control { height: 48px; }
    .filters-actions { gap: 16px; margin-top: 16px; }
    .filters-apply { flex: 1 1 auto; }
    .filters-reset { flex: 0 0 auto; }
}

/* ---------- news feed (/news) ---------- */
.post-body {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--body);
}
.post-body p { margin: 0 0 12px; }
.post-body p:last-child { margin-bottom: 0; }

/* ---------- kebab dropdown menus ---------- */
.dropdown { position: relative; display: inline-block; }

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.dropdown-toggle:hover { border-color: var(--blue); color: var(--blue); }
.dropdown.open .dropdown-toggle { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 80;
}
.dropdown.open > .dropdown-menu { display: block; animation: dd-in .14s ease; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dropdown-menu > a,
.dropdown-menu > button,
.dropdown-menu > form > button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--ink-2);
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}
.dropdown-menu > a:hover,
.dropdown-menu > button:hover,
.dropdown-menu > form > button:hover { background: var(--bg-soft); color: var(--ink); }
.dropdown-menu > a svg, .dropdown-menu > button svg { flex: none; color: var(--muted); }
.dropdown-menu > a:hover svg, .dropdown-menu > button:hover svg { color: var(--blue); }
.dropdown-menu > .danger, .dropdown-menu > form > button.danger { color: var(--red); }
.dropdown-menu > .danger svg, .dropdown-menu > form > button.danger svg { color: var(--red); }
.dropdown-menu > form { margin: 0; }

/* "Floating" mode — the menu is promoted to position:fixed by JS so it
   overlays the table card instead of being clipped inside .table-wrap. */
.dropdown-menu.floating {
    position: fixed;
    top: auto;
    right: auto;
    z-index: 250;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

/* ---------- styled selects (v2) — replace native <select> ---------- */
.sel { position: relative; display: inline-block; max-width: 100%; }
.sel .sel-native {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    opacity: 0; pointer-events: none;
    clip-path: inset(50%); overflow: hidden;
    border: 0 !important; padding: 0 !important;
}
.sel-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: 500 14px/1.2 var(--font);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sel-btn:hover { border-color: var(--blue); }
.sel.open .sel-btn, .sel-btn:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}
.sel-btn[disabled], .sel-btn.disabled { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }
.sel-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-caret { flex: none; color: var(--muted); transition: transform .16s ease; }
.sel.open .sel-caret { transform: rotate(180deg); color: var(--blue); }

.sel-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 360px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 130;
    display: none;
}
.sel.open .sel-panel { display: block; animation: dd-in .14s ease; }
.sel.up .sel-panel { top: auto; bottom: calc(100% + 6px); }

.sel-search { position: relative; margin: 2px 2px 8px; }
.sel-search .input { padding-left: 34px; height: 38px; }
.sel-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.sel-list { max-height: 268px; overflow-y: auto; }
.sel-list::-webkit-scrollbar { width: 8px; }
.sel-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.sel-list::-webkit-scrollbar-track { background: transparent; }

.sel-opt {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font: 500 13.5px var(--font);
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sel-opt:hover, .sel-opt.hl { background: var(--bg-soft); color: var(--ink); }
.sel-opt.selected { color: var(--blue); font-weight: 700; }
.sel-opt.selected::after { content: "✓"; margin-left: auto; font-weight: 800; padding-left: 8px; }
.sel-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); display: none; }

/* Full-width selects inside forms */
.form-grid .sel, .form-card .sel { width: 100%; }
.filter-bar .sel { flex: 0 1 auto; }

table.data .cell-actions { width: 1%; white-space: nowrap; }
table.data .th-actions { width: 1%; }

/* ---------- sidebar: animated hamburger, overlay, close ---------- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 11px 11px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
}
.menu-toggle .menu-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--ink-2);
    transition: transform .18s ease, opacity .18s ease;
}
.menu-toggle.open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle.open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .52);
    z-index: 90;
    opacity: 0;
    transition: opacity .2s ease;
}
.sidebar-backdrop.on { opacity: 1; }
@media (max-width: 900px) {
    .sidebar-backdrop.show { display: block; }
}

.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 16px; }
.app-sidebar .sidebar-top .logo { padding: 2px 8px; }

.sidebar-close {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    flex: none;
}
.sidebar-close:hover { color: var(--red); border-color: var(--red); }
.app-sidebar[style*="background:#0f172a"] .sidebar-close,
.app-sidebar.dark .sidebar-close { background: #1e293b; border-color: #1e293b; color: #94a3b8; }
@media (max-width: 900px) {
    .sidebar-close { display: inline-flex; }
}

body.sidebar-open { overflow: hidden; }

/* ---------- topbar bell ---------- */
.topbar-bell { position: relative; color: var(--muted); display: inline-flex; }
.topbar-bell:hover { color: var(--blue); }
.topbar-bell .bell-dot {
    position: absolute;
    top: -5px; right: -7px;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 5.5px;
}

/* ---------- topbar balance widget ---------- */
.bal-widget { position: relative; display: inline-flex; }
.bal-trigger {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid transparent; background: transparent;
    border-radius: 10px; padding: 7px 11px; margin: 0 -4px;
    cursor: pointer; font-family: var(--font);
    font-size: 13.5px; line-height: 1;
    transition: background .15s ease, border-color .15s ease;
}
.bal-trigger:hover { background: var(--bg-soft); border-color: var(--line); }
.bal-widget.open .bal-trigger { background: var(--bg-soft); border-color: var(--line); }
.bal-label { color: var(--muted); font-weight: 500; }
.bal-value { color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.bal-caret { color: var(--muted); flex: none; transition: transform .18s ease; }
.bal-widget.open .bal-caret { transform: rotate(180deg); }

.bal-panel {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 340px; z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 14px 16px 12px;
    display: none;
}
.bal-widget.open .bal-panel { display: block; animation: balPop .16s ease; }
@keyframes balPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Formula row: EARNED − PAID + ADJUSTMENTS + REFERRALS = BALANCE */
.bal-row { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.bal-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 0 5px; }
.bal-cell .num { font-size: 14px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.bal-cell .cap, .bal-ad .cap {
    font-size: 9px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.bal-cell .num.green { color: var(--green); }
.bal-cell .num.red   { color: var(--red); }
.bal-cell .num.ink   { color: var(--ink); }
.bal-op {
    color: var(--muted); font-size: 13px; font-weight: 700;
    padding-bottom: 15px; /* optical align with the numbers above caps */
    user-select: none;
}
.bal-total { padding: 0 3px 0 8px; border-left: 1px solid var(--line); }
.bal-total .num { font-size: 16px; }

/* Footer: ad balance + quick actions */
.bal-sep { height: 1px; background: var(--line); margin: 12px -16px 10px; }
.bal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bal-ad { display: flex; align-items: baseline; gap: 8px; }
.bal-ad .num { font-size: 14px; font-weight: 800; color: var(--ink); }
.bal-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bal-actions a {
    font-size: 12px; font-weight: 600; color: var(--blue);
    padding: 6px 10px; border-radius: 8px; text-decoration: none;
    transition: background .15s ease;
}
.bal-actions a:hover { background: var(--blue-soft); color: var(--blue-dark); }

@media (max-width: 900px) {
    .bal-panel { min-width: 300px; }
}
@media (max-width: 640px) {
    .bal-label { display: none; } /* keep the topbar compact: "$12.34 ▾" */
    .bal-trigger { padding: 7px 9px; }
    /* The topbar has backdrop-filter, which becomes the containing block for
       position:fixed — so the panel is anchored to the sticky topbar instead
       and spans its width, right under the bar. */
    .bal-widget { position: static; }
    .bal-panel {
        position: absolute; left: 12px; right: 12px;
        top: calc(100% + 8px); bottom: auto;
        min-width: 0; display: none; border-radius: 14px;
    }
    .bal-widget.open .bal-panel { display: block; }
    .bal-row { flex-wrap: wrap; row-gap: 10px; justify-content: flex-start; }
    .bal-op { padding-bottom: 0; }
    .bal-sep { margin: 12px 0 10px; }
    .bal-foot { justify-content: center; }
    /* Reclaim a few pixels of topbar breathing room for the widget. */
    .app-topbar { gap: 10px; padding: 0 14px; }
    .who { gap: 8px; }
    /* long usernames would overflow the compact topbar — the avatar keeps identity */
    .who-name { display: none; }
}

/* ---------- geo picker (campaign country targeting) ---------- */
.geo-picker { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 16px; margin-top: 6px; }

.geo-picker-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.geo-summary { font-size: 13px; color: var(--body); flex: 1; min-width: 200px; }

.geo-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; max-width: 340px; }
.geo-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.geo-search .input { padding-left: 36px; }

.geo-tier { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.geo-tier:last-of-type { border-bottom: none; padding-bottom: 6px; }

.geo-tier-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.geo-tier-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.geo-tier-check input { width: 17px; height: 17px; accent-color: var(--blue); }
.geo-tier-check strong { color: var(--ink); font-size: 14.5px; }
.geo-tier-count { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 3px 11px; }
.geo-tier-hint { margin: 4px 0 12px; }

.geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 8px;
    max-height: 264px;
    overflow-y: auto;
    padding-right: 4px;
}
.geo-grid::-webkit-scrollbar { width: 8px; }
.geo-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.geo-grid::-webkit-scrollbar-track { background: transparent; }

.geo-chip {
    position: relative; /* containing block for the hidden absolute checkbox */
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.geo-chip:hover { border-color: var(--blue); }
.geo-chip:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: 0 0 0 1px var(--blue) inset;
}
.geo-chip input { position: absolute; opacity: 0; pointer-events: none; }
.geo-chip-code {
    font-weight: 800;
    font-size: 12.5px;
    color: var(--muted);
    background: #eef2f7;
    border-radius: 6px;
    padding: 2px 7px;
    flex: none;
    letter-spacing: .03em;
}
.geo-chip:has(input:checked) .geo-chip-code { background: #fff; color: var(--blue-dark); }
.geo-chip-name { font-size: 13px; color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-chip-price { font-size: 12px; font-weight: 700; color: var(--blue-dark); flex: none; }

/* ---------- publisher website cards ---------- */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.site-card { display: flex; flex-direction: column; gap: 0; }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.site-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.site-stat-value { font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.site-stat-value.green { color: var(--green); }
.site-card-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* ---------- admin geo pricing ---------- */
.geo-bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.geo-bulk .input { width: 150px; }
.geo-admin-scroll {
    max-height: 520px;
    overflow-y: auto;
    margin: 0 -6px 0;
    padding: 0 6px;
    border-radius: 12px;
}
.geo-admin-scroll::-webkit-scrollbar { width: 9px; }
.geo-admin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid #fff; }
.geo-admin-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive add-ons ---------- */
@media (max-width: 640px) {
    .sites-grid { grid-template-columns: 1fr; }
    .geo-grid { grid-template-columns: 1fr; max-height: none; }
    .dropdown-menu:not(.floating) { position: fixed; left: 12px !important; right: 12px; top: auto; bottom: 14px; min-width: 0; }
    /* Filters on phones: one field per row — label on the left,
       control filling the rest of the row (Period | v select v). */
    .filter-bar { padding: 10px 12px; }
    .filter-field { flex: 1 1 100%; }
    .filter-select { flex: 1 1 auto; min-width: 0; max-width: none; }
    .filter-input { flex: 1 1 auto; }
    .filter-date { flex: 1 1 auto; max-width: none; }
    .filter-note { margin-left: 0; }
    .geo-admin-scroll { max-height: 380px; }
    .geo-bulk .input { width: 100%; }
    .geo-bulk { gap: 8px; }
    /* Custom dropdown panels must never be wider than the phone screen,
       otherwise opening one makes the page scroll sideways. */
    .sel-panel { max-width: calc(100vw - 24px); }
}

/* ==========================================================================
   Invoices
   ========================================================================== */
.invoice {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 34px 36px;
    max-width: 820px;
    box-shadow: var(--shadow);
}

.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.invoice-meta { text-align: right; }
.invoice-meta h2 { color: var(--ink); margin: 0 0 10px; font-size: 22px; }
.invoice-meta .kv, .invoice-total .kv { display: flex; gap: 18px; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.invoice-meta .kv span:first-child { color: var(--muted); }

.invoice-parties { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; padding: 26px 0; }
.invoice-parties h4 { margin: 0 0 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.invoice-parties p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.65; }

.invoice-items { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.invoice-item { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.invoice-item:last-child { border-bottom: none; }
.invoice-item h4 { margin: 0 0 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.invoice-item p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.invoice-item p.sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.invoice-item-amount .amount { font-size: 18px; color: var(--ink); }
.invoice .logo img { height: 30px; }

.invoice-total { padding: 18px 0 4px; border-top: 1px solid var(--line); }
.invoice-total .kv.total { border-top: 2px solid var(--ink); margin-top: 10px; padding: 12px 2px 0; font-size: 17px; font-weight: 800; color: var(--ink); }

.page-head.no-print { display: flex; }

/* ---------- print ---------- */
@media print {
    .app-sidebar, .app-topbar, .loading-bar, .no-print, .flash-wrap { display: none !important; }
    body { background: #fff; }
    .app { display: block; }
    .app-content { margin: 0; padding: 0; }
    .invoice { border: none; box-shadow: none; padding: 0; max-width: none; }
    .invoice-items { border-color: var(--ink); }
    .invoice-item { border-bottom-color: var(--ink); }
}

@media (max-width: 760px) {
    .invoice { padding: 22px 18px; }
    .invoice-parties { grid-template-columns: 1fr; gap: 14px; }
    .invoice-meta { text-align: left; }
}

/* ==========================================================================
   Dashboard — getting-started guide & statistics modal (v16)
   ========================================================================== */
.guide { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.guide-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.guide-title svg { color: var(--blue); flex: none; }

.guide-hide { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-radius: 9px; white-space: nowrap; }
.guide-hide:hover { background: var(--bg-soft); color: var(--ink-2); }

.guide--hidden .guide-body { display: none; }
.guide--hidden .guide-head { border-bottom: none; }

.guide-tabs { display: flex; border-bottom: 1px solid var(--line); }
.guide-tab { flex: 1; background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 14px 10px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.guide-tab:hover { color: var(--ink-2); }
.guide-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.guide-panel { padding: 6px 22px 24px; }
.guide-panel[hidden] { display: none; }

/* steps — accordion with a dotted connector line through the badges */
.steps { position: relative; }
.steps::before { content: ''; position: absolute; left: 22px; top: 46px; bottom: 46px; border-left: 2px dotted #cbd5e1; }

.step { position: relative; }

.step-head { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: none; cursor: pointer; text-align: left; font: inherit; padding: 12px 4px; border-radius: 10px; }
.step-head:hover { background: var(--bg-soft); }
.step-head:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.step-badge { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: #eef2f7; color: #64748b; font-weight: 800; font-size: 15px; flex: none; box-shadow: 0 0 0 5px #fff; }
.step-badge--done { background: var(--green); color: #fff; }
.step.open .step-badge:not(.step-badge--done) { background: var(--blue); color: #fff; }

.step-title { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }

.step-chev { margin-left: auto; color: var(--muted); flex: none; transition: transform 0.2s ease; }
.step.open .step-chev { transform: rotate(180deg); color: var(--ink-2); }

.step-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s ease; }
.step.open .step-body { grid-template-rows: 1fr; }
.step-body-in { overflow: hidden; padding-left: 56px; }
.step.open .step-body-in { padding-bottom: 18px; }

.step-sub { font-size: 14.5px; font-weight: 700; color: var(--ink-2); margin: 2px 0 10px; }

.step-list { margin: 0 0 14px; padding-left: 19px; }
.step-list li { margin: 5px 0; color: var(--body); font-size: 14px; line-height: 1.65; }
.step-list li::marker { color: #94a3b8; }
.step-list strong { color: var(--ink-2); }

.step-tips { background: var(--blue-soft); border: 1px solid #d3e2fc; border-radius: 10px; padding: 12px 16px 14px; margin: 0 0 16px; }
.step-tips-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-dark); margin-bottom: 6px; }
.step-tips ul { margin: 0; padding-left: 17px; }
.step-tips li { margin: 4px 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.step-tips li::marker { color: #93c5fd; }

.step-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.step-cta { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff !important; border-radius: 999px; padding: 10px 20px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25); }
.step-cta:hover { background: var(--blue-dark); color: #fff !important; text-decoration: none; }

.step-nav { margin-left: auto; display: flex; gap: 16px; }
.step-nav button { background: none; border: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); padding: 8px 2px; }
.step-nav button:hover { color: var(--blue); }
.step-nav button[disabled] { color: #cbd5e1; cursor: default; }
.step-nav button[disabled]:hover { color: #cbd5e1; }

/* ---------- statistics modal ---------- */
.modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }

.modal-card { position: relative; width: 100%; max-width: 520px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); max-height: min(86vh, 760px); overflow: auto; animation: modal-in 0.22s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: none; background: none; cursor: pointer; color: var(--muted); }
.modal-close:hover { background: var(--bg-soft); color: var(--ink-2); }

.stats-groups { padding: 4px 22px 8px; }
.stats-group { margin: 16px 0 2px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.stats-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.stats-row:last-of-type { border-bottom: none; }
.stats-row > span { color: var(--ink-2); }
.stats-row strong { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-row strong.green { color: var(--green); }
.stats-row strong.blue { color: var(--blue); }
.stats-row em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 13px; }

.modal-foot { display: flex; gap: 10px; padding: 16px 22px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }

/* ---------- guide / modal — mobile ---------- */
@media (max-width: 719px) {
    .guide-head { padding: 14px 16px; }
    .guide-panel { padding: 4px 14px 18px; }
    .guide-tab { font-size: 12px; padding: 12px 6px; }

    .step-head { gap: 12px; padding: 11px 2px; }
    .step-badge { width: 36px; height: 36px; box-shadow: 0 0 0 5px #fff; }
    .steps::before { left: 20px; }
    .step-title { font-size: 14.5px; }

    /* keep the step body clear of the dotted connector line */
    .step-body-in { padding-left: 50px; }
    .step-foot { gap: 10px; }
    .step-nav { margin-left: auto; }
    .step-cta { flex: 1 1 auto; }

    .modal { padding: 12px; align-items: flex-end; }
    .modal-card { max-height: 88vh; }
    .stats-groups { padding: 2px 18px 6px; }
    .stats-row { font-size: 14px; }
    .modal-foot { padding: 14px 18px 18px; }
    .modal-foot .btn { flex: 1; }
}

@media print {
    .modal, .guide-hide, .step-nav { display: none !important; }
}

/* ==========================================================================
   NEWS — feed, article, rich body, admin editor
   ========================================================================== */

/* ---------- sidebar new-news badge ---------- */
.nav-badge.news-badge { background: var(--blue); color: #fff; margin-left: auto; }
.nav-badge.news-badge + .nav-badge { display: none; }
.app-sidebar a.nav-item:has(.news-badge):not(.active) { color: var(--ink-2); }

/* ---------- news feed ---------- */
.news-page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.news-page-head h1 { margin: 0 0 4px; font-size: 24px; }
.news-page-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.news-page-icon {
    width: 52px; height: 52px; flex: none;
    border-radius: 14px;
    background: var(--blue-soft);
    display: flex; align-items: center; justify-content: center;
}
.news-page-icon svg { width: 24px; height: 24px; color: var(--blue); }

.news-featured {
    display: flex; align-items: stretch;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden; text-decoration: none;
    margin-bottom: 20px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.news-featured:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.news-featured-cover { flex: 1 1 46%; min-width: 0; background: var(--bg-soft); position: relative; }
.news-featured-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-featured-cover--ph { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue-soft), #fff); }
.news-featured-cover--ph svg { width: 64px; height: 64px; color: var(--blue); opacity: .35; }
.news-featured-body { flex: 1 1 54%; min-width: 0; padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.news-featured-body h2 { margin: 0; font-size: 22px; line-height: 1.25; color: var(--ink); }
.news-featured:hover h2 { color: var(--blue-dark); }
.news-tag {
    align-self: flex-start;
    background: var(--blue-pill); color: var(--blue-dark);
    font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    border-radius: 999px; padding: 4px 10px;
}
.news-excerpt { margin: 0; color: var(--body); font-size: 14px; line-height: 1.6; }
.news-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.news-read-more { color: var(--blue); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.news-read-more svg { width: 14px; height: 14px; transition: transform .18s ease; }
.news-featured:hover .news-read-more svg, .news-card:hover .news-read-more svg { transform: translateX(3px); }

.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.news-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; text-decoration: none;
    display: flex; flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.news-card-cover { aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.news-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.news-card:hover .news-card-cover img { transform: scale(1.03); }
.news-cover-ph {
    height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--blue-soft), #fff);
}
.news-cover-ph svg { width: 56px; height: 56px; color: var(--blue); opacity: .3; }
.news-card-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card-body h3 { margin: 0; font-size: 16.5px; line-height: 1.35; color: var(--ink); }
.news-card:hover h3 { color: var(--blue-dark); }
.news-date { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.news-card .news-read-more { margin-top: auto; }

@media (max-width: 900px) {
    .news-featured { flex-direction: column; }
    .news-featured-cover { aspect-ratio: 16 / 9; flex: none; }
    .news-featured-body { padding: 20px 22px 18px; }
    .news-featured-body h2 { font-size: 19px; }
}
@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; gap: 14px; }
    .news-page-icon { width: 44px; height: 44px; border-radius: 11px; }
    .news-page-icon svg { width: 20px; height: 20px; }
    .news-page-head h1 { font-size: 20px; }
}

/* ---------- news article ---------- */
.news-back {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--muted); font-size: 13px; font-weight: 600;
    text-decoration: none; margin-bottom: 14px;
    padding: 7px 12px 7px 8px; border-radius: 9px;
    transition: color .15s ease, background .15s ease;
}
.news-back:hover { color: var(--blue); background: var(--blue-soft); }
.news-back svg { width: 15px; height: 15px; }

.news-article {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.news-article-cover img { width: 100%; display: block; max-height: 380px; object-fit: cover; }
.news-article-head { padding: 26px 30px 0; }
.news-article-head h1 { margin: 0 0 10px; font-size: 25px; line-height: 1.25; color: var(--ink); }
.news-article-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    color: var(--muted); font-size: 12.5px; margin: 0;
}
.news-article-meta svg { color: var(--muted); }
.news-body { padding: 22px 30px 30px; }

/* Rich content authored in the admin editor */
.news-body { color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.news-body p { margin: 0 0 14px; }
.news-body > *:first-child { margin-top: 0; }
.news-body > *:last-child { margin-bottom: 0; }
.news-body h2 { font-size: 20px; margin: 26px 0 10px; color: var(--ink); }
.news-body h3 { font-size: 17px; margin: 22px 0 8px; color: var(--ink); }
.news-body h4 { font-size: 15.5px; margin: 18px 0 6px; color: var(--ink); }
.news-body a { color: var(--blue); }
.news-body a:hover { color: var(--blue-dark); }
.news-body strong { color: var(--ink); }
.news-body ul, .news-body ol { margin: 0 0 14px; padding-left: 24px; }
.news-body li { margin: 5px 0; }
.news-body li::marker { color: var(--blue); font-weight: 700; }
.news-body img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 18px auto; }
.news-body figure { margin: 18px 0; }
.news-body figcaption { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.news-body blockquote {
    border-left: 3px solid var(--blue); background: var(--blue-soft);
    border-radius: 0 10px 10px 0; padding: 12px 16px;
    margin: 16px 0; color: var(--ink-2);
}
.news-body blockquote p:last-child { margin-bottom: 0; }
.news-body hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.news-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
    padding: 1.5px 6px; font-size: 13px; color: var(--ink);
}
.news-body pre {
    background: #0f172a; color: #e2e8f0; border-radius: 10px;
    padding: 14px 16px; overflow-x: auto; margin: 16px 0; font-size: 13px; line-height: 1.6;
}
.news-body pre code { background: none; border: none; padding: 0; color: inherit; }
.news-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13.5px; }
.news-body th, .news-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.news-body th {
    background: var(--blue-soft); color: var(--ink); font-weight: 700;
    font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.news-body tbody tr:nth-child(even) { background: var(--bg-soft); }
.news-body .num { font-variant-numeric: tabular-nums; }

/* Tables scroll horizontally on narrow screens (JS wraps them) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
    .news-article-head, .news-body { padding-left: 20px; padding-right: 20px; }
    .news-article-head { padding-top: 20px; }
    .news-article-head h1 { font-size: 21px; }
    .news-article-cover img { max-height: 220px; }
    .news-body { font-size: 14.5px; }
    .news-body h2 { font-size: 18px; }
    .news-body h3 { font-size: 16px; }
}

/* ---------- admin: cover upload + editor + list thumbs ---------- */
.cover-upload { display: flex; flex-direction: column; gap: 10px; }
.cover-thumb img { max-width: 220px; max-height: 130px; border-radius: 10px; border: 1px solid var(--line); display: block; object-fit: cover; }
.cover-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 1.5px dashed var(--line); border-radius: 12px;
    background: var(--bg-soft); color: var(--muted);
    padding: 22px 16px; cursor: pointer; text-align: center;
    font-size: 13px; font-weight: 600;
    transition: border-color .15s ease, background .15s ease;
}
.cover-drop:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.cover-drop svg { color: var(--muted); }
.cover-drop:hover svg { color: var(--blue); }
.cover-drop-hint { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.cover-input { display: none; }

.news-thumb {
    width: 52px; height: 38px; object-fit: cover;
    border-radius: 7px; border: 1px solid var(--line); display: block; flex: none;
    background: #fff;
}
.news-thumb--ph { display: flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); opacity: .5; }
.news-thumb--ph svg { width: 20px; height: 20px; }

/* TinyMCE integration */
.tox.tox-tinymce { border-radius: 10px; border-color: var(--line) !important; box-shadow: none !important; }
.tox.tox-tinymce:focus-within { border-color: var(--blue) !important; }
.tox .tox-toolbar__primary { background: var(--bg-soft) !important; border-bottom: 1px solid var(--line) !important; }
.tox .tox-tbtn svg { fill: var(--ink-2); }
.tox .tox-tbtn:hover { background: var(--blue-soft) !important; }
.tox .tox-statusbar { background: var(--bg-soft) !important; border-top: 1px solid var(--line) !important; }
.tox .tox-statusbar__branding { display: none; }
.tox-tinymce-aux .tox-toolbar__overflow, .tox-tinymce-aux .tox-dialog__popup { border-radius: 10px; }
@media (max-width: 640px) {
    .tox .tox-toolbar__group { flex-wrap: wrap; }
    .cover-thumb img { max-width: 100%; }
}

/* ==========================================================================
   NEWS REACTIONS + COMMUNITY CHAT
   ========================================================================== */

/* ---------- news: article reaction bar ---------- */
.news-reactions {
    margin-top: 18px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 30px 20px;
    display: flex; flex-direction: column; gap: 12px;
}
.news-reactions-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.news-react-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.news-react-total { font-size: 12px; color: var(--muted); white-space: nowrap; }
.news-react-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.news-react-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px 8px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.news-react-btn .e { font-size: 17px; line-height: 1; }
.news-react-btn .cnt { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 8px; text-align: center; }
.news-react-btn:hover { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.news-react-btn:active { transform: translateY(0); }
.news-react-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.news-react-btn.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.news-react-btn.active .cnt { color: rgba(255,255,255,.9); }

/* read-only reaction chips on feed cards */
.news-card-reacts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.news-react-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 600; color: var(--body);
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: 999px; padding: 2px 9px 2px 8px;
}
.news-featured .news-react-chip { background: #fff; }

/* ---------- chat shell ---------- */
.chat-shell {
    position: relative;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden;
}
.chat-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.chat-head strong { display: block; font-size: 15px; color: var(--ink); }
.chat-head-sub { font-size: 12px; color: var(--muted); }
.chat-live {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    color: var(--green);
}
.chat-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: chatPing 2s ease-out infinite; }
@keyframes chatPing {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
    70%  { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) { .chat-live-dot { animation: none; } }

.chat-scroll {
    height: min(56vh, 520px);
    overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 22px 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-track { background: transparent; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.chat-scroll::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.chat-day {
    align-self: center; flex: none; margin: 6px 0 2px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted);
    background: var(--bg-soft); border: 1px solid var(--line);
    padding: 3px 12px; border-radius: 999px;
}

.chat-empty {
    margin: auto; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--muted); padding: 40px 16px;
}
.chat-empty svg { width: 42px; height: 42px; color: var(--blue); opacity: .35; }
.chat-empty strong { color: var(--ink-2); font-size: 15px; }
.chat-empty span { font-size: 13px; }

/* ---------- chat message row ---------- */
.chat-msg { display: flex; gap: 10px; max-width: 86%; position: relative; }
.chat-msg--own { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar { width: 32px; height: 32px; font-size: 12px; flex: none; margin-top: 3px; }
.chat-msg-bubble {
    position: relative;
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: 14px; border-bottom-left-radius: 4px;
    padding: 9px 14px 10px; min-width: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.chat-msg--own .chat-msg-bubble {
    background: var(--blue); border-color: var(--blue);
    border-radius: 14px; border-bottom-right-radius: 4px; border-bottom-left-radius: 14px;
}
.chat-msg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-msg-top strong { font-size: 12.5px; color: var(--ink); font-weight: 700; }
.chat-msg--own .chat-msg-top strong { color: #fff; }
.chat-team {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--red); background: var(--red-soft);
    border-radius: 999px; padding: 1px 7px;
}
.chat-msg-top time { font-size: 10.5px; color: var(--muted); margin-left: auto; }
.chat-msg--own .chat-msg-top time { color: rgba(255,255,255,.75); }
.chat-msg-text {
    font-size: 14px; line-height: 1.5; color: var(--ink-2);
    word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.chat-msg--own .chat-msg-text { color: #fff; }
.chat-msg-text--deleted { font-style: italic; font-size: 13px; }
.chat-msg-text--deleted, .chat-msg--own .chat-msg-text--deleted { color: var(--muted); }

/* ---------- chat reactions ---------- */
.chat-reacts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; position: relative; }
.chat-pill {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 2px 8px 2px 6px;
    font: inherit; font-size: 11.5px; font-weight: 600; color: var(--body);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.chat-pill .e { font-size: 13px; line-height: 1; }
.chat-pill .c { font-variant-numeric: tabular-nums; }
.chat-pill:hover { border-color: var(--blue); }
.chat-pill.mine { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
/* pills on own (blue) bubbles stay light */
.chat-msg--own .chat-pill { background: rgba(255,255,255,.92); border-color: rgba(255,255,255,.55); color: var(--ink-2); }
.chat-msg--own .chat-pill.mine { background: #fff; border-color: #fff; color: var(--blue-dark); }

.chat-react-add {
    border: 1px dashed var(--line); background: transparent; color: var(--muted);
    width: 24px; height: 22px; padding: 0; border-radius: 999px;
    font-size: 12px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .12s ease, color .12s ease, border-style .12s ease;
}
.chat-react-add:hover { border-color: var(--blue); color: var(--blue); border-style: solid; }
.chat-msg--own .chat-react-add { border-color: rgba(255,255,255,.5); color: #fff; }

.chat-react-menu {
    position: absolute; bottom: calc(100% + 9px); left: 0; z-index: 30;
    background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    border-radius: 999px; padding: 4px 6px;
    display: flex; gap: 2px;
}
.chat-react-opt {
    border: none; background: transparent;
    font-size: 17px; line-height: 1; padding: 5px 6px; border-radius: 999px;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}
.chat-react-opt:hover { background: var(--blue-soft); transform: scale(1.2); }

/* ---------- admin: remove message ---------- */
.chat-del {
    position: absolute; top: -10px; right: -10px; z-index: 10;
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 1px solid var(--line); color: var(--muted);
    box-shadow: var(--shadow);
    display: none; align-items: center; justify-content: center;
    cursor: pointer;
    transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.chat-msg:hover .chat-del { display: inline-flex; }
.chat-del:hover { color: var(--red); background: var(--red-soft); border-color: var(--red-soft); }
.chat-del svg { width: 12px; height: 12px; }

/* ---------- new-messages pill ---------- */
.chat-new {
    position: absolute; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 20;
    background: var(--blue); color: #fff; border: none; border-radius: 999px;
    padding: 7px 14px;
    font: inherit; font-size: 12.5px; font-weight: 700;
    cursor: pointer; box-shadow: var(--shadow-lg);
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s ease;
}
.chat-new:hover { background: var(--blue-dark); }

/* ---------- composer ---------- */
.chat-error { display: none; padding: 0 18px 10px; font-size: 12.5px; color: var(--red); background: var(--bg-soft); }
.chat-error.show { display: block; }
.chat-composer {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-top: 1px solid var(--line); background: var(--bg-soft);
}
.chat-input {
    flex: 1; min-width: 0;
    border: 1px solid var(--line); border-radius: 999px;
    background: #fff; padding: 10px 16px;
    font: inherit; font-size: 14px; color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chat-input::placeholder { color: var(--muted); }
.chat-count { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-count.warn { color: var(--amber); }
.chat-send { flex: none; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
    .chat-head { padding: 12px 14px; }
    .chat-scroll { height: 58vh; padding: 14px 12px 16px; }
    .chat-msg { max-width: 94%; }
    .chat-msg-avatar { width: 28px; height: 28px; font-size: 11px; }
    .chat-msg-bubble { padding: 8px 12px 9px; }
    .chat-composer { padding: 10px 10px 12px; gap: 8px; }
    .chat-input { padding: 9px 14px; }
    .chat-send { padding-left: 14px; padding-right: 14px; }
    .chat-new { bottom: 78px; }
    .news-reactions { padding: 16px 20px 18px; }
    .chat-react-menu { left: auto; right: 0; }
}

/* ---------- hidden-attribute safety ----------
   explicit display values above must never beat the [hidden] state
   (menus, floating pills) — keep them truly invisible. */
.chat-react-menu[hidden], .chat-new[hidden], .chat-count[hidden], .chat-empty[hidden] { display: none !important; }

/* ==================================================================
   REVIEWS / TESTIMONIALS
   ================================================================== */

/* ---------- read-only star row (helper stars()) ---------- */
.stars { display: inline-flex; gap: 2px; vertical-align: -2px; }
.stars .st {
    width: 16px; height: 16px; flex: none;
    background: #dbe1ea;
    clip-path: polygon(50% 0, 61.8% 35.2%, 98% 35.2%, 68.7% 57.2%, 79.4% 91.2%,
                        50% 70%, 20.6% 91.2%, 31.3% 57.2%, 2% 35.2%, 38.2% 35.2%);
}
.stars .st.on { background: #f5a623; }
.stars .st.part { background: linear-gradient(90deg, #f5a623 var(--pct, 50%), #dbe1ea var(--pct, 50%)); }
.badge .stars .st { width: 12px; height: 12px; }

/* ---------- review card (landing marquee, reviews page, grids) ---------- */
.review-card {
    display: flex; flex-direction: column; gap: 10px;
    margin: 0; background: #fff;
    border: 1px solid var(--line); border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.review-card > .stars { margin-bottom: 2px; }
.review-text { margin: 0; font-size: 14px; line-height: 1.62; color: var(--ink-2); text-wrap: pretty; min-height: calc(2 * 1.62em); }

/* 50-char teaser; the hidden .rt-full feeds the "Read more" modal */
.review-text .rt-full { display: none; }

/* "Read more" — bottom row of the card, right side, opposite the login */
.review-more {
    margin: 0 0 0 auto; padding: 0; flex: none; align-self: center;
    background: none; border: none; cursor: pointer;
    font: inherit; font-size: 12.5px; font-weight: 700;
    color: var(--blue); line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.review-more:hover, .review-more:focus-visible { text-decoration: underline; }
.review-more:focus-visible { outline: none; }

.review-author { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.review-avatar { width: 34px; height: 34px; font-size: 12px; flex: none; }
.review-author-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.review-author-meta strong { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.review-author-meta time { font-size: 12px; color: var(--muted); }

/* ---------- static grid (reviews page / few reviews) ---------- */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }

/* ---------- landing marquee (two tracks, seamless loop) ---------- */
.reviews-marquee { align-items: flex-start; display: flex; gap: 18px; overflow: hidden; padding: 6px 0 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}
.reviews-marquee .review-card { width: 330px; flex: none; }
.reviews-track {
    flex: none; display: flex; gap: 18px; width: max-content; align-items: flex-start;
    animation: reviewsScroll var(--dur, 60s) linear infinite;
}
.reviews-marquee:hover .reviews-track,
.reviews-marquee:focus-within .reviews-track { animation-play-state: paused; }
@keyframes reviewsScroll { to { transform: translateX(calc(-100% - 18px)); } }
@media (prefers-reduced-motion: reduce) {
    .reviews-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
    .reviews-track { animation: none; }
}

/* ---------- public reviews page: summary ---------- */
.reviews-summary {
    display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center;
    max-width: 680px; margin: 0 auto;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 22px 30px;
}
.rs-avg { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.rs-num { font-size: 46px; font-weight: 800; color: var(--ink); line-height: 1; }
.rs-avg .stars .st { width: 21px; height: 21px; }
.rs-count { font-size: 13px; color: var(--muted); }
.rs-dist { display: flex; flex-direction: column; gap: 7px; }
.rs-row { display: grid; grid-template-columns: 32px 1fr 30px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.rs-star { font-weight: 700; color: var(--ink-2); text-align: right; }
.rs-bar { display: block; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.rs-fill { display: block; height: 100%; border-radius: 99px; background: #f5a623; }
.rs-n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- review modal ("Read more" popup, full review) ---------- */
.review-modal-card { max-width: 560px; }
.review-modal-card .modal-title .review-avatar { width: 30px; height: 30px; font-size: 11px; }
.rm-date { font-size: 12px; font-weight: 500; color: var(--muted); }
.review-modal-body { padding: 4px 22px 22px; }
.review-modal-body .stars { margin-top: 14px; }
.review-modal-body .stars .st { width: 19px; height: 19px; }
.review-modal-body .review-text {
    min-height: 0; margin: 12px 0 0;
    font-size: 15px; line-height: 1.7;
}
body.review-modal-open .reviews-track { animation-play-state: paused; }

/* ---------- cabinet: leave-a-review form ---------- */
.star-field label { display: block; }
.star-picker { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.star-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.star-opt {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.star-opt svg { width: 26px; height: 26px; fill: none; stroke: #cbd5e1; stroke-width: 1.6; transition: fill .1s, stroke .1s; }
.star-opt.on svg, .star-opt.hov svg { fill: #f5a623; stroke: #f5a623; }
.star-input:focus-visible + .star-opt svg { fill: rgba(245, 166, 35, .15); stroke: #f5a623; }
.star-live { margin-top: 7px; }
.review-count { font-weight: 600; }
.review-count.warn { color: var(--red); }
.review-mine-meta {
    display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
    margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.review-mine-meta a { color: var(--blue); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .reviews-marquee .review-card { width: min(300px, 76vw); }
    .reviews-summary { grid-template-columns: 1fr; gap: 18px; padding: 20px 22px; }
    .rs-avg { flex-direction: row; gap: 12px; }
    .rs-num { font-size: 38px; }
    .reviews-grid { grid-template-columns: 1fr; }
    .review-author-meta strong { max-width: 200px; }
}
