/* Heartcron dashboard. Same family as the landing page: navy "monitor" dark
   theme and a matching light one. The theme follows the system unless the
   viewer picks one (data-theme on <html>). */
:root {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --raise: #F7F9FD;
  --ink: #0F1730;
  --ink-soft: #56607F;
  --line: #E1E6F0;
  --line-strong: #C6CDDD;
  --accent: #3D6AE6;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(61, 106, 230, .14);
  --up: #1E9A5F;
  --up-bg: #E3F5EC;
  --down: #D7323C;
  --down-bg: #FCE8E9;
  --late: #A86A10;
  --late-bg: #FBF0DC;
  --new: #66708F;
  --new-bg: #EDF0F6;
  --code-bg: #0D1326;
  --code-ink: #E9EDF7;
  --focus: #3D6AE6;
  --shadow: 0 18px 40px -24px rgba(15, 23, 48, .35);
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1326; --surface: #121A33; --raise: #18213F; --ink: #E9EDF7; --ink-soft: #9BA4C1;
    --line: #232D4D; --line-strong: #34406A; --accent: #8FB4FF; --accent-ink: #0B1430; --accent-soft: rgba(143, 180, 255, .16);
    --up: #4CC38A; --up-bg: #12302A; --down: #FF5A63; --down-bg: #3A1824; --late: #E9A93A; --late-bg: #3A2C14;
    --new: #9BA4C1; --new-bg: #1E2747; --code-bg: #0A0F20; --code-ink: #E9EDF7; --focus: #8FB4FF;
    --shadow: 0 24px 50px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1326; --surface: #121A33; --raise: #18213F; --ink: #E9EDF7; --ink-soft: #9BA4C1;
  --line: #232D4D; --line-strong: #34406A; --accent: #8FB4FF; --accent-ink: #0B1430; --accent-soft: rgba(143, 180, 255, .16);
  --up: #4CC38A; --up-bg: #12302A; --down: #FF5A63; --down-bg: #3A1824; --late: #E9A93A; --late-bg: #3A2C14;
  --new: #9BA4C1; --new-bg: #1E2747; --code-bg: #0A0F20; --code-ink: #E9EDF7; --focus: #8FB4FF;
  --shadow: 0 24px 50px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geologica", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.lead { max-width: 70ch; margin-top: -8px; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88rem; }

h1 {
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem); line-height: 1.1; letter-spacing: -0.03em;
  margin: 0 0 18px;
}
h2 { font-weight: 650; letter-spacing: -0.015em; font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }

/* top bar */
.topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.logo-mark { width: 30px; height: 18px; color: var(--accent); }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--ink-soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius); font-weight: 650; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--bg); }
.switcher > summary { border: 1px solid var(--line-strong); max-width: 240px; }
.switcher > summary::after, .account-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); flex: none; }
.switcher > summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { margin-left: auto; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 650; text-transform: uppercase; font-size: .85rem; }
.account-email { color: var(--ink-soft); font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); z-index: 20; }
.menu-right { left: auto; right: 0; }
.menu-panel a, .menu-button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px; text-decoration: none; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.menu-panel a:hover, .menu-button:hover { background: var(--bg); }
.menu-panel a[aria-current="true"] { font-weight: 700; }
.menu-panel a[aria-current="true"]::before { content: "✓ "; color: var(--up); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-label { margin: 4px 10px 4px; font-size: .8rem; color: var(--ink-soft); }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin-bottom: 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { margin: 0 0 6px; color: var(--ink-soft); font-size: .92rem; }
.crumbs a { color: var(--ink-soft); }
.flash { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--up); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 22px; font-weight: 550; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-top: 20px; }
.panel.danger { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.panel.danger h2 { color: var(--down); }
.section-title { margin-top: 36px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 10px 16px; border-radius: var(--radius);
  color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent);
  transition: background-color .15s, border-color .15s, box-shadow .2s;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--raise); border-color: var(--ink-soft); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--raise); color: var(--ink); box-shadow: none; }
