:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --glow: rgba(15, 118, 110, 0.16);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --good: #006300;
  --bad: #b42828;
  --critical: #d03b3b;
  --warning-bg: #fff4dc;
  --error-bg: #fdeaea;
  --success-bg: #e8f5e8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #9a9890;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #2dd4bf;
    --accent-ink: #042f2e;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --glow: rgba(45, 212, 191, 0.14);
    --series-1: #3987e5;
    --series-2: #d95926;
    --good: #0ca30c;
    --bad: #e66767;
    --critical: #e66767;
    --warning-bg: #3a2e12;
    --error-bg: #3a1a1a;
    --success-bg: #14301a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #9a9890;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #2dd4bf;
  --accent-ink: #042f2e;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --glow: rgba(45, 212, 191, 0.14);
  --series-1: #3987e5;
  --series-2: #d95926;
  --good: #0ca30c;
  --bad: #e66767;
  --critical: #e66767;
  --warning-bg: #3a2e12;
  --error-bg: #3a1a1a;
  --success-bg: #14301a;
}

/* Manrope (SIL Open Font License, public/fonts/Manrope-OFL.txt) for headings and headline numbers. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/static/fonts/manrope-latin.woff2') format('woff2');
}
:root { --font-display: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; font-weight: 600; }
h1, h2, h3, .brand, .hero-value, .lp-price, .lp-eyebrow, .plan-flag { font-family: var(--font-display); }
h1, .hero-value, .lp-price { font-weight: 700; }
h2 { font-size: 15px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
/* Long identifiers (Stripe price IDs, addresses) break rather than widen a phone screen. */
code { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.inline { display: inline; margin: 0; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
/* In the iPhone app the page scrolls on under the status bar (the clock and battery), above where the header
   sticks, so the header's background reaches up and covers that strip. */
html[data-app] .topbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 200px; background: var(--surface); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); font-size: 16px; display: inline-flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; }
.brand-mark .bm-bg { fill: var(--accent); }
.brand-mark .bm-fg { fill: var(--accent-ink); }
/* The Confluence mark: three streams (accounts) flowing into one screen. */
.brand-mark .bm-streams { fill: none; stroke: var(--accent-ink); stroke-width: 2.4; stroke-linecap: round; }
.brand-mark .bm-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-menu { display: none; }
.nav-menu .menu-panel { left: 0; right: auto; }
.nav-menu .menu-panel a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.topbar-actions { display: flex; gap: 6px; }

