/* src/pages/kit/kit.css */
:root {
  --bg: #f4f2ec;
  --bg-glow: #fdfcf8;
  --surface: #fbfaf7;
  --surface-sunken: #efece4;
  --surface-hover: #f1eee7;
  --surface-press: #e8e4d9;
  --line: #e3dfd3;
  --line-strong: #cec9b9;
  --line-hover: #b9b3a1;
  --text: #1e1d1a;
  --muted: #5f5b51;
  --text-invert: #fbfaf7;
  --ink: #2a2823;
  --ink-hover: #3d3a32;
  --accent: #f0d64a;
  --accent-soft: #f6efcd;
  --ok: #2b6a4c;
  --ok-soft: #e0eee6;
  --warn: #7d5300;
  --warn-soft: #f7ecd5;
  --bad: #a93128;
  --bad-soft: #f6e2df;
  --bad-soft-hover: #f1d3ce;
  --idle-soft: #efece4;
  --disabled-ink: #a6a094;
  --stamp: #b03a2b;
  --slot: #2a2823;
  --slot-ink: #f0d64a;
  --shadow: 0 12px 32px #1e1d1a1f, 0 1px 2px #1e1d1a0f;
  --shadow-card: 0 0 0 1px #1e1d1a0f, 0 1px 2px #1e1d1a0a;
  --shadow-card-hover: 0 0 0 1px #1e1d1a17, 0 2px 6px #1e1d1a0f;
  --shadow-lift: 0 1px 2px #1e1d1a14, 0 16px 40px #1e1d1a24;
  --backdrop: #1413106b;
  --font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --text-2xs: .75rem;
  --text-xs: .8125rem;
  --text-sm: .875rem;
  --text-md: 1rem;
  --text-xl: 1.375rem;
  --text-stat: 1.5rem;
  --leading-tight: 1.25;
  --leading-body: 1.55;
  --underline-offset: 3px;
  --icon-stroke: 2;
  --pager-num-w: 2ch;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --space-0: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;
  --space-14: 56px;
  --hairline: 1px;
  --rule: 2px;
  --rule-strong: 3px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-pill: 999px;
  --control-sm: 28px;
  --control-md: 32px;
  --control-lg: 36px;
  --control-icon: 30px;
  --control-chip: 24px;
  --badge-h: 20px;
  --icon-sm: 16px;
  --page: 1120px;
  --gutter: 24px;
  --bar-h: 52px;
  --drawer-width: 380px;
  --modal-width: 360px;
  --login-w: 360px;
  --qr-w: 220px;
  --table-min: 720px;
  --lede-w: 62ch;
  --facts-label: 8.5em;
  --focus: #2a2823;
  --focus-ring: 2px;
  --focus-offset: 2px;
  --z-sticky: 10;
  --duration-fast: .12s;
  --duration-enter: .24s;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --enter-lift: 6px;
}

*, *:before, *:after {
  box-sizing: border-box;
}

html {
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
}

body {
  background: radial-gradient(120% 60% at 50% -20%, var(--bg-glow) 0%, transparent 70%), var(--bg);
  color: var(--text);
  font: var(--text-sm) / var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  background-repeat: no-repeat;
  min-height: 100vh;
  margin: 0;
}

h1, h2 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  margin: 0;
}

h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

h2 {
  font-size: var(--text-md);
}

p {
  margin: 0;
}

a {
  color: var(--text);
  text-decoration-color: var(--line-strong);
  text-underline-offset: var(--underline-offset);
}

a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

small {
  font-size: var(--text-xs);
}

