:root {
  color-scheme: light dark;
  --canvas: #f7f9fc;
  --surface: #ffffff;
  --paper: #f2f6fa;
  --ink: #202835;
  --muted: #505c6b;
  --edge: #dce1e9;
  --control-edge: #8390a3;
  --ink-blue: #263f57;
  --link: #215887;
  --accent: #315c9a;
  --accent-hover: #21467a;
  --on-accent: #fff;
  --focus: #315c9a;
  --warn: #6c4100;
  --warn-surface: #fff5e2;
  --bad: #94243d;
  --bad-surface: #fceef1;
  --good: #27563d;
  --good-surface: #eaf5ed;
  --measure: 68ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #151c25;
    --surface: #1d2632;
    --paper: #273344;
    --ink: #edf2f9;
    --muted: #b1bfd0;
    --edge: #3b4a5d;
    --control-edge: #76889e;
    --ink-blue: #d4e5f9;
    --link: #a9cff7;
    --accent: #aaceff;
    --accent-hover: #c6ddff;
    --on-accent: #19283a;
    --focus: #aaceff;
    --warn: #ffca83;
    --warn-surface: #3a2e20;
    --bad: #ff9bac;
    --bad-surface: #3e2530;
    --good: #a2dbab;
    --good-surface: #20372e;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  accent-color: var(--accent);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: var(--link); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(29px, 4vw, 46px); letter-spacing: -.035em; }
h2 { font-size: clamp(20px, 2.4vw, 25px); letter-spacing: -.025em; }
h3 { font-size: 17px; letter-spacing: -.02em; }
h2 + p, h3 + p { margin-top: 6px; }
p { max-width: var(--measure); }
ul { padding-left: 21px; }
small, .muted { color: var(--muted); }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.visually-hidden, .skip-link:not(:focus) {
  clip-path: inset(50%);
  overflow: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 5px;
  background: var(--surface);
}
.appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--edge);
}
.appbar-inner, .container, .footer {
  width: min(100% - 48px, 1136px);
  margin-inline: auto;
}
.appbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  min-height: 61px;
  padding-block: 6px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.018em;
  text-decoration: none;
}
.mark { display: grid; gap: 3px; width: 20px; justify-items: end; }
.mark i { height: 2px; width: 16px; background: var(--ink-blue); border-radius: 2px; }
.mark i:nth-child(2) { width: 20px; }
.mark i:nth-child(3) { width: 11px; }
.appnav, .account { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 15px; font-size: 13px; }
.appnav a { color: var(--ink-blue); font-weight: 600; text-decoration: none; }
.appnav a:hover, .plain:hover { text-decoration: underline; }
.account { margin-left: auto; color: var(--muted); }
.account form { margin: 0; }
.plain { padding: 2px 0; border: 0; background: transparent; color: var(--link); font-size: inherit; cursor: pointer; }
.container { padding-block: 32px 52px; }
.footer { display: flex; gap: 18px; padding: 12px 0 27px; border-top: 1px solid var(--edge); font-size: 13px; }

.page-head, .cycle-bar, .statement-version {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.page-head { margin-bottom: 23px; }
.page-head p { margin-top: 4px; color: var(--muted); }
.subhead { margin-block: 23px 15px; }
.subhead p { margin-top: 3px; color: var(--muted); }
.breadcrumb { display: inline-block; margin-bottom: 11px; font-size: 13px; }
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 19px;
}
.section-nav a {
  color: var(--muted);
  padding: 8px 1px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-weight: 600;
}
.section-nav a[aria-current], .section-nav a:hover { border-color: var(--accent); color: var(--ink-blue); }
.actions, .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions { margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 37px;
  padding: 7px 12px;
  border: 1px solid var(--control-edge);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-blue);
  font: 650 13px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--paper); }
.button:disabled { cursor: not-allowed; opacity: .65; }
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--paper);
}
.notice p { margin-top: 2px; }
.notice a { display: inline-block; margin-top: 4px; }
.notice.warning, .tag.warning { color: var(--warn); background: var(--warn-surface); }
.notice.negative { color: var(--bad); background: var(--bad-surface); }
.notice.positive { color: var(--good); background: var(--good-surface); }
.tag {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 650;
  font-size: 11px;
  color: var(--ink-blue);
  background: var(--paper);
}
.approaching { color: var(--warn); }
.over { color: var(--bad); }

