/* Montserrat, self-hosted (no Google Fonts request; see public/fonts/OFL.txt) */
@font-face { font-family: Montserrat; font-style: normal; font-weight: 500 600; font-display: swap; src: url("../fonts/montserrat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* PushNotification dashboard. Hand-written, no build step. */
:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f1f3f9;
    --border: #e3e6ef;
    --text: #0e2140;
    --muted: #6b7280;
    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-tint: #e8f0ff;
    --brand-text: #1d4ed8;
    --ok: #0f8a5f;
    --ok-tint: #e3f6ee;
    --warn: #a86200;
    --warn-tint: #fff3df;
    --danger: #c9323a;
    --danger-tint: #fdeaea;
    --code-bg: #0f1222;
    --code-text: #e4e7f5;
    --shadow: 0 1px 2px rgba(16, 20, 40, .04), 0 8px 24px rgba(16, 20, 40, .06);
    --radius: 16px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0e17;
        --surface: #151826;
        --surface-2: #1c2032;
        --border: #272c42;
        --text: #eef0f8;
        --muted: #9aa1b8;
        --brand: #4f86ff;
        --brand-hover: #6b9bff;
        --brand-tint: #14234a;
        --brand-text: #9dbcff;
        --ok: #3ccf95;
        --ok-tint: #10291f;
        --warn: #f0b450;
        --warn-tint: #2c2210;
        --danger: #ff6b72;
        --danger-tint: #33161a;
        --code-bg: #090b14;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
p { margin: 0; }
code { font: 13px/1.5 ui-monospace, "SF Mono", Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Brand */
.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand:hover { text-decoration: none; }
.wordmark { display: inline-flex; align-items: center; font: 500 21px/1 Montserrat, ui-sans-serif, system-ui, sans-serif; letter-spacing: .14em; color: var(--text); white-space: nowrap; }
.wordmark .mark { height: .74em; width: auto; color: var(--brand); margin: 0 .16em 0 .14em; transform: translateY(-.01em); }
.auth-brand .wordmark { font-size: 28px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
    background: var(--brand); color: #fff; font: 600 14px/1 inherit; cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.is-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.is-ghost:hover { background: var(--surface-2); }
.btn.is-danger { background: var(--danger); }
.btn.is-danger:hover { filter: brightness(1.08); }
.btn.is-small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.is-large { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.is-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-done { color: var(--ok); }

/* Cards, alerts, pills */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 20px; }
.card-head { margin-bottom: 16px; display: grid; gap: 4px; }
.card-foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.card.is-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; }
.alert.is-ok { background: var(--ok-tint); color: var(--ok); }
.alert.is-error { background: var(--danger-tint); color: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.is-small { height: 24px; padding: 0 10px; font-size: 12px; }
.pill.is-ok { background: var(--ok-tint); color: var(--ok); }
.pill.is-bad { background: var(--danger-tint); color: var(--danger); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.pill.is-ok .pill-dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.stat-chip { display: inline-flex; align-items: baseline; gap: 6px; height: 30px; padding: 5px 12px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-text); font-size: 13px; }
.stat-chip strong { font-size: 15px; }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
label { font-weight: 600; font-size: 14px; }
.input {
    width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.help { color: var(--muted); font-size: 13px; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.link-small { font-size: 13px; font-weight: 500; }
.check { display: inline-flex; align-items: flex-start; gap: 12px; font-weight: 500; cursor: pointer; line-height: 1.5; }
.check input {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 20px; height: 20px; margin: 2px 0 0; border-radius: 6px;
    border: 1.5px solid var(--border); background: var(--surface);
    display: grid; place-content: center; cursor: pointer;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.check input::after {
    content: ""; width: 10px; height: 6px; margin-top: -2px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0); transition: transform .15s ease-out;
}
.check input:hover { border-color: var(--brand); }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-tint); border-color: var(--brand); }
.check input:disabled { opacity: .5; cursor: not-allowed; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-inline-center { display: flex; justify-content: center; margin-top: 10px; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 600; }
.switch small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; margin-top: 1px; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 40px 16px; }
.auth-card { width: min(420px, calc(100vw - 32px)); padding: 30px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 24px; }
.auth-card .form { margin-top: 8px; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-text); }
.auth-icon svg { width: 26px; height: 26px; }
.auth-foot { color: var(--muted); font-size: 14px; }
body.is-guest { background: radial-gradient(1200px 600px at 50% -10%, var(--brand-tint), transparent 60%), var(--bg); }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar.is-clear { position: sticky; top: 0; background: transparent; border-bottom-color: transparent; transition: background .2s, border-color .2s, box-shadow .2s; }
.topbar.is-clear.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--border); box-shadow: 0 6px 24px rgba(10, 14, 30, .08); }
.topbar-in { height: 64px; display: flex; align-items: center; gap: 24px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.is-on { background: var(--brand-tint); color: var(--brand-text); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-user form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; }
.topbar-name { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { padding-top: 28px; padding-bottom: 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2.is-tight { gap: 16px; }
.grid-2 > .card + .card, .app-grid > .card + .card, .plan-grid > .card + .card { margin-top: 0; }

/* Apps list */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.app-card { display: grid; gap: 14px; color: var(--text); transition: border-color .15s, transform .15s; }
.app-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.app-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.app-card-top h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-foot { color: var(--muted); font-size: 13px; }
.kv { margin: 0; display: grid; gap: 8px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; }
.empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 48px 22px; }
.empty-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.empty-ico .mark { width: 30px; height: auto; }

/* Keys */
.keys { margin: 0; display: grid; gap: 4px; }
.key-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; }
.key-row dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.key-row dd { margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; }
.key-row code { min-width: 0; }

/* Test sender */
.test-form { display: flex; gap: 10px; }
.live-state { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.live-state.is-on { color: var(--ok); }
.live-state.is-off { color: var(--danger); }
.live-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.live-log li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.live-log li.is-new { animation: arrive .5s ease; }
.live-log time { color: var(--muted); font-size: 12px; white-space: nowrap; }
@keyframes arrive { from { background: var(--ok-tint); transform: translateY(-4px); opacity: 0; } }

/* Code + tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px; font: 600 13px/1 inherit; cursor: pointer; white-space: nowrap; }
.tab.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { display: grid; gap: 10px; }
.code { position: relative; }
.code pre, .hero-code pre { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 18px; overflow-x: auto; }
.code pre code, .hero-code pre code { background: none; padding: 0; color: inherit; word-break: normal; white-space: pre; }
.code-copy { position: absolute; top: 10px; right: 10px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #e4e7f5; font: 600 12px/1 inherit; cursor: pointer; }
.code-copy:hover { background: rgba(255,255,255,.14); }
.tab-panel + .help { margin-top: 12px; }

/* Modal popups */
.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); color: var(--text); }
.modal::backdrop { background: rgba(10, 12, 24, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-card { position: relative; width: min(440px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; display: grid; gap: 12px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal-card .field { text-align: left; margin-top: 6px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-x svg { width: 18px; height: 18px; }
.modal-ico { justify-self: center; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-text); }
.modal-ico.is-warn { background: var(--warn-tint); color: var(--warn); }
.modal-ico.is-danger { background: var(--danger-tint); color: var(--danger); }
.modal-ico svg { width: 26px; height: 26px; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

/* Landing */
.hero { text-align: center; padding-top: 56px; padding-bottom: 40px; display: grid; justify-items: center; gap: 18px; }
.kicker { display: inline-block; letter-spacing: .02em; padding: 6px 12px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-text); font-size: 13px; font-weight: 700; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); max-width: 860px; letter-spacing: -.025em; }
.grad { background: linear-gradient(90deg, var(--brand), #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 640px; color: var(--muted); font-size: 18px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.hero-code { width: min(720px, 100%); text-align: left; padding: 0; overflow: hidden; margin-top: 18px; background: var(--code-bg); border-color: transparent; }
.hero-code pre { border-radius: 0; font-size: 14px; }
.code-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; color: #8d93ad; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.code-head span:last-child { margin-left: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3a3f58; }
.hero-code .c { color: #7b82a3; } .hero-code .k { color: #c4a8ff; } .hero-code .s { color: #8ee0b5; }
.steps-section { scroll-margin-top: 64px; padding-top: 56px; padding-bottom: 36px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; position: relative; counter-reset: none; }
.steps::before { content: ""; position: absolute; top: 52px; left: calc(16.66% + 10px); right: calc(16.66% + 10px); height: 2px; background: linear-gradient(90deg, var(--brand), #06b6d4); opacity: .35; z-index: 0; }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 24px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s, box-shadow .2s; }
.step:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 18px 40px color-mix(in srgb, var(--brand) 18%, transparent); }
.step-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), #06b6d4); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent); margin-bottom: 6px; }
.step-ico svg { width: 24px; height: 24px; }
.step-num { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.step h3 { font-size: 19px; }
.step p { color: var(--muted); max-width: 300px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 20px; margin-bottom: 40px; }
.cta-band h2 { font-size: 22px; margin-bottom: 4px; }
.site-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 32px; border-top: 1px solid var(--border); font-size: 14px; }
/* Boxes and lines that sit on .wrap line up with the content inside the 16px side gutter */
.wrap.cta-band, .wrap.site-foot { width: calc(100% - 32px); max-width: 1088px; }
.wrap.site-foot { padding-left: 0; padding-right: 0; }

@media (max-width: 860px) {
    .grid-2, .steps { grid-template-columns: 1fr; }
    .steps::before { display: none; }
    .topbar-name { display: none; }
}
@media (max-width: 560px) {
    .topbar-in { gap: 12px; }
    .wordmark { font-size: 17px; letter-spacing: .1em; }
    .card { padding: 18px; }
    .test-form { flex-direction: column; }
    .key-row { grid-template-columns: 1fr; gap: 2px; }
    .modal-actions { flex-direction: column-reverse; }
}

/* ---------- Plans, usage, owner ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid-3.is-tight { gap: 16px; }
.grid-3 + .card, .grid-4 + .grid-2, .grid-3 + .grid-2, .grid-4 + .card, .card + .grid-3 { margin-top: 20px; }
.grid-3 > .card + .card, .grid-4 > .card + .card { margin-top: 0; }
.stat { display: grid; gap: 4px; align-content: start; }
.stat.is-link { color: var(--text); transition: border-color .15s; }
.stat.is-link:hover { text-decoration: none; border-color: var(--brand); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .4s; }
.meter span.is-warn { background: var(--warn); }
.meter span.is-full { background: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.bars.is-short { height: 140px; gap: 10px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bar span { width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 65%, #06b6d4)); }
.bar span.is-zero { background: var(--surface-2); }
.bar small { color: var(--muted); font-size: 11px; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }
.card-head.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.plan-card + .plan-card { margin-top: 0; }
.plan-card.is-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.plan-card.is-current { background: color-mix(in srgb, var(--brand-tint) 45%, var(--surface)); }
.plan-flag { position: absolute; top: -11px; left: 22px; padding: 3px 10px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.plan-card h3 { font-size: 19px; }
.plan-tagline { min-height: 2.9em; font-size: 14px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 34px; letter-spacing: -.02em; }
.plan-price span { color: var(--muted); }
.plan-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; font-size: 14px; flex: 1; align-content: start; }
.plan-list li { padding-left: 24px; position: relative; color: var(--muted); }
.plan-list li strong { color: var(--text); }
.plan-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-tint); }
.plan-list li::after { content: ""; position: absolute; left: 5px; top: 6px; width: 4px; height: 8px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.plan-note { text-align: center; }
.btn.is-static { cursor: default; pointer-events: none; }
.alert.is-warn { background: var(--warn-tint); color: var(--warn); }
.plan-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--brand-tint); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.pill.is-warn { background: var(--warn-tint); color: var(--warn); }
.pill.is-off { background: var(--surface-2); color: var(--muted); }
.pill.is-owner, .kicker.is-owner { background: #fdf0d5; color: #8a5a00; }
.topnav a.is-owner { color: #b07400; }
.kicker.is-owner { margin-bottom: 8px; }
@media (prefers-color-scheme: dark) {
    .pill.is-owner, .kicker.is-owner { background: #33270f; color: #f3c76b; }
    .topnav a.is-owner { color: #f3c76b; }
}

.subnav { border-top: 1px solid var(--border); }
.subnav-in { display: flex; gap: 4px; height: 46px; align-items: center; overflow-x: auto; }
.subnav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.subnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.subnav a.is-on { color: var(--text); background: var(--surface-2); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row { text-align: center; padding: 28px 12px; }
.cust { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.cust:hover { text-decoration: none; }
.cust:hover strong { color: var(--brand-text); }
.cust small { display: block; color: var(--muted); font-size: 13px; }
.cust.is-big h1 { margin: 0 0 2px; }
.avatar.is-small { width: 32px; height: 32px; font-size: 13px; flex: none; }
.avatar.is-big { width: 56px; height: 56px; font-size: 22px; flex: none; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { flex: 1 1 240px; width: auto; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; cursor: pointer; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.seg a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.plan-split { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan-split li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.split-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.split-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.action-list { display: flex; flex-wrap: wrap; gap: 10px; }
.action-list form { margin: 0; }
.plan-admin { display: grid; gap: 20px; }
.plan-admin > .card + .card { margin-top: 0; }
.plan-switches { gap: 10px; padding-top: 26px; }
.modal-card.is-wide { width: min(760px, calc(100vw - 32px)); text-align: left; }

.topnav.is-site { margin-left: 8px; }
.hero.is-compact { padding-top: 40px; padding-bottom: 28px; }
.home-pricing { padding-top: 30px; padding-bottom: 10px; }
.section-head { text-align: center; display: grid; justify-items: center; gap: 8px; margin-bottom: 28px; }
.section-head .kicker { width: auto; }
.section-head h2 { font-size: 28px; }
.faq { max-width: 760px; margin: 48px auto 40px; display: grid; gap: 12px; }
.faq h2 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.faq details { padding: 0; }
.faq details + details { margin-top: 0; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 22px 18px; }
.site-foot-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

@media (max-width: 960px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: 1fr; }
    .topnav.is-site { display: none; }
}
@media (max-width: 700px) {
    .topnav { overflow-x: auto; }
    .plan-tag { display: none; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .bars { gap: 2px; }
}

/* ---------- Docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.docs-nav { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; padding: 4px 0; }
.docs-nav-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.docs-nav nav { display: grid; gap: 2px; border-left: 2px solid var(--border); }
.docs-nav a { padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.docs-nav a:hover { color: var(--text); border-left-color: var(--brand); text-decoration: none; }
.docs-body { min-width: 0; max-width: 820px; }
.docs-head { display: grid; gap: 12px; justify-items: start; padding-bottom: 12px; }
.docs-head h1 { font-size: clamp(30px, 4vw, 40px); }
.docs-head .hero-lead { font-size: 17px; max-width: none; }
.docs-body section { padding-top: 32px; scroll-margin-top: 72px; }
.docs-body section + section { border-top: 1px solid var(--border); margin-top: 32px; }
.docs-body h2 { font-size: 24px; margin-bottom: 12px; }
.docs-body p { margin-bottom: 12px; }
.docs-body .help { margin-top: -4px; }
.docs-code { margin: 0 0 14px; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 18px; overflow-x: auto; font-size: 13px; }
.docs-code code { background: none; padding: 0; color: inherit; word-break: normal; white-space: pre; }
.docs-steps, .docs-list { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.docs-steps li::marker { color: var(--brand-text); font-weight: 700; }
.docs .table td { vertical-align: top; }
@media (max-width: 860px) {
    .docs { grid-template-columns: 1fr; gap: 16px; }
    .docs-nav { position: static; max-height: none; }
    .docs-nav nav { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); border-left: 0; }
    .docs-nav a { border-left: 0; padding: 6px 0; }
}

/* ---------- Developers dropdown ---------- */
.topnav.is-site { align-items: center; }
.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: 600 14px/1 inherit; cursor: pointer; }
.menu-btn:hover, .menu.is-open .menu-btn, .menu-btn.is-on { background: var(--surface-2); color: var(--text); }
.menu-btn svg { transition: transform .2s; }
.menu.is-open .menu-btn svg { transform: rotate(180deg); }
.menu-panel {
    position: absolute; top: calc(100% + 10px); left: 50%; z-index: 40; width: 340px;
    display: grid; gap: 2px; padding: 8px; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(10, 14, 30, .18);
    opacity: 0; visibility: hidden; transform: translate(-50%, 6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.menu-panel::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; } /* hover bridge */
.menu.is-open .menu-panel, .menu:hover .menu-panel, .menu:focus-within .menu-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.menu-panel a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; color: var(--text); }
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--surface-2); text-decoration: none; }
.menu-panel strong { display: block; font-size: 14px; }
.menu-panel small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.menu-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-text); }
.menu-ico svg { width: 18px; height: 18px; }

/* ---------- Landing code panel ---------- */
.code-panel { width: min(820px, 100%); margin-top: 22px; padding: 16px; border-radius: 20px; background: var(--code-bg); text-align: left; display: grid; gap: 14px; box-shadow: 0 30px 70px rgba(10, 14, 40, .28); border: 1px solid rgba(255, 255, 255, .06); }
.code-group { border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; }
.code-group-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px 0; color: #e4e7f5; font-weight: 700; font-size: 14px; }
.code-group-head small { color: #8d93ad; font-weight: 500; font-size: 12px; }
.tabs.is-dark { background: transparent; padding: 8px 12px 0; margin: 0; gap: 2px; border-bottom: 1px solid rgba(255, 255, 255, .07); border-radius: 0; width: auto; }
.tabs.is-dark .tab { color: #8d93ad; border-radius: 8px 8px 0 0; padding: 9px 12px; position: relative; }
.tabs.is-dark .tab:hover { color: #e4e7f5; }
.tabs.is-dark .tab.is-on { background: transparent; color: #fff; box-shadow: none; }
.tabs.is-dark .tab.is-on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--brand), #06b6d4); }
.code-pane { margin: 0; padding: 16px; color: #e4e7f5; font: 13px/1.65 ui-monospace, "SF Mono", Consolas, monospace; overflow-x: auto; min-height: 112px; }
.code-pane code { background: none; padding: 0; color: inherit; white-space: pre; word-break: normal; }
.code-pane .c { color: #6f7696; } .code-pane .k { color: #c4a8ff; } .code-pane .s { color: #8ee0b5; }
.code-pane .f { color: #7cc4ff; } .code-pane .v { color: #ffb38a; } .code-pane .n { color: #ffd479; }
.code-panel-more { justify-self: end; color: #9dbcff; font-size: 13px; font-weight: 600; padding: 0 4px 2px; }
@media (max-width: 560px) {
    .code-panel { padding: 10px; border-radius: 16px; }
    .code-pane { font-size: 12px; }
}

/* Bot protection */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-note { color: var(--muted); font-size: 12px; text-align: center; }
.captcha-note a { color: inherit; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden; }

.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.grid-5 + .grid-2 { margin-top: 20px; }
.grid-5 > .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .grid-5 { grid-template-columns: 1fr; } }

.block { display: block; }
.nowrap { white-space: nowrap; }
.input.is-auto { flex: 0 1 200px; }
.check.is-small { font-size: 13px; color: var(--muted); }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; }
.copy-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.settings-card { scroll-margin-top: 140px; }
.plan-tag.is-owner { background: #fdf0d5; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .plan-tag.is-owner { background: #33270f; color: #f3c76b; } }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(10, 14, 30, .25); }
.consent-text { display: grid; gap: 2px; font-size: 14px; }
.consent-text p { color: var(--muted); }
.consent-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) { .consent { flex-direction: column; align-items: stretch; } .consent-actions .btn { flex: 1; } }

/* Settings tabs */
.seg.is-tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; color: var(--muted); font: 600 13px/1 inherit; cursor: pointer; white-space: nowrap; }
.seg.is-tabs button:hover { color: var(--text); }
.seg.is-tabs button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.is-tabs { margin-bottom: 18px; }
.settings-sub { font-size: 16px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.switch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.test-mail { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mailer-box { display: grid; gap: 16px; }

/* Consistent gap between any two blocks of cards on a page */
.page > :is(.card, .grid-2, .grid-3, .grid-4, .grid-5, .plan-admin, .app-grid) + :is(.card, .grid-2, .grid-3, .grid-4, .grid-5, .plan-admin, .app-grid) { margin-top: 20px; }

/* Two-step sign-in */
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; margin: 6px 0 12px; }
.qr-box svg { display: block; width: 180px; height: 180px; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; list-style: none; padding: 14px 16px; margin: 0 0 16px; background: var(--surface-2); border-radius: 12px; font-size: 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.error-card { text-align: center; }
.error-code { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin: 0 0 6px; }

/* Legal pages */
.legal { max-width: 780px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { line-height: 1.65; color: var(--text); }
.prose ul { padding-left: 22px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 16px; margin: 36px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; }
.legal-nav a.is-on { font-weight: 700; }
.form-actions.is-start { justify-content: flex-start; }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-zone h3 { font-size: 16px; margin: 0 0 4px; color: var(--danger); }