:focus-visible {
  outline: var(--focus-ring) solid var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

.mono, .amount, code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.num {
  text-align: right;
}

.block {
  display: block;
}

.wrap {
  overflow-wrap: anywhere;
}

.lede {
  max-width: var(--lede-w);
  color: var(--muted);
  font-size: var(--text-sm);
}

.topbar {
  position: sticky;
  z-index: var(--z-sticky);
  background: var(--surface);
  border-bottom: var(--hairline) solid var(--line);
  top: 0;
}

.topbar-inner {
  max-width: var(--page);
  padding: 0 var(--gutter);
  min-height: var(--bar-h);
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-self:  center;
  align-items:  center;
  gap: var(--space-2);
  font-weight: var(--weight-bold);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand small {
  font-weight: 400;
  font-size: var(--text-2xs);
  color: var(--muted);
}

.brand-mark {
  width: var(--space-5);
  height: var(--space-5);
  background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+CiAgPHRpdGxlPlB1c2hwYXk8L3RpdGxlPgogIDwhLS0gR2VuZXJhdGVkIGZyb20gaWNvbi1yYXcuc3ZnIGJ5IHNjcmlwdHMvcmVuZGVyLWljb25zLnRzOiBlZGl0IHRoZSBtYXN0ZXIsIG5vdCB0aGlzIGZpbGUuIC0tPgogIDxwYXRoIGQ9Ik0yMi45MDcgMGwxOC4xODYgMGM4LjAxOCAwIDEyLjAyNyAwIDE1LjA5IDEuNTZhMTQuMzE3IDE0LjMxNyAwIDAgMSA2LjI1NyA2LjI1N2MxLjU2IDMuMDYzIDEuNTYgNy4wNzIgMS41NiAxNS4wOWwwIDE4LjE4NmMwIDguMDE4IDAgMTIuMDI3IC0xLjU2IDE1LjA5YTE0LjMxNyAxNC4zMTcgMCAwIDEgLTYuMjU3IDYuMjU3Yy0zLjA2MyAxLjU2IC03LjA3MiAxLjU2IC0xNS4wOSAxLjU2bC0xOC4xODYgMGMtOC4wMTggMCAtMTIuMDI3IDAgLTE1LjA5IC0xLjU2YTE0LjMxNyAxNC4zMTcgMCAwIDEgLTYuMjU3IC02LjI1N2MtMS41NiAtMy4wNjMgLTEuNTYgLTcuMDcyIC0xLjU2IC0xNS4wOWwwIC0xOC4xODZjMCAtOC4wMTggMCAtMTIuMDI3IDEuNTYgLTE1LjA5YTE0LjMxNyAxNC4zMTcgMCAwIDEgNi4yNTcgLTYuMjU3YzMuMDYzIC0xLjU2IDcuMDcyIC0xLjU2IDE1LjA5IC0xLjU2WiIgZmlsbD0iIzViM2RmNSIvPgogIDxnIGZpbGw9Im5vbmUiIHN0cm9rZS13aWR0aD0iNy41IiBzdHJva2UtbGluZWNhcD0icm91bmQiPgogICAgPHBhdGggZD0iTTQxLjUgMTNWMzIiIHN0cm9rZT0iIzdkZjJjOSIvPgogICAgPHBhdGggZD0iTTIyLjUgMzJWNTEiIHN0cm9rZT0iI2ZmZmZmZiIvPgogICAgPGNpcmNsZSBjeD0iMzIiIGN5PSIzMiIgcj0iOS41IiBzdHJva2U9IiNmZmZmZmYiLz4KICA8L2c+Cjwvc3ZnPgo=") center / contain no-repeat;
  flex: none;
}

.brand-name {
  text-transform: uppercase;
}

.brand-accent {
  color: var(--stamp);
}

.nav {
  display: flex;
  gap: var(--space-0);
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.nav a {
  display: inline-flex;
  padding: 0 var(--space-4);
  margin-bottom: calc(var(--hairline) * -1);
  border-bottom: var(--rule-strong) solid transparent;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
  align-items:  center;
}

.nav a:hover {
  background: var(--surface-hover);
}

.nav a[aria-current="page"] {
  font-weight: var(--weight-bold);
  border-bottom-color: var(--accent);
}

.monitor-status {
  display: inline-flex;
  align-self:  center;
  align-items:  center;
  gap: var(--space-2);
  min-height: var(--control-lg);
  color: var(--text);
  font-size: var(--text-xs);
  text-decoration: none;
  white-space: nowrap;
}

.monitor-status:hover {
  color: var(--text);
  text-decoration: none;
}

.monitor-label {
  font-weight: var(--weight-semibold);
}

.monitor-status.status-off .monitor-label {
  color: var(--bad);
}

.monitor-detail {
  color: var(--muted);
}

.who-link {
  color: inherit;
  text-decoration: none;
}

.who-link:hover, .who-link[aria-current="page"] {
  color: var(--text);
}

.who-short {
  display: none;
}

@media (width <= 900px) {
  .who .mono {
    display: none;
  }

  .who-short {
    display: inline;
  }
}

@media (width <= 520px) {
  .monitor-detail {
    display: none;
  }
}

.who {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
  margin-left: auto;
}

.shell-foot {
  max-width: var(--page);
  padding: 0 var(--gutter) var(--space-5);
  margin: 0 auto;
}

.content {
  max-width: var(--page);
  padding: var(--space-5) var(--gutter) var(--space-14);
  display: grid;
  gap: var(--space-3);
  align-content:  start;
  margin: 0 auto;
}

.content > * {
  animation: view-in var(--duration-enter) var(--ease-out) both;
  min-width: 0;
}

.center {
  display: grid;
  padding: var(--gutter);
  place-items:  center;
  min-height: 100vh;
}

.page-head, .section-head {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: var(--space-3);
}

.page-head {
  min-height: var(--control-md);
}

.page-head a {
  font-size: var(--text-xs);
  color: var(--muted);
}

.page-head a:hover {
  color: var(--text);
}

.section-head {
  margin-bottom: var(--space-3);
}

.card .section-head {
  margin-bottom: 0;
}

.section-head a {
  font-size: var(--text-xs);
  color: var(--muted);
}

.section-head a:hover {
  color: var(--text);
}

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.tiles-even {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  align-content:  start;
}

a.tile {
  transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

a.tile:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-card-hover);
  color: inherit;
  text-decoration: none;
}

.tile-label {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--muted);
}

.tile-value {
  font-size: var(--text-stat);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.tile-unit {
  margin-left: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
}

.tile-hint {
  color: var(--muted);
  font-size: var(--text-xs);
}

.tile-alert .tile-value, .tile-alert .tile-label strong {
  color: var(--warn);
}

.stats {
  display: grid;
  gap: var(--space-3);
}

.stats .section-head {
  margin-bottom: 0;
}

.stats h3 {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.stats-note {
  font-size: var(--text-xs);
}

.pulse {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--muted);
  flex: none;
}

.status-on .pulse {
  background: var(--ok);
  animation: 2s ease-out infinite beat;
}

.status-off .pulse {
  background: var(--bad);
}

@keyframes beat {
  0% {
    box-shadow: 0 0 #2b6a4c59;
  }

  70%, 100% {
    box-shadow: 0 0 0 var(--space-2) #2b6a4c00;
  }
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  overflow-x: auto;
}

.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table th, .table td {
  padding: var(--space-2) var(--space-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: var(--hairline) solid var(--line);
}

.table th {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--muted);
  white-space: nowrap;
}

.table td .btn {
  padding: 0 var(--space-2);
  height: var(--control-sm);
  font-size: var(--text-xs);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--surface-hover);
}

.table td {
  transition: background-color var(--duration-fast) var(--ease-out);
}

.table th.num, .table td.num {
  text-align: right;
}

.table th.actions, .table td.actions {
  text-align: right;
  white-space: nowrap;
}

.table td.actions .btn + .btn {
  margin-left: var(--space-1);
}

.table td .block + .block {
  margin-top: var(--space-0);
}

.table .mono, .amount {
  white-space: nowrap;
}

.amount-nudge {
  color: var(--stamp);
}

.badge {
  display: inline-flex;
  align-items:  center;
  gap: var(--space-1);
  height: var(--badge-h);
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  line-height: 1;
}

.badge:before {
  content: "";
  width: var(--space-1);
  height: var(--space-1);
  border-radius: var(--radius-pill);
  background: currentColor;
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.badge-idle {
  background: var(--idle-soft);
  color: var(--muted);
}

.skeleton-bar {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--surface-press) 50%, var(--surface-sunken) 75%);
  animation: 1.4s linear infinite shimmer;
  background-size: 200% 100%;
  max-width: 100%;
  height: .75rem;
}