.empty-state {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 17px 19px;
}
.empty-state p { color: var(--muted); }
.empty-state a { margin-top: 10px; }
.columns, .verify-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: clamp(17px, 4vw, 42px);
  align-items: start;
}
.paper, .task-preview {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
}
.paper ul { margin-block: 10px; }
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
td, th { padding: 11px 13px; text-align: left; vertical-align: middle; }
thead th { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
tbody tr { border-top: 1px solid var(--edge); }
.ledger tbody tr:hover { background: var(--paper); }
.ledger td { font-size: 13px; }
.ledger th a { text-decoration: none; }
.ledger th a:hover { text-decoration: underline; }
.ledger small { display: block; font-size: 12px; font-weight: 400; }
progress { display: block; width: 74px; height: 6px; margin-top: 3px; }
.ledger .approaching progress { accent-color: var(--warn); }
.ledger .over progress { accent-color: var(--bad); }
.cycle-bar { margin: 3px 0 15px; font-size: 13px; }
.cycle-bar select { width: auto; max-width: 100%; }
.entries { margin-top: 0; }
#entries-heading { margin-bottom: 10px; }
.entries :is(th, td):last-child { text-align: right; white-space: nowrap; }
.entries td { font-size: 13px; }
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 24px;
  border-block: 1px solid var(--edge);
  font-variant-numeric: tabular-nums;
}
.figures > div { padding: 11px 12px 13px; border-left: 1px solid var(--edge); }
.figures > div:first-child { border-left: 0; padding-left: 0; }
.figures dt, .figures small { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: normal; }
.figures dd { font-size: clamp(21px, 4vw, 33px); font-weight: 700; letter-spacing: -.03em; }
.figures small { display: block; }

.setup { max-width: 690px; }
.setup section + section, .cause { margin-top: 23px; padding-top: 19px; border-top: 1px solid var(--edge); }
.setup section > p { margin-top: 4px; }
.setup .task-preview { margin-top: 12px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 11px; margin-block: 12px; }
.field { display: grid; gap: 4px; min-width: 0; margin-top: 10px; }
.fields .field { margin-top: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 650; }
.field small { font-size: 12px; }
input:not([type="checkbox"]):not([type="hidden"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--control-edge);
  border-radius: 6px;
  color: var(--ink);
  caret-color: var(--link);
}
input::placeholder { color: var(--muted); }
input[type="checkbox"] { margin: 2px 0 0; width: 17px; height: 17px; flex: 0 0 17px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; margin: 13px 0 7px; font-weight: 550; }
.verify-form { display: grid; gap: 10px; }
.verify-form .button { justify-self: start; }
.verify-form .field, .verify-form .fields { margin-block: 0; }
.verify-alternative { border-top: 1px solid var(--edge); padding-top: 10px; margin-top: 17px; }
.verify-alternative summary { color: var(--link); font-weight: 650; cursor: pointer; }
.verify-alternative[open] summary { margin-bottom: 10px; }
.task-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--edge); color: var(--muted); font-size: 12px; }
.link-preview { color: var(--link); }
.task-metrics { display: flex; flex-wrap: wrap; gap: 9px 16px; margin: 12px 0; }
.task-metrics dt, .task-preview > p { font-size: 13px; color: var(--muted); }
.task-metrics dd { font-size: 14px; font-weight: 650; }
.recovery-action, .deletion { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--edge); }
.recovery-action p, .deletion label { margin-bottom: 7px; }
.deletion label { margin-top: 0; }

.statement-version { padding-block: 9px; border-bottom: 1px solid var(--edge); }
.statement-version p { font-size: 13px; }
.statement-values { margin-top: 13px; }
.statement-values > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block: 7px; border-top: 1px solid var(--edge); }
.statement-values dd { text-align: right; font-variant-numeric: tabular-nums; }
.billing-panel { max-width: 470px; }
.billing-panel .price { margin-block: 5px; color: var(--ink-blue); font-weight: 720; font-size: 38px; letter-spacing: -.035em; }
.price span { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.billing-panel .actions { margin-top: 17px; }
.billing-status { padding-top: 10px; border-top: 1px solid var(--edge); margin-top: 10px; }
.workspace-pick { margin-bottom: 15px; }
.workspace-pick select { width: auto; max-width: 100%; }
.landing { max-width: 670px; padding-block: clamp(9px, 3vw, 32px); }
.landing .lede { font-size: 18px; margin: 9px 0 21px; color: var(--muted); }
.feature-list { margin-top: 24px; }
.feature-list > div { padding-block: 12px; border-top: 1px solid var(--edge); }
.feature-list dt { font-weight: 650; }
.feature-list dd { margin-top: 2px; color: var(--muted); }

@media (max-width: 700px) {
  .appbar-inner, .container, .footer { width: calc(100% - 30px); }
  .columns, .verify-layout { grid-template-columns: minmax(0, 1fr); }
  .container { padding-top: 23px; }
  .page-head { margin-bottom: 17px; }
  .ledger th, .ledger td, .entries th, .entries td { padding-inline: 8px; }
}
@media (max-width: 430px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .account { width: 100%; margin-left: 0; }
  .figures > div { padding-inline: 8px; }
  .figures dt, .figures small { font-size: 12px; }
  .section-nav { gap: 0 10px; font-size: 13px; }
}
@media (pointer: coarse) {
  .button { min-height: 44px; }
  input:not([type="checkbox"]):not([type="hidden"]), select { min-height: 44px; font-size: 16px; }
}