.page { max-width: 1280px; margin: 0 auto; padding: 16px 16px 48px; }
.page-title { font-size: 22px; margin: 8px 0 12px; }
.sync-line { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot-ok { background: #0ca30c; }
.dot-partial { background: #fab219; }
.dot-failed { background: var(--critical); }
.dot-running { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .dot-running { animation: none; } }

.btn { font: inherit; font-size: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 8px; cursor: pointer; display: inline-block; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.block { display: block; width: 100%; }
.btn.block { text-align: center; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 4px 0 6px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.field.block { margin-bottom: 12px; }
.field.grow { flex: 1; min-width: 220px; }
input, select { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--axis); border-radius: 8px; padding: 7px 10px; min-height: 36px; max-width: 100%; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters .export { margin-left: auto; }
.range-caption { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.js .custom-range.hidden, .js .apply-btn.hidden { display: none; }
.filters.is-loading { opacity: 0.6; pointer-events: none; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 8px 0; font-size: 14px; border: 1px solid var(--border); }
.flash-success { background: var(--success-bg); }
.flash-error { background: var(--error-bg); }
.flash-warning { background: var(--warning-bg); }
.flash ul { margin: 6px 0; padding-left: 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .muted { font-size: 13px; }
.empty { text-align: center; padding: 40px 16px; }
.empty p { color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }

.hero { margin: 4px 0 16px; }
.hero-label { font-size: 14px; color: var(--ink-2); }
.hero-value { font-size: 48px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 2px 0 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.tile-label { font-size: 13px; color: var(--ink-2); }
.tile-value { font-size: 24px; font-weight: 600; margin: 4px 0 2px; }
.tile-delta, .tile-note { font-size: 12.5px; color: var(--muted); }
.tile-delta.good { color: var(--good); }
.tile-delta.bad { color: var(--bad); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data thead th { font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
table.data tfoot th { border-top: 1px solid var(--axis); border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }
.table-view { margin-top: 12px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--ink-2); }
.table-view table { margin-top: 8px; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); vertical-align: middle; }
.status { font-weight: 600; }
.status-critical { color: var(--critical); }

.add-account { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.help { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.help summary { cursor: pointer; color: var(--accent); }
.help ol { padding-left: 20px; }
.help li { margin-bottom: 6px; }
.account-list { display: flex; flex-direction: column; }
.account-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--grid); flex-wrap: wrap; }
.account-row:first-child { border-top: none; }
.account-name { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.account-main .muted { font-size: 13px; }
.account-edit summary { list-style: none; }
.account-edit summary::-webkit-details-marker { display: none; }
.account-edit[open] { flex-basis: 100%; }
.account-edit form { max-width: 460px; margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; font-size: 14px; line-height: 1.4; }
.check > input { margin-top: 2px; flex: none; }
.check input { min-height: auto; }
.danger-zone { border-top: 1px solid var(--grid); padding-top: 12px; margin-top: 16px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { font-size: 22px; }
.login-card p { margin: 4px 0 16px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.footer .footer-links { margin-top: 6px; }
.footer .credit { margin-top: 6px; }
.footer .version { margin-top: 4px; font-size: 11px; }

/* Charts */
.chart { position: relative; width: 100%; min-height: 40px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .bar-label { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .cat-label { fill: var(--ink-2); font-size: 12.5px; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { stroke: var(--surface); stroke-width: 2; }
.chart .bar { transition: opacity 0.1s; }
.chart .bar.dim { opacity: 0.55; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; flex-wrap: wrap; }
.legend-key { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); white-space: nowrap; z-index: 5; display: none; }
.tooltip .tt-title { color: var(--muted); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tooltip .tt-name { color: var(--ink-2); }

@media (max-width: 640px) {
  .hero-value { font-size: 36px; }
  .topbar-inner { gap: 8px; }
  .topbar-inner > .nav { display: none; }
  .nav-menu { display: block; order: 3; flex-basis: 100%; }
  .nav-menu > summary { width: 100%; text-align: left; }
  .nav-menu .menu-panel { width: 100%; }
  .topbar-actions { margin-left: auto; }
  .topbar:not(.public) .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .filters .export { margin-left: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .topbar, .filters, .table-view summary, .footer { display: none; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
}

/* Account menu, notices */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.menu-panel a, .menu-link { display: block; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); font: inherit; font-size: 14px; background: none; border: none; cursor: pointer; width: 100%; }
.menu-panel a:hover, .menu-link:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel form { margin: 0; }
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--grid); margin-bottom: 4px; font-size: 13px; }
.notice { background: var(--warning-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 8px 0; font-size: 14px; }
.notice-bad { background: var(--error-bg); }
.link-button { background: none; border: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.badge-warn { background: var(--warning-bg); }
.small { font-size: 12.5px; }
.form-narrow { max-width: 460px; }
.card-links { margin: 14px 0 0; font-size: 14px; text-align: center; }
.login-card .brand { display: inline-flex; margin-bottom: 12px; }
.login-card h1 { margin-bottom: 4px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 12px 22px; font-size: 16px; }

/* Public site */
.topbar.public .nav { justify-content: center; }
.landing { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.lp-hero { text-align: center; padding: 56px 0 24px; }
.lp-hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.03em; }
.lp-lead { max-width: 680px; margin: 18px auto 24px; font-size: 18px; color: var(--ink-2); }
.lp-cta { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lp-cta .muted { font-size: 14px; }
.lp-shot { display: block; width: 100%; height: auto; margin: 40px auto 0; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12); }
.lp-section { padding: 56px 0 8px; }
.lp-section h2, .lp-final h2 { font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -0.02em; text-align: center; margin-bottom: 8px; }
.lp-sub { text-align: center; color: var(--ink-2); margin: 0 auto 24px; max-width: 640px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.lp-card h3, .lp-plan h3 { font-size: 17px; margin: 0 0 6px; }
.lp-card p { margin: 0; color: var(--ink-2); }
.lp-note { text-align: center; color: var(--ink-2); margin-top: 20px; }
.lp-steps { max-width: 640px; margin: 24px auto 0; padding-left: 22px; font-size: 16px; }
.lp-steps li { margin-bottom: 12px; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.lp-plan { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.lp-plan ul { padding-left: 18px; color: var(--ink-2); margin: 8px 0 16px; flex: 1; }
.lp-plan form { margin: 0; }
.lp-plan > form:last-child, .lp-plan > .btn:last-child { margin-top: auto; }
.lp-plan-current { border-color: var(--accent); }
.plan-actions { margin-top: auto; display: grid; gap: 8px; }
.plan-actions form { margin: 0; }
.founders { border-color: var(--accent); }
.lp-plans-2 { max-width: 640px; margin-left: auto; margin-right: auto; }
.lp-founders { text-align: center; }
.lp-founders .lp-plan { text-align: left; }
.lp-price { font-size: 34px; font-weight: 600; margin: 4px 0; }
.lp-price span { font-size: 15px; color: var(--muted); font-weight: 400; }
.lp-faq { max-width: 720px; margin: 0 auto; border-bottom: 1px solid var(--grid); padding: 14px 0; }
.lp-faq summary { cursor: pointer; font-weight: 600; }
.lp-faq p { color: var(--ink-2); margin: 8px 0 0; }
#faq h2 { margin-bottom: 16px; }
.lp-final { text-align: center; padding: 64px 0 24px; }
.lp-final h2 { margin-bottom: 20px; }
.public-footer { display: flex; flex-direction: column; gap: 6px; padding: 24px 16px 32px; border-top: 1px solid var(--grid); }
.legal { max-width: 760px; }
.legal h1 { margin: 24px 0 8px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
@media (max-width: 640px) {
  .topbar.public .nav { display: none; }
  .lp-hero { padding-top: 32px; }
  .lp-lead { font-size: 16px; }
}
.team-actions { white-space: nowrap; text-align: right; }
.team-actions form { display: inline; }

/* Brand and conversion */
/* Show/Hide on password fields (app.js). The button sits inside the field, at its right end. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 72px; }
.pw-toggle { position: absolute; top: 0; right: 0; bottom: 0; min-width: 64px; padding: 0 12px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 0 8px 8px 0; }
.pw-toggle:hover { text-decoration: underline; }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lp-hero { position: relative; isolation: isolate; }
.lp-hero::before { content: ""; position: absolute; z-index: -1; inset: -24px -16px 0; background:
  radial-gradient(ellipse 60% 50% at 50% 0%, var(--glow), transparent 70%),
  linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
  linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%); opacity: 0.9; }
.lp-eyebrow { display: inline-block; margin: 0 0 16px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border); }
.lp-accent { color: var(--accent); }
.lp-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 0; margin: 20px 0 0; font-size: 14px; color: var(--ink-2); }
.lp-trust li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 6px; }
.lp-frame { margin: 40px auto 0; padding: 0; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.25), 0 0 0 6px var(--accent-soft); overflow: hidden; }
.lp-frame-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-frame-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--axis); }
.lp-frame .lp-shot { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.lp-card, .lp-plan { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.lp-card:hover, .lp-plan:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18); }
@media (prefers-reduced-motion: reduce) { .lp-card, .lp-plan { transition: none; } .lp-card:hover, .lp-plan:hover { transform: none; } }

.period-toggle { display: flex; justify-content: center; gap: 0; margin: 0 auto 24px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); width: max-content; max-width: 100%; }
.period-toggle label { position: relative; cursor: pointer; }
.period-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.period-toggle label > span { display: inline-block; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.period-toggle input:checked + span { background: var(--accent); color: var(--accent-ink); }
.period-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.period-save { font-size: 12px; font-weight: 600; margin-left: 4px; opacity: 0.85; }
.price-year { display: none; }
.lp-pricing:has(input[value="year"]:checked) .price-year { display: block; }
.lp-pricing:has(input[value="year"]:checked) .price-month { display: none; }

.lp-plan { position: relative; }
.lp-plan-featured { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.plan-flag { position: absolute; top: -11px; left: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.plan-for { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.lp-plan-claim { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.badge-brand { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.spots { margin: 4px 0 14px; }
.spots p { margin: 4px 0 0; }
.spots-bar { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); appearance: none; -webkit-appearance: none; }
.spots-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.spots-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.spots-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* Dashboard UX */
.range-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); }
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (min-width: 641px) {
  .tiles-overview { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tiles-overview > .tile { grid-column: span 3; }
  .tiles-overview > .tile:nth-child(n+5) { grid-column: span 4; }
}
@media (max-width: 640px) {
  .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill-ok { background: var(--success-bg); color: var(--good); }
.pill-ok::before { background: var(--good); }
.pill-bad { background: var(--error-bg); color: var(--bad); }
.pill-bad::before { background: var(--critical); }
.pill-warn { background: var(--warning-bg); }
.pill-warn::before { background: #fab219; }
.pill-pending::before { background: var(--accent); }
.account-name { flex-wrap: wrap; }
.account-main { flex: 1; min-width: 0; }
.account-net { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; min-width: 120px; }
.account-net-value { font-weight: 600; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.empty-state { border: 1px dashed var(--axis); border-radius: var(--radius); padding: 20px; background: var(--surface-2); }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }

.optional { color: var(--muted); font-weight: 400; }
.signup-layout { display: grid; gap: 32px; align-items: center; width: 100%; max-width: 860px; }
.signup-pitch { display: none; }
.signup-pitch h2 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; margin: 16px 0 16px; }
.pitch-list { list-style: none; padding: 0; margin: 0; color: var(--ink-2); }
.pitch-list li { padding-left: 26px; position: relative; margin-bottom: 12px; }
.pitch-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.signup .login-card { justify-self: center; }
@media (min-width: 820px) {
  .signup-layout { grid-template-columns: 1fr 360px; }
  .signup-pitch { display: block; }
  .signup-pitch + .login-card > .brand { display: none; }
}
@media (max-width: 640px) {
  .account-main { flex-basis: calc(100% - 70px); }
  .account-net { order: 3; flex-basis: 100%; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 6px; min-width: 0; text-align: left; }
}

/* Polish: theme switch, toasts, sync progress, stacked tables, FAQ, social proof */
.theme-toggle { display: none; line-height: 0; padding: 7px 9px; }
.theme-toggle .ti { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: none; }
.theme-toggle .ti-fill, .theme-toggle .ti-dark { fill: currentColor; }
.theme-toggle .ti-dark { stroke: none; }
:root:not([data-theme]) .theme-toggle .ti-auto, :root[data-theme="light"] .theme-toggle .ti-light, :root[data-theme="dark"] .theme-toggle .ti-dark { display: block; }
.js .theme-toggle { display: inline-block; }

.toasts { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { position: relative; margin: 0; padding-right: 40px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.25); background-color: var(--surface); animation: toast-in 0.25s ease-out; transition: opacity 0.3s, transform 0.3s; }
.toast.flash-success { background: var(--success-bg); }
.toast.flash-warning { background: var(--warning-bg); }
.toast-out { opacity: 0; transform: translateY(8px); }
.toast-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: var(--surface-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.sync-line.is-running { position: relative; padding-bottom: 6px; }
.sync-line.is-running::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-soft) 0%, var(--accent) 50%, var(--accent-soft) 100%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; transition: none; }
  .sync-line.is-running::after { animation: none; background: var(--accent); }
}

@media (max-width: 640px) {
  .table-wrap:has(table.stack) { overflow: visible; }
  table.data.stack thead { display: none; }
  table.data.stack, table.data.stack tbody, table.data.stack tfoot, table.data.stack tr { display: block; width: 100%; }
  table.data.stack tr { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  table.data.stack tbody tr:hover { background: var(--surface); }
  table.data.stack td, table.data.stack th { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--grid); white-space: normal; text-align: right; }
  table.data.stack tr > :last-child { border-bottom: 0; }
  table.data.stack td::before, table.data.stack th::before { content: attr(data-label); color: var(--muted); font-weight: 400; text-align: left; }
  table.data.stack tr > :first-child { font-weight: 600; font-size: 15px; text-align: left; }
  table.data.stack tr > :first-child::before { content: none; }
  table.data.stack tfoot tr { border-color: var(--axis); }
  table.data.stack td:empty, table.data.stack th:empty { display: none; }
  /* A cell with controls (Admin's Complimentary forms) wraps them under its label instead of widening the card. */
  table.data.stack td { flex-wrap: wrap; }
  table.data.stack .comp-plan { flex-basis: 100%; justify-content: flex-end; }
}

.lp-faqs { max-width: 720px; margin: 0 auto; }
.lp-faqs .lp-faq { max-width: none; break-inside: avoid; }
@media (min-width: 900px) {
  .lp-faqs { max-width: 1000px; columns: 2; column-gap: 40px; }
}

.lp-proof { text-align: center; }
.lp-usage { font-size: 18px; color: var(--ink-2); margin: 0 auto 8px; }
.lp-usage strong { color: var(--accent); font-size: 22px; }
.lp-quotes { text-align: left; }
.lp-quote { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.lp-quote blockquote { margin: 0; }
.lp-quote blockquote p { color: var(--ink); font-size: 15.5px; }
.lp-quote figcaption { font-size: 14px; }

/* First import: placeholders instead of a page of $0s */
.importing { margin: 8px 0 16px; }
.importing-note { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.importing-note h2 { font-size: 17px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: skeleton 1.4s ease-in-out infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); } }
@keyframes skeleton { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; display: none; } }
.sk-line { height: 12px; margin: 6px 0; }
.sk-short { width: 40%; }
.sk-value { height: 26px; width: 70%; margin: 8px 0; }
.sk-hero { height: 48px; width: min(340px, 80%); margin: 6px 0 10px; }
.sk-chart { height: 220px; }
.ladder-note { margin: -6px 0 6px; color: var(--ink-2); }

/* Settings: security */
.sub-head { font-size: 15px; margin: 18px 0 6px; }
.sub-head:first-of-type { margin-top: 4px; }
.totp-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0; }
.totp-setup .qr { width: 200px; height: 200px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.totp-setup .qr svg { width: 100%; height: 100%; display: block; }
.secret { font-size: 15px; letter-spacing: 0.06em; word-break: break-all; }
.security-forms { display: grid; gap: 12px; margin-top: 8px; }
.code-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.code-list code { font-size: 14px; }
td.ua { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings: get the app */
.install-help { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); }
.install-help li { margin-bottom: 4px; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.hidden { display: none !important; }

/* Inside the iPhone and Android apps */
/* Setting up two-factor on the phone itself: there's no second screen to scan the QR code from. */
.otp-open { display: none; }
@media (pointer: coarse) { .otp-open { display: block; } }

/* Sign in with Face ID (the iPhone and Android apps) */
.login-card [data-biometric-signin] { margin-top: 10px; }
.faceid-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

#app-lock { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: var(--page); }
#app-lock .app-lock-card { width: 100%; max-width: 340px; text-align: center; display: grid; gap: 12px; justify-items: center; }
#app-lock .app-lock-card img { border-radius: 14px; }
#app-lock h1 { font-size: 20px; margin: 4px 0 8px; }

/* The "Get the app" bar on phones. */
.install-banner { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); max-width: 520px; margin: 0 auto; }
.install-banner.hidden { display: none; }
.install-banner img { border-radius: 9px; flex: none; }
.install-banner-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.install-banner-text strong { font-size: 14px; }
.install-banner-close { padding: 7px 9px; }
body.has-install-banner { padding-bottom: 84px; }

/* Phones: the logo has the top line to itself; theme, sign-in and trial share the line below, edge to edge. */
@media (max-width: 640px) {
  .topbar.public .topbar-inner { row-gap: 10px; }
  .topbar.public .brand { flex: 1 0 100%; justify-content: center; }
  .topbar.public .topbar-actions { flex: 1 0 100%; margin-left: 0; gap: 8px; }
  .topbar.public .topbar-actions .btn:not(.theme-toggle) { flex: 1 1 0; text-align: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
  .topbar.public .topbar-actions .btn-quiet { border-color: var(--border); color: var(--ink); }
  .topbar.public .theme-toggle { flex: none; border-color: var(--border); }
}

/* Overview "By account": a Chart | Table switch and accounts with no activity folded away. */
.view-switch { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2, var(--surface)); }
.view-switch [role="tab"] { padding: 4px 14px; border-radius: 7px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.view-switch [role="tab"]:hover { color: var(--ink); text-decoration: none; }
.view-switch [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.view-switch [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.panel-note { margin: -4px 0 10px; }
.quiet-toggle { display: none; }
.js .quiet-toggle { display: table-row-group; }
.js .quiet-rows.collapsed { display: none !important; }
.quiet-toggle td { text-align: center; }
html:not(.js) .view-switch, html:not(.js) #panel-chart { display: none; }
.js [data-js-hidden] { display: none; }
.comp-plan { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.comp-plan select { font: inherit; font-size: 13px; padding: 4px 6px; min-width: 0; max-width: 100%; }

/* iPhones zoom the page in on any text field under 16px when it gets focus, and stay zoomed, which pushed
   the sign-in form off the right of the screen (the email field is focused as the page opens). */
@media (pointer: coarse), (max-width: 640px) {
  input, select, textarea, .comp-plan select { font-size: 16px; }
}

/* Touch screens: every control is at least 44px tall (Apple's guideline for a fingertip), checkboxes and
   links at least 24px (WCAG 2.5.8). Padding grows rather than the layout changing. */
@media (pointer: coarse) {
  .btn, .menu-link { padding-top: 12px; padding-bottom: 12px; }
  .theme-toggle, .install-banner-close { min-width: 44px; }
  .menu-panel a { padding-top: 12px; padding-bottom: 12px; }
  .chip { padding: 12px 14px; }
  .view-switch [role="tab"] { padding: 13px 16px; }
  input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; }
  .card-links a, .footer a, .public-footer a, table.data td a, .notice a, .account-net-value { display: inline-block; padding-top: 4px; padding-bottom: 4px; }
  details > summary:not(.btn) { padding-top: 13px; padding-bottom: 13px; }
}

/* How-to videos: the desktop recording on wide screens, the phone recording on narrow ones. */
.howto { max-width: 960px; }
.howto-index ol { padding-left: 22px; columns: 2; column-gap: 32px; }
.howto-index li { padding: 2px 0; break-inside: avoid; }
.howto-item { margin-top: 36px; }
.howto-item h2 { font-size: 20px; }
.howto-video { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #0b4f4a; }
.howto-phone { display: none; max-width: 340px; margin: 0 auto; }
.howto-transcript { margin-top: 10px; }
.howto-transcript summary { cursor: pointer; font-weight: 600; }
.howto-transcript p { margin: 6px 0; }
@media (max-width: 700px) {
  .howto-desktop { display: none; }
  .howto-phone { display: block; }
  .howto-index ol { columns: 1; }
}