.skeleton-bar-sm {
  height: .625rem;
}

.skeleton-bar-lg {
  height: 1.75rem;
}

.skeleton-lines {
  gap: var(--space-4);
}

.center > .skeleton {
  width: min(24rem, 100%);
}

.empty {
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  gap: var(--space-1);
  height: var(--control-md);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface-sunken);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
  border: 0;
}

.btn:hover:not(:disabled) {
  background: var(--surface-press);
}

.btn:disabled {
  color: var(--disabled-ink);
  background: var(--surface-sunken);
  cursor: not-allowed;
}

.btn-primary {
  color: var(--text-invert);
  background: var(--ink);
  font-weight: var(--weight-semibold);
}

.btn-primary:hover:not(:disabled) {
  background: var(--ink-hover);
}

.btn-quiet {
  color: var(--muted);
  background: none;
}

.btn-quiet:disabled {
  color: var(--disabled-ink);
  background: none;
}

.btn-quiet:hover:not(:disabled) {
  color: var(--text);
  background: var(--idle-soft);
}

.btn-danger {
  color: var(--bad);
  background: var(--bad-soft);
  justify-self: start;
}

.btn-danger:hover:not(:disabled) {
  background: var(--bad-soft-hover);
}

.btn-icon {
  display: inline-grid;
  width: var(--control-icon);
  height: var(--control-icon);
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
  background: none;
  border: 0;
  place-items:  center;
  padding: 0;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--idle-soft);
}

