/* Components, built only from the roles in tokens.css. Like the tokens,
   nothing here knows about Manicule. Each block is one component, its
   variants as --modifiers and its states as attributes where HTML has one
   (aria-pressed, aria-current, :checked, [disabled]) or .is-* otherwise. */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: var(--weight-regular) var(--text-md) / var(--leading-md) var(--font);
  letter-spacing: var(--tracking);
  font-feature-settings: var(--font-features);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--accent-muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }

/* Icons: Lucide, 16px, 2px round strokes, in the text's colour */
.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 20px; height: 20px; }

/* Buttons: one shape, four intents. An icon goes before the label. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-md);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.btn > .i:first-child:not(:last-child) { margin-left: -2px; }
.btn--primary {
  background: var(--accent-strong);
  color: var(--on-accent);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.btn--primary:hover { background: var(--accent-stronger); }
.btn--secondary { background: var(--bg-raised); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn--ghost { color: var(--fg-secondary); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--fg); }
.btn--danger { background: var(--bg-raised); border-color: var(--border); color: var(--danger); box-shadow: var(--shadow-xs); }
.btn--danger:hover { background: var(--danger-subtle); }
.btn--link { height: auto; padding: 0; color: var(--accent-text); }
.btn--link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn--sm { height: var(--control-sm); padding: 0 var(--space-2); gap: 6px; font-size: var(--text-sm); }
.btn--lg { height: var(--control-lg); padding: 0 var(--space-4); }
.btn--icon { width: var(--control-md); padding: 0; }
.btn--icon.btn--sm { width: var(--control-sm); }
.btn--block { width: 100%; }
.btn[aria-pressed="true"], .btn[aria-expanded="true"] { background: var(--bg-selected); color: var(--fg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* Joined group: steppers, view switches and the like share one border */
.group {
  display: inline-flex;
  align-items: stretch;
  height: var(--control-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.group > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--control-md) - 2px);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--fg-secondary);
}
.group > * + * { border-left: 1px solid var(--border-subtle); }
.group > button:hover, .group > a:hover { background: var(--bg-hover); color: var(--fg); }
.group > [aria-disabled="true"] { opacity: 0.45; }
.group > [aria-pressed="true"] { background: var(--bg-selected); color: var(--fg); }
.group .value { min-width: 52px; color: var(--fg); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.group input { width: 48px; text-align: center; outline: 0; }
.group .suffix { color: var(--fg-muted); font-size: var(--text-sm); padding-left: 0; border-left: 0; }
.group--sm { height: var(--control-sm); }

/* Pager: where a long list is up to, and links to the pages either side */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); color: var(--fg-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.group--sm > * { min-width: calc(var(--control-sm) - 2px); }

/* Segmented control: one of a few views of the same thing */
.segmented { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-lg); background: var(--bg-muted); }
.segmented > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: calc(var(--control-md) - 4px);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--fg-muted);
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast) var(--ease-out);
}
.segmented > button:hover { color: var(--fg); }
.segmented > [aria-pressed="true"], .segmented > [aria-selected="true"] {
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}
.segmented .count { color: var(--fg-faint); font-weight: var(--weight-regular); font-variant-numeric: tabular-nums; }
.segmented--fill { display: flex; }
.segmented--fill > button { flex: 1; justify-content: center; }

/* Tabs: switch panes inside one surface */
.tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.tabs > * {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--control-lg);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font-weight: var(--weight-medium);
}
.tabs > :hover { color: var(--fg); }
.tabs > [aria-selected="true"], .tabs > [aria-current="page"] { color: var(--fg); }
.tabs > [aria-selected="true"]::after, .tabs > [aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Text fields. .field wraps an input with icons or keys beside it; a bare
   .input is the same box without them. */
.input, .field {
  height: var(--control-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--fg);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input { width: 100%; outline: 0; }
.field { display: flex; align-items: center; gap: var(--space-2); color: var(--fg-muted); }
.field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--fg); }
.input::placeholder, .field input::placeholder { color: var(--fg-faint); }
.input:focus, .field:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.input--lg, .field--lg { height: var(--control-lg); }
textarea.input { height: auto; min-height: 80px; padding: var(--space-2) var(--space-3); resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.form-label { display: block; margin-bottom: 6px; font-weight: var(--weight-medium); }
.hint { margin: 6px 0 0; color: var(--fg-muted); font-size: var(--text-sm); line-height: var(--leading-sm); }
.error { margin: 6px 0 0; color: var(--danger); font-size: var(--text-sm); line-height: var(--leading-sm); }
kbd {
  padding: 0 5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--fg-faint);
  font: inherit;
  font-size: var(--text-xs);
  line-height: 18px;
}

/* Select: the native one, drawn like a button */
.select {
  height: var(--control-md);
  padding: 0 calc(var(--space-2) + 20px) 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised) no-repeat right 8px center / 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23706e6d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-xs);
  font-weight: var(--weight-medium);
  appearance: none;
  cursor: pointer;
}
.select:hover { border-color: var(--border-strong); }
.select--sm { height: var(--control-sm); font-size: var(--text-sm); }

