:root {
  color-scheme: dark;
  --graphite: #111315;
  --panel: #1b1e21;
  --line: #2a2e33;
  --light: #e6e8ea;
  --muted: #a9b1ba;
  --amber: #ffb020;
  --status: #3ddc97;
  --danger: #ff6b6b;
  --viz-1: #c98500;
  --viz-2: #3987e5;
  --viz-3: #199e70;
  --ink-cost: #5b636c;
  --gutter: 1rem;
  --radius: 8px;
  --radius-sm: 6px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background-color: var(--graphite);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--graphite);
  color: var(--light);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main,
.banner {
  overflow-wrap: anywhere;
}

.wordmark,
.nav,
.btn,
.table {
  overflow-wrap: normal;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  color: var(--light);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.75rem, 2vw + 1.1rem, 2.4rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  max-width: 65ch;
  text-wrap: pretty;
}

a {
  color: var(--amber);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--light);
}

code,
pre,
kbd,
.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

.mono {
  font-size: 0.94em;
}

.nowrap {
  white-space: nowrap;
}

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

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

::selection {
  background: var(--amber);
  color: var(--graphite);
}

.wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.topbar {
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--light);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--light);
}

.wordmark-ring {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--light);
  border-radius: 9999px;
}

.wordmark-dot {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--graphite);
  border-radius: 9999px;
  background: var(--amber);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav form {
  margin: 0;
}

.nav a,
.nav .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.625rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover,
.nav .link-button:hover,
.nav a[aria-current="page"] {
  color: var(--light);
}

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--amber);
}

.link-button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav .link-button {
  text-decoration: none;
}

.banner {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.9375rem;
}

.banner p {
  max-width: 80ch;
  padding-block: 0.75rem;
  padding-left: 0.875rem;
  border-left: 2px solid var(--amber);
}

.banner-info p {
  color: var(--muted);
}

.banner-warn {
  background: rgb(255 176 32 / 9%);
}

.banner-warn p {
  color: var(--light);
}