.copy-field {
  position: relative;
  width: 100%;
}

.copy-field input[type="text"] {
  padding-right: calc(var(--control-icon)  + var(--space-1));
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
}

.copy-field .btn-icon {
  position: absolute;
  top: 50%;
  right: 1px;
  transform: translateY(-50%);
}

.btn-icon.copy-done {
  color: var(--ok);
  background: var(--ok-soft);
}

.btn-icon.copy-failed {
  color: var(--bad);
  background: var(--bad-soft);
}

.btn-icon svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
  stroke-width: var(--icon-stroke);
}

.link {
  margin-left: var(--space-2);
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

.chips {
  display: inline-flex;
  justify-self: start;
  gap: var(--space-0);
  padding: var(--space-1);
  overflow-x: auto;
  background: var(--surface-sunken);
  border-radius: var(--radius);
  scrollbar-width: none;
  max-width: 100%;
}

.chip {
  height: var(--control-chip);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
  background: none;
  border: 0;
}

.chip:hover {
  color: var(--text);
}

.chip-on, .chip-on:hover {
  color: var(--text);
  font-weight: var(--weight-semibold);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.chips-row {
  display: flex;
  align-items:  center;
  gap: var(--space-3) var(--space-5);
  flex-wrap: wrap;
}

.chips-titled {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  max-width: 100%;
}

.chips-title {
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}

.chips-sep {
  width: var(--hairline);
  background: var(--line);
  align-self: stretch;
}

@media (width <= 640px) {
  .chips-sep {
    display: none;
  }
}

.subnav {
  display: inline-flex;
  justify-self: start;
  gap: var(--space-0);
  padding: var(--space-1);
  overflow-x: auto;
  background: var(--surface-sunken);
  border-radius: var(--radius);
  scrollbar-width: none;
  max-width: 100%;
}

.subnav a {
  display: inline-flex;
  height: var(--control-chip);
  padding: 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-xs);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  align-items:  center;
}

.subnav a:hover {
  color: var(--text);
}

.subnav a[aria-current="page"] {
  color: var(--text);
  font-weight: var(--weight-semibold);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.pager {
  display: flex;
  justify-content: center;
  align-items:  center;
  gap: var(--space-2);
  padding-top: var(--space-0);
}

.pager .mono {
  min-width: var(--pager-num-w);
  text-align: center;
}

.note {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-xs);
}

.note-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.note-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.note-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.card {
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: var(--space-3);
  align-content:  start;
}

.form {
  display: grid;
  gap: var(--space-3);
}

.field {
  display: grid;
  gap: var(--space-1);
  align-content:  start;
}

.field > span {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.field small {
  color: var(--muted);
  font-size: var(--text-2xs);
  line-height: var(--leading-body);
}

.field small.field-bad {
  color: var(--bad);
}

.dropzone {
  position: relative;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  text-align: center;
  cursor: pointer;
  justify-items: center;
}

.dropzone:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
}

.dropzone:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.dropzone[data-dragging="true"] {
  border-style: solid;
  border-color: var(--text);
  background: var(--accent-soft);
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.dropzone strong {
  font-size: var(--text-xs);
}

.dropzone small {
  color: var(--muted);
  font-size: var(--text-2xs);
  line-height: var(--leading-body);
}

.upload-note {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  margin: 0;
}

.upload-note-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.upload-note-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.upload-note-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

select {
  height: var(--control-md);
  padding: 0 var(--space-2);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface);
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
}

select:hover:not(:disabled) {
  border-color: var(--line-hover);
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items:  end;
}

.invitation-stack {
  display: grid;
  gap: var(--space-2);
}

.invitation-line {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: var(--space-3);
}

.invitation-line > div {
  display: flex;
  gap: var(--space-2);
}

input[type="text"], input[type="date"], input[type="email"], input[type="password"], textarea {
  height: var(--control-md);
  padding: 0 var(--space-2);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface);
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
  width: 100%;
}