/* Checkbox and switch: real inputs, drawn. A .check label holds either
   with its text. */
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.checkbox, .switch { appearance: none; flex: none; margin: 0; cursor: pointer; }
.checkbox {
  display: grid;
  place-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
.checkbox::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--on-accent);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 37% 70%);
  transform: scale(0);
  transition: transform var(--duration-fast) var(--ease-out);
}
.checkbox:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
.checkbox:checked::before { transform: scale(1); }
.switch {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background-color var(--duration) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform var(--duration) var(--ease-out);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(12px); }

/* Badges and counts */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--fg-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge--accent { background: var(--accent-subtle); color: var(--accent-text); }
.badge--success { background: var(--success-subtle); color: var(--success); }
.badge--danger { background: var(--danger-subtle); color: var(--danger); }
.badge--warning { background: var(--warning-subtle); color: var(--warning); }

/* Menu: a [popover] (or any box) of items. Items are buttons or links. */
.menu {
  min-width: 200px;
  margin: 0;
  padding: var(--space-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-md);
}
.menu[popover] { position: fixed; inset: auto; }
.menu[popover]:popover-open { animation: menu-in var(--duration) var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--fg);
  text-align: left;
  white-space: nowrap;
}
.menu-item > .i { color: var(--fg-muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-hover); outline: 0; }
.menu-item:disabled { opacity: 0.45; pointer-events: none; }
.menu-item .end { margin-left: auto; padding-left: var(--space-4); color: var(--fg-faint); font-size: var(--text-sm); }
.menu-item--danger, .menu-item--danger > .i { color: var(--danger); }
.menu-item--danger:hover { background: var(--danger-subtle); }
.menu-item .check-mark { margin-left: auto; color: var(--accent); }
.menu-sep { height: 1px; margin: var(--space-1) calc(var(--space-1) * -1); border: 0; background: var(--border-subtle); }
.menu-label { padding: var(--space-2) var(--space-2) var(--space-1); color: var(--fg-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }

/* Dialog: a native <dialog>, title and body, actions in a footer band */
.dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: var(--overlay); }
.dialog[open] { animation: dialog-in var(--duration-slow) var(--ease-out); }
.dialog[open]::backdrop { animation: fade-in var(--duration) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog--wide { width: min(640px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-4) 0 var(--space-6); }
.dialog-head h2 { flex: 1; margin: 4px 0 0; font-size: var(--text-lg); line-height: var(--leading-lg); }
.dialog-head p { margin: 4px 0 0; color: var(--fg-muted); }
.dialog-head .btn { color: var(--fg-muted); }
.dialog-body { display: grid; gap: var(--space-4); padding: var(--space-5) var(--space-6) var(--space-6); }
.dialog-body > p { margin: 0; }
.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--bg-subtle);
}
.dialog-foot .start { margin-right: auto; display: flex; gap: var(--space-2); }

/* Dropzone */
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-8) var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  text-align: center;
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-subtle); color: var(--fg-secondary); }
.dropzone strong { color: var(--fg); font-weight: var(--weight-medium); }

/* Toast: one at a time, bottom centre, on the inverse surface */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  box-shadow: var(--shadow-lg);
  translate: -50% 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-out), translate var(--duration-slow) var(--ease-out);
}
.toast.is-shown { translate: -50% 0; opacity: 1; pointer-events: auto; }
/* Even on both sides without a button at the end */
.toast:not(:has(.action)) { padding-right: var(--space-4); }
.toast .msg { flex: 1; min-width: 0; }
.toast .action {
  height: 28px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--inverse-accent);
  font-weight: var(--weight-semibold);
}
.toast .action:hover { background: color-mix(in srgb, var(--inverse-fg) 10%, transparent); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--inverse-accent); transition: width var(--duration) linear; }
.toast .bar.is-unknown { width: 30%; animation: to-and-fro 1.2s var(--ease-in-out) infinite alternate; }

/* Progress */
.meter { position: relative; height: 4px; overflow: hidden; border-radius: var(--radius-full); background: var(--bg-selected); }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); transition: width var(--duration) var(--ease-out); }
.meter.is-unknown > span { width: 30%; animation: to-and-fro 1.2s var(--ease-in-out) infinite alternate; }
@keyframes to-and-fro { from { left: 0; } to { left: 70%; } }
.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tile: a picture, or a tint with an initial or a title in its place */
.tile {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile > .i { color: var(--fg-faint); }
.tile--sm { width: 32px; height: 32px; font-size: 14px; }
.tile--md { width: 40px; height: 40px; font-size: 17px; }
.tint-clay { background: var(--tint-clay-bg); color: var(--tint-clay-fg); }
.tint-sand { background: var(--tint-sand-bg); color: var(--tint-sand-fg); }
.tint-sky { background: var(--tint-sky-bg); color: var(--tint-sky-fg); }
.tint-slate { background: var(--tint-slate-bg); color: var(--tint-slate-fg); }
.tint-plum { background: var(--tint-plum-bg); color: var(--tint-plum-fg); }
.tint-sage { background: var(--tint-sage-bg); color: var(--tint-sage-fg); }

/* Avatar */
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
}