.btn-danger { background: transparent; color: var(--down); border-color: color-mix(in srgb, var(--down) 50%, var(--line)); }
.btn-danger:hover { background: var(--down); color: #fff; border-color: var(--down); box-shadow: none; }
.btn-small { padding: 5px 10px; font-size: .86rem; font-weight: 650; }
.btn-wide { width: 100%; padding: 12px 16px; }
.btn.is-done { color: var(--up); border-color: var(--up); }
.btn-github svg { width: 18px; height: 18px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* forms */
label, legend { font-weight: 650; display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], input[type=search], input:not([type]), select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
input:disabled { background: var(--bg); color: var(--ink-soft); }
input[aria-invalid="true"] { border-color: var(--down); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form { max-width: 640px; }
.field { margin-bottom: 22px; }
.hint { color: var(--ink-soft); font-size: .88rem; margin: 6px 0 0; }
.inline { display: flex; gap: 8px; }
.inline .num { width: 110px; flex: none; }
.inline select { width: auto; }
.inline-form { display: flex; gap: 8px; max-width: 560px; }
.stack { display: grid; gap: 10px; }
.stack label { margin-bottom: -4px; }
.narrow { max-width: 420px; }
.form-error { background: var(--down-bg); color: var(--down); border-radius: var(--radius); padding: 10px 14px; font-weight: 600; margin: 0 0 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 3px; gap: 3px; margin-bottom: 14px; background: var(--surface); }
.segmented label { margin: 0; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.kind-panel label { margin-top: 4px; }
.kind-panel select { margin-bottom: 4px; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 500; margin-bottom: 8px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.advanced summary { cursor: pointer; font-weight: 650; margin-bottom: 12px; }
.preview { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; margin: -6px 0 22px; min-height: 1.5em; }
.preview:empty { display: none; }
.preview.is-error { color: var(--down); border-color: var(--down); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.badge .dot, .ev .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.badge-up, .badge-running { color: var(--up); background: var(--up-bg); }
.badge-down { color: var(--down); background: var(--down-bg); }
.badge-late { color: var(--late); background: var(--late-bg); }
.badge-new, .badge-paused { color: var(--new); background: var(--new-bg); }
.badge-paused .dot { background: none; border: 2px solid currentColor; width: 9px; height: 9px; }
.badge-running .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .badge-running .dot { animation: none; } }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.filters a { text-decoration: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.filters a:hover { color: var(--ink); border-color: var(--ink); }
.filters a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filters .count { opacity: .7; margin-left: 2px; }
.filters .filter-down:not([aria-current]) { color: var(--down); }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 650; font-size: .82rem; color: var(--ink-soft); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.checks tbody tr:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.check-name { font-weight: 700; text-decoration: none; }
.check-name:hover { text-decoration: underline; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.tag { font-size: .76rem; padding: 1px 7px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.no-match { text-align: center; color: var(--ink-soft); padding: 28px; }
.events td { vertical-align: top; }
.ev { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; white-space: nowrap; }
.ev-success .ev, .ev-up .ev { color: var(--up); }
.ev-fail .ev, .ev-down .ev { color: var(--down); }
.ev-start .ev, .ev-log .ev { color: var(--new); }
.ev-down, .ev-up { background: color-mix(in srgb, var(--bg) 70%, transparent); }
details.body summary { cursor: pointer; color: var(--ink-soft); font-size: .86rem; margin-top: 4px; }

/* check page */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0 0; }
.facts > div { background: var(--surface); padding: 14px 16px; box-shadow: 0 0 0 .5px var(--line); }
.facts dt { font-size: .8rem; color: var(--ink-soft); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 650; }
.url-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; flex-wrap: wrap; }
.url { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; word-break: break-all; flex: 1 1 320px; }
pre.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; margin: 10px 0; line-height: 1.55; white-space: pre; }
.snippets { margin-top: 18px; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tab-list button { font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink-soft); background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; margin-bottom: -1px; cursor: pointer; }
.tab-list button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* empty state */
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px; max-width: 760px; }
.empty h2 { font-size: 1.5rem; font-weight: 700; }
.steps { padding-left: 1.3em; margin: 20px 0 26px; }
.steps li { margin-bottom: 14px; padding-left: 4px; }
.steps li::marker { font-weight: 700; }

/* integrations */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; }
.card .stack, .card > form { margin-top: auto; }
.kind { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.kind::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--ink-soft); }
.kind-slack::before { background: #611F69; }
.kind-telegram::before { background: #229ED9; }
.kind-discord::before { background: #5865F2; }
.kind-email::before { background: var(--down); }
.kind-webhook::before { background: var(--ink); }
.pending { font-size: .8rem; color: var(--late); background: var(--late-bg); padding: 1px 8px; border-radius: 999px; margin-left: 6px; }

/* usage */
.meter { margin: 16px 0; max-width: 520px; }
.meter-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 999px; background: var(--bg); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--bg); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.high::-webkit-progress-value { background: var(--down); }
progress.high::-moz-progress-bar { background: var(--down); }

/* signed-out screens: the card sits in the same soft glow as the landing hero */
body.is-guest {
  background:
    radial-gradient(50% 45% at 50% 38%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.guest-wrap .flash { max-width: 440px; }
.guest-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px 32px 26px; box-shadow: var(--shadow); }
.logo-large { font-size: 1.35rem; margin-bottom: 26px; }
.logo-large .logo-mark { width: 36px; height: 22px; }
.guest-card h1 { font-size: 2rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); margin: 18px 0; font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.lang-switch { margin: 22px 0 0; display: flex; justify-content: center; gap: 22px; font-size: .9rem; }
.lang-switch a { color: var(--ink-soft); }

/* phones */
@media (max-width: 820px) {
  .topbar-inner { padding: 0 16px; gap: 10px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; height: 44px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 0 10px; }
  .account-email { display: none; }
  .topbar .logo span { display: none; } /* the mark alone leaves room for the project menu */
  .switcher { min-width: 0; flex: 0 1 auto; }
  .switcher > summary { max-width: 58vw; }
  .wrap { padding: 22px 16px 60px; }
  .panel, .empty { padding: 18px 16px; }
  .guest-card { padding: 26px 20px 22px; }
  .inline-form { flex-direction: column; }

  /* checks table becomes cards */
  .checks thead { display: none; }
  .checks, .checks tbody, .checks tr, .checks td { display: block; width: 100%; }
  .checks tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .checks td { border: 0; padding: 0; }
  .checks td.name-cell { grid-column: 1; grid-row: 1; }
  .checks td:first-child { grid-column: 2; grid-row: 1; }
  .checks td[data-label]:not(:first-child) { grid-column: 1 / -1; color: var(--ink-soft); font-size: .9rem; }
  .checks td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; font-weight: 600; }
  .checks td.actions { grid-column: 1 / -1; text-align: left; margin-top: 6px; }
  .checks .no-match { display: block; }
}

/* check type picker and pull checks */
.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 26px; max-width: 900px; }
.type-picker a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); text-decoration: none; }
.type-picker a:hover { border-color: var(--accent); }
.type-picker a[aria-current="page"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.type-picker strong { font-weight: 650; }
.type-picker span { font-size: .82rem; color: var(--ink-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row .field { margin-bottom: 8px; }
.field-hint { margin: 0 0 22px; }
.unit { align-self: center; color: var(--ink-soft); }
.target { display: block; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8rem; color: var(--ink-soft); margin-top: 2px; word-break: break-all; }
.break { word-break: break-all; }
@media (max-width: 820px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

/* ---- admin ---- */
.is-admin .topbar { border-bottom-color: var(--late); }
.admin-mark { font-size: .78rem; font-weight: 650; color: var(--late); background: var(--late-bg); border-radius: 4px; padding: 2px 8px; margin-left: -8px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stats dd { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd a { text-decoration: none; }
.stats dd a:hover { text-decoration: underline; }
.stats .is-alert dd { color: var(--down); }
.plan-counts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.plan-counts strong { font-size: 1.15rem; margin-left: 4px; }
.admin-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 16px; }
.admin-search input[type="search"] { flex: 1 1 260px; width: auto; }
.admin-search select { width: auto; }
.admin-search .check-row { margin: 0; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.notice { background: var(--down-bg); color: var(--down); border-radius: var(--radius); padding: 10px 14px; font-weight: 600; margin: 14px 0 0; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.action-row:first-of-type { border-top: 0; padding-top: 4px; }
.panel h2 + .action-row { border-top: 0; }
.action-row p { margin: 4px 0 0; }
.action-row .inline-form { max-width: none; }
.down-count { color: var(--down); font-weight: 700; }
.token-panel { border: 1px solid var(--line); border-left: 4px solid var(--late); }
@media (max-width: 820px) {
  .admin-mark { display: none; }
  .action-row form, .action-row .inline-form { width: 100%; }
}

/* theme switch: three icon buttons, labels on wide menus */
.theme-switch { display: flex; gap: 4px; padding: 4px; margin: 2px 4px 4px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; }
.theme-switch button { flex: 1; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .82rem; font-weight: 500; color: var(--ink-soft); background: transparent; border: 0; border-radius: 7px; padding: 6px 8px; cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-panel .theme-switch span { display: none; }
.guest-card .theme-switch { margin: 24px 0 0; }
@media (max-width: 1024px) { .account-email { display: none; } }

/* language menu on the sign-in card */
.flag { width: 20px; height: 14px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.langmenu > summary { padding: 4px 8px; font-weight: 500; color: var(--ink-soft); }
.langmenu .menu-panel { left: 50%; transform: translateX(-50%); bottom: calc(100% + 6px); top: auto; min-width: 180px; }
.langmenu .menu-panel a { display: flex; align-items: center; gap: 10px; }
.lang-switch { align-items: center; }
.legal { margin: 18px 0 0; font-size: .82rem; color: var(--ink-soft); }
.legal a { color: var(--ink-soft); }

/* ---- billing ---- */
.plans-form { margin-top: 28px; }
.plans-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.plans-head h2 { margin: 0; }
.plans-head .segmented { margin: 0; }
.save { color: var(--up); font-weight: 700; margin-left: 4px; }
.segmented label:has(input:checked) .save { color: inherit; }
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.offer.is-current { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.offer h3 { font-size: 1.1rem; margin: 0; }
.offer .price { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 0; }
.offer .price small { font-size: .9rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 0; margin-left: 4px; }
.offer p { margin: 0; }
.offer-limits { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 4px; color: var(--ink-soft); font-size: .92rem; }
.offer .btn { margin-top: auto; }
.offer .btn[disabled] { opacity: .5; cursor: not-allowed; }
.plans-form .p-year { display: none; }
.plans-form:has(input[value="year"]:checked) .p-year { display: initial; }
.plans-form:has(input[value="year"]:checked) p.p-year { display: block; }
.plans-form:has(input[value="year"]:checked) .p-month { display: none; }
@media (max-width: 820px) { .offers { grid-template-columns: minmax(0, 1fr); } }
