:root {
  color-scheme: light dark;
  --bg:#f4f5f9; --fg:#1a1c25; --muted:#646a7c; --card:#ffffff; --line:#e6e8ef; --field:#f4f5f9;
  --accent:#5b5bf0; --accent-2:#8b5cf6; --accent-soft:#ececff;
  --ok:#177a54; --ok-soft:#dcf5ea; --warn:#a85f00; --warn-soft:#fff0d6; --bad:#c62f2f; --bad-soft:#fde3e3;
  --shadow:0 1px 2px rgba(20,24,40,.06), 0 4px 16px rgba(20,24,40,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0f1117; --fg:#eceef6; --muted:#9298ab; --card:#181b25; --line:#272b38; --field:#0f1117;
    --accent:#8a8aff; --accent-2:#a78bfa; --accent-soft:#25264a;
    --ok:#4cd6a0; --ok-soft:#143126; --warn:#f5b342; --warn-soft:#3a2b10; --bad:#ff7a7a; --bad-soft:#3b1a1a;
    --shadow:0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg:#0f1117; --fg:#eceef6; --muted:#9298ab; --card:#181b25; --line:#272b38; --field:#0f1117;
  --accent:#8a8aff; --accent-2:#a78bfa; --accent-soft:#25264a;
  --ok:#4cd6a0; --ok-soft:#143126; --warn:#f5b342; --warn-soft:#3a2b10; --bad:#ff7a7a; --bad-soft:#3b1a1a;
  --shadow:0 1px 2px rgba(0,0,0,.4);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing:border-box; }
body { margin:0; padding:20px 16px calc(40px + env(safe-area-inset-bottom)); background:var(--bg); color:var(--fg);
  font:16px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; -webkit-font-smoothing:antialiased; }
main { max-width:440px; margin:0 auto; display:grid; gap:14px; }
header { display:flex; align-items:center; justify-content:space-between; padding:2px 4px 4px; }
.brand { font-size:22px; font-weight:700; letter-spacing:-.02em; margin:0; }
h1.page { font-size:26px; font-weight:700; letter-spacing:-.02em; line-height:1.2; margin:10px 4px 14px; }
.brand span { background:linear-gradient(90deg,var(--accent),var(--accent-2)); -webkit-background-clip:text; background-clip:text; color:transparent; }
h2 { margin:0 0 12px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.muted { color:var(--muted); font-size:14px; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--bad); margin-right:6px; }
.dot.on { background:var(--ok); }
.dot.off { background:var(--muted); }
.card { background:var(--card); border-radius:18px; padding:18px; box-shadow:var(--shadow); border:1px solid var(--line); }
/* Over the sign-in form while it is on its way. */
#auth { position:relative; }
.auth-busy { position:absolute; inset:0; z-index:2; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:24px; text-align:center; background:var(--card); border-radius:inherit; font-weight:600; }
.auth-busy[hidden] { display:none; }
.auth-busy p { margin:0; max-width:32ch; }
.auth-busy .muted { font-weight:400; }
.spinner { width:34px; height:34px; margin-bottom:8px; border-radius:50%; border:3px solid var(--accent-soft); border-top-color:var(--accent);
  animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration:2.4s; } }
.banner { background:var(--warn-soft); color:var(--warn); border-radius:14px; padding:10px 14px; font-size:14px; font-weight:600; }
.dim { opacity:.5; pointer-events:none; transition:opacity .2s; }

