*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--canvas); color: var(--ink);
  font: 14px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased;
  overflow: hidden; overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
canvas:focus-visible { outline-offset: -4px; border-radius: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600;
  transition: background .15s, border-color .15s, transform .15s var(--ease);
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.busy[disabled] { cursor: progress; }
.btn.primary { background: var(--grad); color: var(--on-grad); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: var(--on-bad); border-color: var(--bad); }
.btn .spin { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.busy .spin { display: inline-block; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--sunken); border-color: var(--line); }

/* fields */
.field { display: grid; gap: 6px; }
.field > label, .lbl { font: 600 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.45; }
.input:hover { border-color: var(--faint); }
.input:focus-visible { outline-offset: 0; border-color: var(--focus); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (pointer: coarse) { .btn { min-height: var(--tap); } .input, select.input { min-height: var(--tap); } }