textarea {
  min-height: calc(var(--control-md) * 2);
  padding: var(--space-2);
  line-height: var(--leading-body);
  height: auto;
}

input[type="text"]:hover:not(:disabled), input[type="date"]:hover:not(:disabled), input[type="email"]:hover:not(:disabled), input[type="password"]:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--line-hover);
}

input[type="text"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--space-1) #1e1d1a14;
  border-color: #7d7870;
}

input[type="date"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--space-1) #1e1d1a14;
  border-color: #7d7870;
}

input[type="email"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--space-1) #1e1d1a14;
  border-color: #7d7870;
}

input[type="password"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--space-1) #1e1d1a14;
  border-color: #7d7870;
}

textarea:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--space-1) #1e1d1a14;
  border-color: #7d7870;
}

input::placeholder, textarea::placeholder {
  color: #a8a294;
}

input:disabled {
  color: var(--muted);
  background: var(--surface-sunken);
  border-color: var(--line);
  cursor: not-allowed;
}

.filters {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items:  start;
}

.filters .field {
  flex: 10rem;
  max-width: 16rem;
}

.filters-actions {
  display: flex;
  gap: var(--space-2);
  align-self:  end;
}

.rows {
  margin: 0;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: var(--hairline) solid var(--line);
}

.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row dt {
  color: var(--text);
  font-size: var(--text-sm);
}