.main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.page-head {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.back {
  justify-self: start;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.back::before {
  content: "<";
  margin-right: 0.5rem;
  font-family: var(--mono);
}

.back:hover {
  color: var(--light);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.instance-title {
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth {
  max-width: 26rem;
  padding-top: 1rem;
}

.lede {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

.aside {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.actions {
  margin-top: 1.5rem;
}

.form {
  display: grid;
  gap: 1.125rem;
  margin-top: 1.75rem;
}

.form-wide {
  max-width: 40rem;
}

.card .form {
  margin-top: 1.25rem;
}

.field {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}

.field label,
.events legend {
  color: var(--light);
  font-size: 0.875rem;
  font-weight: 500;
}

.hint {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"] {
  width: 100%;
  min-height: 46px;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--graphite);
  color: var(--light);
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color 160ms ease;
}

input.mono {
  font-family: var(--mono);
  font-size: 0.9375rem;
}

input::placeholder {
  color: #7d858e;
}

input:hover {
  border-color: #3a3f45;
}

input:focus-visible {
  border-color: var(--amber);
  outline-offset: 1px;
}

.input-code {
  max-width: 12rem;
  font-family: var(--mono) !important;
  font-size: 1.5rem !important;
  letter-spacing: 0.3em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--amber);
  color: var(--graphite);
}

.btn-primary:hover {
  background: var(--light);
  color: var(--graphite);
}

.btn-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--light);
}

.btn-secondary:hover {
  border-color: var(--muted);
  color: var(--light);
}

.btn-danger {
  border-color: rgb(255 107 107 / 45%);
  background: transparent;
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: rgb(255 107 107 / 8%);
}

.btn-block {
  width: 100%;
}

.alert {
  margin-top: 1.25rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

.alert-error {
  border-color: rgb(255 107 107 / 35%);
  border-left-color: var(--danger);
  background: rgb(255 107 107 / 7%);
  color: #ffd0d0;
}

.alert-ok {
  border-left-color: var(--status);
  background: rgb(61 220 151 / 7%);
  color: var(--light);
}

.resend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.resend .link-button {
  min-height: 44px;
}

.dot {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
}

.dot-ok {
  background: var(--status);
}

.dot-wait {
  background: var(--amber);
}

.dot-down {
  border: 2px solid var(--muted);
}

.dot-off {
  background: var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--light);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--panel);
  font-size: 0.875rem;
}

.instance-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.instance-list li {
  border-bottom: 1px solid var(--line);
}

.instance-row {
  display: grid;
  justify-items: start;
  gap: 0.375rem;
  min-height: 64px;
  padding-block: 0.875rem;
  color: var(--light);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.instance-row:hover {
  color: var(--light);
  background: linear-gradient(to right, transparent, rgb(255 176 32 / 4%));
}

.instance-row:hover .instance-name {
  color: var(--amber);
}

.instance-name {
  font-size: 1.0625rem;
  font-weight: 500;
  min-width: 0;
}

.empty {
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.block {
  margin-top: 2.5rem;
}

.inline-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 34rem;
}

.inline-form .btn {
  justify-self: start;
}

.card {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.card h2 + p,
.card h2 + .facts,
.card h2 + .connect,
.card h2 + .key-box {
  margin-top: 1rem;
}

.card > p + p,
.card > .facts + .code,
.card > .code + .hint,
.card > .hint + .usage,
.card > .hint + form,
.card > p + form {
  margin-top: 1rem;
}

.connect {
  display: grid;
  gap: 1.75rem;
}

.step-title {
  margin-bottom: 0.75rem;
  font-family: var(--display);
  font-weight: 500;
  color: var(--light);
}

.connect-qr .hint {
  margin-top: 0.75rem;
}

.qr {
  min-width: 0;
}

.qr-frame {
  display: block;
  width: 100%;
  max-width: 264px;
  height: auto;
  aspect-ratio: 1;
  padding: 12px;
  border-radius: var(--radius);
  background: #f4f5f6;
  image-rendering: pixelated;
}

.qr-loading {
  border: 1px solid var(--line);
  background: var(--graphite);
}

.qr-done {
  display: grid;
  gap: 0.5rem;
  align-content: center;
  max-width: 264px;
  aspect-ratio: 1;
  padding: 1.25rem;
  border: 1px solid rgb(61 220 151 / 35%);
  border-radius: var(--radius);
  background: rgb(61 220 151 / 6%);
}

.pairing .form {
  margin-top: 0;
}

.pairing .btn {
  justify-self: start;
}

.pair-code {
  margin-bottom: 0.5rem;
  color: var(--amber);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pair-code + .hint {
  margin-bottom: 1.25rem;
  color: var(--light);
}

.facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.facts > div {
  display: grid;
  gap: 0.125rem;
  padding-block: 0.625rem;
  border-top: 1px solid var(--line);
}

.facts > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.facts dd {
  margin: 0;
  min-width: 0;
}

.copyable {
  user-select: all;
}

.code {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--graphite);
  min-width: 0;
}

.code-head {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.code-body {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  color: var(--light);
  font-size: 0.8125rem;
  line-height: 1.8;
  white-space: pre;
  overflow-wrap: normal;
}

.usage {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  max-width: none;
}


.events {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.events legend {
  padding: 0;
  margin-bottom: 0.5rem;
}

.event-grid {
  display: grid;
  gap: 0.25rem;
}

.event {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.event:hover {
  background: rgb(230 232 234 / 4%);
}

.event input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0.2rem 0 0;
  accent-color: var(--amber);
}

.event-text {
  display: grid;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.event-id {
  color: var(--muted);
  font-size: 0.75rem;
}

.form .btn {
  justify-self: start;
}

.form .btn-block {
  justify-self: stretch;
}

.table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  min-width: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  overflow-wrap: normal;
}

.table th {
  padding: 0 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 0.625rem 0.75rem 0.625rem 0;
  white-space: nowrap;
  vertical-align: middle;
}

.table tbody tr + tr td,
.table tbody tr + tr th {
  border-top: 1px solid rgb(42 46 51 / 60%);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .status {
  font-size: 0.875rem;
}

.card > .table-wrap + .hint {
  margin-top: 0.75rem;
}

.danger {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.danger summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.danger summary::-webkit-details-marker {
  display: none;
}

.danger summary::before {
  content: "+";
  width: 1rem;
  color: var(--muted);
  font-family: var(--mono);
}

.danger details[open] summary::before {
  content: "-";
}

.danger summary h2 {
  font-size: 1rem;
  color: var(--danger);
}

.danger details > p {
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  background: rgb(255 176 32 / 15%);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.key-box {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  background: rgb(255 176 32 / 6%);
}

.key-warning {
  color: var(--amber);
  font-weight: 600;
}

.key-row {
  display: grid;
  gap: 0.5rem;
}

.key-value {
  font-size: 0.875rem !important;
}

.key-row .btn {
  justify-self: start;
}

.card > form {
  margin: 0;
}

.card > .hint + form,
.card > p + form,
.card > .key-box + .hint {
  margin-top: 1rem;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--graphite);
  color: var(--light);
  font-family: var(--sans);
  font-size: 1rem;
}

select:hover {
  border-color: #3a3f45;
}

select:focus-visible {
  border-color: var(--amber);
  outline-offset: 1px;
}

.ledger {
  display: grid;
  gap: 0.5rem;
  margin-top: 0;
}

.ledger-label {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.ledger-figure {
  font-family: var(--sans);
  font-size: clamp(2.75rem, 8vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.ledger-figure.is-negative {
  color: var(--danger);
}

.ledger-bar {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 0.75rem;
  border-radius: 9999px;
  overflow: hidden;
}

.ledger-cost {
  fill: var(--ink-cost);
}

.ledger-margin {
  fill: var(--amber);
}

.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.5rem;
  border-radius: 2px;
  vertical-align: baseline;
}

.key-cost {
  background: var(--ink-cost);
}

.key-margin {
  background: var(--amber);
}

.ledger-terms {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.ledger-terms dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.ledger-terms dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.stat {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--graphite);
  min-width: 0;
}

.stat-wide {
  grid-column: 1 / -1;
}

.stat dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.stat dd {
  margin: 0;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.stat-note .status {
  font-size: 0.8125rem;
  color: var(--muted);
}

.charts {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.chart {
  margin: 0;
}

.chart-title {
  font-size: 1rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8125rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-key {
  width: 16px;
  height: 8px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.75rem;
  overflow: visible;
}

.chart-svg .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-svg .tick {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.series {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.end {
  stroke: var(--panel);
  stroke-width: 2;
}

.series.viz-1 { stroke: var(--viz-1); }
.series.viz-2 { stroke: var(--viz-2); }
.series.viz-3 { stroke: var(--viz-3); }
.series.viz-ok { stroke: var(--status); }
.series.viz-bad { stroke: var(--danger); }
.bar.viz-1,
.end.viz-1 { fill: var(--viz-1); }
.end.viz-2 { fill: var(--viz-2); }
.end.viz-3 { fill: var(--viz-3); }
.end.viz-ok { fill: var(--status); }
.end.viz-bad { fill: var(--danger); }

.hit {
  fill: transparent;
}

.hit:hover {
  fill: rgb(230 232 234 / 6%);
}

.chart-table {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.chart-table summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  cursor: pointer;
}

.chart-table summary:hover {
  color: var(--light);
}

.chart-table .table-wrap {
  max-height: 18rem;
  margin-top: 0.25rem;
  overflow-y: auto;
}

.table th[scope="row"] {
  padding-right: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
}

.table tfoot th,
.table tfoot td {
  padding-top: 0.625rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.accounts a {
  font-weight: 500;
}

.sub {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.card h2 + .sub {
  margin-top: 1rem;
}

.sub + p,
.sub + .hint {
  margin-top: 0.375rem;
}

.orphans {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.orphan {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.orphan .btn {
  justify-self: start;
}

.card > .table-wrap + .sub,
.card > .muted + .sub,
.card > .orphans + .sub {
  margin-top: 1.5rem;
}

@media (max-width: 400px) {
  .wordmark {
    font-size: 1.125rem;
  }

  .nav a,
  .nav .link-button {
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }

  .nav-admin a,
  .nav-admin .link-button {
    padding-inline: 0.3125rem;
  }

  .topbar-inner {
    gap: 0.5rem;
  }
}

@media (min-width: 640px) {
  .ledger-terms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .orphan {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .instance-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
  }

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

  .inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .inline-form .btn {
    margin-top: 1.6875rem;
  }

  .facts > div {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1.5rem;
  }

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

@media (min-width: 768px) {
  :root {
    --gutter: 2rem;
  }

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

  .stat-wide {
    grid-column: span 2;
  }

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

  .main {
    padding-top: 3rem;
  }

  .auth {
    padding-top: 2rem;
  }

  .card {
    padding: 1.75rem;
  }

  .connect {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
  }

  .connect-pair {
    padding-left: 2.5rem;
    border-left: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .badge .dot-wait::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: var(--amber);
    animation: dot-ring 1800ms var(--ease) infinite;
  }

  .qr-loading {
    background: linear-gradient(100deg, var(--graphite) 30%, #1a1d20 50%, var(--graphite) 70%);
    background-size: 220% 100%;
    animation: qr-shimmer 1400ms linear infinite;
  }

  .htmx-added.pair-code,
  .htmx-added .pair-code {
    animation: code-in 360ms var(--ease);
  }
}

@keyframes dot-ring {
  0% {
    opacity: 0.55;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@keyframes qr-shimmer {
  to {
    background-position: -120% 0;
  }
}

@keyframes code-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