/* Empty state */
.empty { display: grid; justify-items: center; gap: var(--space-1); padding: var(--space-12) var(--space-6); text-align: center; }
.empty > .i { width: 20px; height: 20px; margin-bottom: var(--space-2); color: var(--fg-faint); }
.empty h3 { margin: 0; font-size: var(--text-md); line-height: var(--leading-md); }
.empty p { max-width: 320px; margin: 0; color: var(--fg-muted); }
.empty .btn { margin-top: var(--space-3); }

/* Table: quiet dividers, small caps headers, two-line cells */
.table { width: 100%; border-collapse: collapse; }
.table th {
  height: 36px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: var(--space-3); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr { transition: background-color var(--duration-fast); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table .num { text-align: right; }
.cell-title { font-weight: var(--weight-medium); }
.cell-sub { color: var(--fg-muted); font-size: var(--text-sm); line-height: var(--leading-sm); }

/* Definition list: label, value */
.details { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
.details dt { color: var(--fg-muted); }
.details dd { margin: 0; }

/* App shell: a sidebar of navigation beside the page */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100dvh;
  padding: var(--space-3);
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
.brand { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2); font-weight: var(--weight-semibold); }
.nav { display: grid; gap: 1px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--fg);
  text-align: left;
}
.nav-item > .i { color: var(--fg-muted); }
.nav-item:hover { background: var(--bg-hover); }
.nav-item .label-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { margin-left: auto; color: var(--fg-faint); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.nav-item[aria-current="page"] { background: var(--bg-selected); font-weight: var(--weight-medium); }
.nav-sub { position: relative; display: grid; gap: 1px; margin: 1px 0 var(--space-1) 15px; padding-left: 9px; }
.nav-sub::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.nav-sub .nav-item { min-height: 30px; color: var(--fg-secondary); }
.nav-sub .nav-item[aria-current="page"] { color: var(--fg); }
.nav-sub .nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: var(--fg);
}
/* An item with a small action at its right end, like adding to it */
.nav-row { position: relative; display: grid; }
.nav-row > .nav-item { padding-right: 36px; }
.nav-action { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-md); color: var(--fg-muted); }
.nav-action:hover { background: var(--bg-selected); color: var(--fg); }
.sidebar-foot { margin-top: auto; }
.account { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2); border: 0; border-radius: var(--radius-md); background: none; text-align: left; }
.account:hover, .account[aria-expanded="true"] { background: var(--bg-hover); }
.account .who { display: grid; flex: 1; min-width: 0; line-height: 17px; }
.account .who small { color: var(--fg-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.account > .i { color: var(--fg-muted); }

/* Bottom tab bar: the sidebar's place on phones */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-subtle) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.tabbar > a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  height: 56px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0;
}
.tabbar > a > .i { width: 20px; height: 20px; }
.tabbar > a[aria-current="page"] { color: var(--fg); }
.tabbar > a[aria-current="page"] > .i { color: var(--accent); }

/* Page: a head with the title and its actions, then a toolbar */
.page-main { width: 100%; max-width: 1100px; padding: var(--space-10) var(--space-12) var(--space-16); }
.page-main--narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-head h1 { margin: 0; font-size: var(--text-2xl); line-height: var(--leading-2xl); }
.page-head p { margin: 4px 0 0; color: var(--fg-muted); }
.page-head .end { margin-left: auto; display: flex; gap: var(--space-2); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.toolbar .end { margin-left: auto; display: flex; gap: var(--space-2); }
.section { margin-top: var(--space-10); }
.section > h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); line-height: var(--leading-lg); }
.section > p { margin: 0 0 var(--space-4); color: var(--fg-muted); }

/* A narrow centred column, for signing in and the like */
.solo { display: grid; place-items: start center; min-height: 100dvh; padding: 15vh var(--space-4) var(--space-8); background: var(--bg-subtle); }
/* The column holds the width: inside a centred grid it would otherwise
   shrink to its content, and the card with it. */
.solo-col { width: min(380px, 100%); }
.solo-col .solo-card { width: 100%; }
.solo-card { width: min(360px, 100%); padding: var(--space-8); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); background: var(--bg-raised); box-shadow: var(--shadow-sm); }
.solo-card h1 { margin: 0 0 var(--space-6); font-size: var(--text-xl); line-height: var(--leading-xl); }
.solo-card form { display: grid; gap: var(--space-4); }
.solo-foot { margin-top: var(--space-6); color: var(--fg-muted); text-align: center; }
.solo-foot a { color: var(--accent-text); font-weight: var(--weight-medium); }

@media (max-width: 759px) {
  .page-main { padding: var(--space-6) var(--space-4) calc(var(--space-16) + 56px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