.row dd {
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.login {
  width: min(var(--login-w), 100%);
  padding: var(--space-6);
  gap: var(--space-4);
  box-shadow: var(--shadow);
}

.login .brand {
  font-size: var(--text-sm);
  color: var(--muted);
  align-self:  start;
}

.login .brand small {
  display: none;
}

input.code-input {
  height: var(--control-lg);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  text-align: center;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
}

.support-note {
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
  margin: 0;
}

.login-foot {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: var(--hairline) solid var(--line);
  font-size: var(--text-xs);
  text-align: center;
  justify-items: center;
}

.drawer-body .link-quiet {
  font-size: var(--text-xs);
  justify-self: start;
}

.link-quiet {
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: var(--underline-offset);
  background: none;
  border: 0;
  padding: 0;
}

.link-quiet:hover:not(:disabled) {
  text-decoration-color: currentColor;
}

.link-quiet:disabled {
  color: var(--muted);
  text-decoration-color: #0000;
  cursor: default;
}

.facts {
  display: grid;
  grid-template-columns: var(--facts-label) minmax(0, 1fr);
  column-gap: var(--space-5);
  padding: var(--space-1) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin: 0;
}

.facts dt, .facts dd {
  padding: var(--space-2) 0;
  border-bottom: var(--hairline) solid var(--line);
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: var(--text-xs);
}

.facts > :nth-last-child(-n+2) {
  border-bottom: 0;
}

.refunds {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.refunds h3 {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.choices {
  display: grid;
  gap: var(--space-1);
  border: 0;
  margin: 0;
  padding: 0;
}

.choices-label {
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 0;
}

.choice {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--surface-sunken);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  cursor: pointer;
  border: 0;
  align-items:  center;
}

.choice:hover {
  background: var(--surface-press);
}

.choice:has(input:checked) {
  background: var(--accent-soft);
}

.choice input {
  accent-color: var(--ink);
}

.secret, .pairing {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: var(--hairline) solid var(--line);
}

.secret-line {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.secret-line strong {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.secret-line .muted {
  font-size: var(--text-xs);
}

.secret-line .btn:last-child, .secret-line .secret-hint {
  margin-left: auto;
}

.secret-mask {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.secret-reveal {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.secret-value {
  display: block;
  padding: var(--space-2);
  overflow-wrap: anywhere;
  background: var(--slot);
  color: var(--slot-ink);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  user-select: all;
  max-width: 100%;
}

.pairing-body, .pairing-code {
  display: grid;
  gap: var(--space-4);
  text-align: center;
  justify-items: center;
}

.pairing-body > .field {
  text-align: left;
  justify-self: stretch;
}

.pairing-host {
  display: grid;
  gap: var(--space-1);
  max-width: 100%;
}

.pairing-host span {
  font-size: var(--text-2xs);
  color: var(--muted);
}

.pairing-host code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.pairing-code {
  gap: var(--space-3);
  width: 100%;
}

.pairing-qr {
  width: min(var(--qr-w), 100%);
  padding: var(--space-3);
  border-radius: var(--radius);
  box-shadow: 0 0 0 var(--hairline) var(--line);
  background: #fff;
  height: auto;
}

.pairing-code .note {
  line-height: var(--leading-body);
  width: 100%;
}

.drawer {
  position: fixed;
  overflow: clip;
  color: inherit;
  background: none;
  border: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  inset: 0;
}

.drawer::backdrop {
  background: var(--backdrop);
  animation: scrim-in var(--duration-enter) var(--ease-out) both;
}

.drawer.leaving::backdrop {
  animation: scrim-out var(--duration-enter) var(--ease-out) both;
}

.drawer-panel {
  position: absolute;
  display: flex;
  width: min(var(--drawer-width), 100%);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  animation: drawer-in var(--duration-enter) var(--ease-out) both;
  flex-direction: column;
  height: 100%;
  top: 0;
  right: 0;
}

.drawer-panel.leaving {
  animation: drawer-out var(--duration-enter) var(--ease-out) both;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.drawer-head {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border-bottom: var(--hairline) solid var(--line);
}

.drawer-head h2 {
  font-size: var(--text-md);
  flex: 1;
}

.drawer-body {
  display: grid;
  gap: var(--space-3);
  overflow: auto;
  padding: var(--space-4) var(--space-5) var(--space-5);
  flex: 1;
  align-content:  start;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: var(--hairline) solid var(--line);
}

.modal {
  width: min(var(--modal-width), calc(100% - var(--gutter) * 2));
  max-height: calc(100% - var(--gutter) * 2);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-lift);
  animation: view-in var(--duration-enter) var(--ease-out) both;
  border: 0;
  margin: auto;
  padding: 0;
}

.modal::backdrop {
  background: var(--backdrop);
  animation: scrim-in var(--duration-enter) var(--ease-out) both;
}

.modal-head {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border-bottom: var(--hairline) solid var(--line);
}

.modal-head h2 {
  font-size: var(--text-md);
  flex: 1;
}

.modal-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

html.drawer-open {
  overflow: hidden;
}

@media (width <= 520px) {
  .drawer-panel {
    width: 100%;
  }
}

@media (width <= 760px) {
  :root {
    --gutter: var(--space-4);
  }

  .topbar-inner {
    gap: 0 var(--space-4);
    padding-top: var(--space-2);
    flex-wrap: wrap;
  }

  .brand {
    min-height: var(--control-lg);
  }

  .nav {
    flex-basis: 100%;
    order: 3;
    gap: 0;
  }

  .nav a {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    margin-bottom: 0;
  }

  .content {
    padding-top: var(--space-4);
    padding-bottom: var(--space-10);
  }

  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .table {
    min-width: var(--table-min);
  }

  .table td {
    white-space: nowrap;
  }

  .table td .wrap {
    white-space: normal;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .facts dt {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .facts dd {
    padding-top: var(--space-0);
  }

  .who .mono {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-on .pulse, .skeleton-bar, .content > *, .modal, .drawer-panel, .drawer-panel.leaving {
    animation: none;
  }

  .modal::backdrop {
    animation: none;
  }

  .drawer::backdrop {
    animation: none;
  }

  .drawer.leaving::backdrop {
    animation: none;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(var(--enter-lift));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }

  to {
    transform: none;
  }
}

@keyframes drawer-out {
  from {
    transform: none;
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scrim-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}