.picker { display:flex; align-items:center; gap:12px; padding:6px 6px 6px 16px; background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.picker span { color:var(--muted); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; }
.picker select { flex:1; min-width:0; border:0; background:transparent; font-weight:700; font-size:17px; }
.dev { display:flex; align-items:center; gap:12px; padding:10px 0; border-top:1px solid var(--line); cursor:pointer; }
.dev:first-child { border-top:0; }
.dev input { width:22px; height:22px; min-height:0; flex:none; accent-color:var(--accent); }
.dev .nm { font-weight:600; color:var(--fg); overflow-wrap:anywhere; }
.dev .nm small { display:block; font-weight:400; color:var(--muted); font-size:13px; }
.seg { display:flex; gap:4px; padding:4px; background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.seg button { flex:1; background:transparent; color:var(--muted); border-radius:10px; padding:9px 4px; }
.seg button.sel, .seg button[aria-selected="true"] { background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; }

.hero { display:flex; align-items:center; gap:18px; }
.ring { --pct:0; --c:var(--accent); flex:none; width:132px; height:132px; border-radius:50%;
  background:conic-gradient(var(--c) calc(var(--pct)*1%), var(--line) 0); display:grid; place-items:center; transition:background .4s; }
.ring::before { content:""; grid-area:1/1; width:104px; height:104px; border-radius:50%; background:var(--card); }
.ring .big { grid-area:1/1; z-index:1; font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:-.02em; text-align:center; line-height:1.15; }
.ring .big small { display:block; font-size:11px; font-weight:600; color:var(--muted); letter-spacing:.04em; text-transform:uppercase; }
.hero-info { min-width:0; display:grid; gap:5px; }
.offers { display:grid; gap:8px; margin:0 0 12px; }
.offer { display:flex; justify-content:space-between; align-items:center; gap:12px; text-align:left; min-height:52px; }
.offer small { display:block; font-weight:500; opacity:.85; }
.offer.best { background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; }
.offer strong { white-space:nowrap; }
.pill { justify-self:start; font-size:12px; font-weight:700; padding:3px 10px; border-radius:99px; background:var(--accent-soft); color:var(--accent); }
.pill.ok { background:var(--ok-soft); color:var(--ok); }
.pill.warn { background:var(--warn-soft); color:var(--warn); }
.pill.bad { background:var(--bad-soft); color:var(--bad); }
#detail { font-size:15px; font-weight:600; }
#cardLine, #plan { overflow-wrap:anywhere; }
#plan { white-space:pre-line; }

.quick { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:18px; }
.quick .full { grid-column:1/-1; }
.quick-label { margin:16px 0 -10px; }
button { font:inherit; font-size:15px; font-weight:600; padding:11px 14px; border:0; border-radius:12px; color:#fff; cursor:pointer;
  background:linear-gradient(135deg,var(--accent),var(--accent-2)); transition:transform .08s, opacity .15s; min-height:44px; }
button:active { transform:scale(.97); }
button:hover { opacity:.92; }
button:disabled { opacity:.5; cursor:default; transform:none; }
button.alt { background:var(--field); color:var(--fg); border:1px solid var(--line); }
button.stop { background:var(--bad-soft); color:var(--bad); }
button.small { min-height:36px; padding:6px 12px; font-size:14px; }
button.link { background:none; color:var(--muted); font-weight:500; font-size:14px; text-decoration:underline; min-height:40px; padding:6px 8px; }
:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
input, select { font:inherit; font-size:16px; padding:9px 10px; border-radius:10px; border:1px solid var(--line); background:var(--field); color:var(--fg); width:100%; min-height:44px; }
input:focus-visible, select:focus-visible { outline-offset:-1px; }

.presets { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.presets label { display:flex; align-items:center; gap:8px; flex:1 1 140px; color:var(--muted); font-size:14px; font-weight:600; white-space:nowrap; }
.presets input { text-align:center; }
.days { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.days label { font-size:11px; font-weight:700; color:var(--muted); text-align:center; text-transform:uppercase; letter-spacing:.04em; }
.days input { padding:8px 0; text-align:center; margin-top:4px; -moz-appearance:textfield; }
.days input::-webkit-outer-spin-button, .days input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.field-row { display:flex; align-items:center; gap:10px; }
.field-row input { flex:1; width:auto; min-width:0; }
.gap { margin-top:18px; }

.hist { display:flex; align-items:flex-end; gap:5px; height:120px; }
.hist > div { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; font-size:10px; color:var(--muted); gap:3px; }
.hist .b { width:100%; background:var(--accent-soft); border-radius:6px 6px 3px 3px; min-height:3px; transition:height .3s; }
.hist .today .b { background:linear-gradient(180deg,var(--accent-2),var(--accent)); }
.hist .today { color:var(--fg); font-weight:700; }

.crow { display:grid; gap:10px; padding:16px 0; border-top:1px solid var(--line); }
.crow:first-of-type { border-top:0; padding-top:4px; }
.crow-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.crow .nm { font-weight:600; overflow-wrap:anywhere; min-width:0; }
.crow .nm .muted { font-weight:400; font-size:13px; }
.crow button.link { min-height:32px; margin:-6px -8px 0 0; flex:none; }
.usage summary { cursor:pointer; color:var(--muted); font-size:13px; width:fit-content; list-style:none; }
.usage summary::-webkit-details-marker { display:none; }
.usage summary::after { content:"▸"; margin-left:6px; }
.usage[open] summary::after { content:"▾"; }
.crow-head + .usage { margin-top:-8px; }
.usage ol { list-style:none; margin:8px 0 2px; padding:10px 12px; display:grid; gap:6px; background:var(--field); border-radius:12px; }
.usage li { display:grid; grid-template-columns:96px 1fr 52px; align-items:center; gap:10px; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }
.usage li > span:last-child { text-align:right; }
.usage li.today { color:var(--fg); font-weight:600; }
.usage .ut { height:8px; border-radius:99px; background:var(--line); overflow:hidden; }
.usage .ub { display:block; height:100%; border-radius:99px; background:var(--accent); opacity:.55; }
.usage li.today .ub { opacity:1; }
.rule { border:0; margin:0; padding:0; min-width:0; display:grid; gap:8px; }
.rule .seg { box-shadow:none; background:var(--field); padding:3px; border-radius:12px; }
.rule .seg button { min-height:36px; padding:6px 4px; font-size:14px; }
.rule-help { margin:0; font-size:13px; }
.rule-budget { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:600; color:var(--muted); }
.rule-budget input { width:80px; flex:none; text-align:center; }

.savebar { position:sticky; bottom:calc(12px + env(safe-area-inset-bottom)); z-index:5; display:flex; align-items:center; gap:8px;
  padding:10px 10px 10px 16px; background:var(--card); border:1px solid var(--accent); border-radius:16px; box-shadow:0 6px 24px rgba(20,24,40,.22); }
.savebar span { flex:1; font-weight:600; font-size:14px; }
#toast { position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom)); transform:translate(-50%, 20px); max-width:min(92vw,420px);
  background:#1f2230; color:#fff; padding:11px 18px; border-radius:99px; font-size:14px; font-weight:600; box-shadow:0 6px 24px rgba(0,0,0,.3);
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:20; text-align:center; }
#toast.show { opacity:1; transform:translate(-50%, 0); }
#toast.err { background:var(--bad); color:#fff; }
code { background:var(--field); padding:1px 6px; border-radius:6px; font-size:13px; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
[hidden] { display:none !important; }
@media (max-width:380px) { .hero { flex-direction:column; text-align:center; } .hero-info { justify-items:center; } .pill { justify-self:center; } }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }

/* accounts, linking and sharing */
a.btn { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; font-size:15px; font-weight:600; padding:11px 14px; border-radius:12px;
  color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); min-height:44px; }
a.btn.alt { background:var(--field); color:var(--fg); border:1px solid var(--line); }
a.inline { color:var(--accent); font-weight:600; }
.banner a { color:inherit; text-decoration:underline; font-weight:700; }
form.stack { display:grid; gap:10px; }
form.stack label { display:grid; gap:4px; font-size:13px; font-weight:700; color:var(--muted); }
.form-err { color:var(--bad); font-size:14px; font-weight:600; min-height:1.3em; margin:0; }
.stack-gap { display:grid; gap:12px; }
.lnk + .lnk { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.lnk h3 { margin:0 0 6px; font-size:15px; }
.row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.mem { display:flex; align-items:center; gap:8px; padding:8px 0; border-top:1px solid var(--line); }
.mem:first-child { border-top:0; }
.mem .nm { flex:1; min-width:0; overflow-wrap:anywhere; font-weight:600; }
.mem .nm small { display:block; font-weight:400; color:var(--muted); font-size:13px; }
.check { display:flex; align-items:center; gap:10px; font-size:14px; color:var(--muted); }
.check input { width:22px; height:22px; min-height:0; flex:none; accent-color:var(--accent); }
button.danger { background:var(--bad-soft); color:var(--bad); }


/* public pages (About, Pricing) and the footer */
main.wide { max-width:640px; }
header a { color:inherit; text-decoration:none; }
header nav { display:flex; align-items:center; gap:14px; font-size:14px; font-weight:600; }
header nav a { color:var(--muted); }
header nav a[aria-current="page"], header nav a:hover { color:var(--accent); }
header nav a.btn, header nav a.btn:hover { color:#fff; padding:7px 14px; min-height:0; }
.theme-toggle { flex:none; width:32px; height:32px; min-height:0; padding:0; font-size:16px; line-height:1;
  background:var(--field); color:var(--fg); border:1px solid var(--line); border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center; }
.theme-toggle:hover { opacity:.85; }
.prose h3 { margin:22px 0 6px; font-size:17px; letter-spacing:-.01em; }
.prose h3:first-child { margin-top:0; }
.prose p, .prose li { line-height:1.55; }
.prose p { margin:0 0 10px; }
.prose ul { margin:0 0 10px; padding-left:20px; }
.prose li + li { margin-top:4px; }
.plans { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; margin:14px 0; }
.plans > div { border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.banner.promo { background:var(--ok-soft); color:var(--ok); }
.cmp-wrap { overflow-x:auto; margin:4px 0 16px; }
table.cmp { width:100%; border-collapse:collapse; font-size:14px; }
table.cmp th, table.cmp td { padding:10px 12px; border-bottom:1px solid var(--line); }
table.cmp thead th { vertical-align:bottom; padding-bottom:8px; }
table.cmp thead th:first-child { text-align:left; }
table.cmp thead th:not(:first-child), table.cmp td { text-align:center; }
table.cmp tbody th { text-align:left; font-weight:600; color:var(--fg); white-space:normal; }
table.cmp .plan-name { display:block; font-size:17px; font-weight:800; letter-spacing:-.01em; color:var(--fg); }
table.cmp .plan-price { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-top:2px; }
table.cmp .pill { margin:6px auto 0; }
table.cmp .yes { color:var(--ok); font-weight:700; }
table.cmp .no { color:var(--muted); }
table.cmp .plus-col { background:var(--accent-soft); }
.cmp-cta { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
@media (max-width:480px) {
  .cmp-cta { grid-template-columns:1fr; }
  table.cmp { font-size:12.5px; }
  table.cmp th, table.cmp td { padding:8px 6px; }
  table.cmp .plan-name { font-size:15px; }
  table.cmp .plan-price { font-size:10.5px; }
  table.cmp .pill { font-size:10px; padding:2px 7px; }
}
.price { font-size:44px; font-weight:800; letter-spacing:-.03em; margin:0; }
.price small { font-size:16px; font-weight:600; color:var(--muted); letter-spacing:0; }
.foot { display:flex; flex-wrap:wrap; justify-content:center; gap:6px 18px; margin-top:6px; padding:8px 4px; font-size:14px; }
.foot a { color:var(--muted); text-decoration:none; font-weight:600; }
.foot a:hover { color:var(--accent); text-decoration:underline; }
.foot .fine { flex-basis:100%; text-align:center; font-weight:400; font-size:12px; color:var(--muted); }
