/* Muted: shared tokens and components (the look of draft C). Materials from the picked film (om:V249): near-black ground, fine borders,
   small functional text, medium-bold sans. Accent is the dice's yellow, used for one meaning: opened by a key. */
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Commit Mono"; src: url("../fonts/commit-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Commit Mono"; src: url("../fonts/commit-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --ground: #0a0a09;
  --plane: #111110;
  --plane-2: #161614;
  --plane-3: #1e1d1a;
  --plane-4: #282722;
  --line: rgba(236, 232, 220, .085);
  --line-2: rgba(236, 232, 220, .16);
  --ink: #ecebe6;
  --ink-2: #b9b6ad;
  --ink-3: #8f8c83;
  --key: #f4c430;
  --key-ink: #0c0b08;
  --key-band: #2a1e07;
  --key-edge: #b38f22;
  --seal: #c06650;
  --seal-band: #26130f;
  --seal-edge: #6d3326;
  --seal-bar: #4a2a22;
  --ok: #10b981;
  --bad: #f43f5e;
  --sans: "Commissioner", system-ui, sans-serif;
  --mono: "Commit Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-long: cubic-bezier(.16, 1, .3, 1);
  --ease-press: cubic-bezier(.4, 0, .2, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --r-ctrl: 10px;
  --r-card: 14px;
  --r-panel: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.mono, code, kbd, samp { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "calt" 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }

/* The mark: a hairline record line above a sealed bar. The same bar marks every sealed amount on the site. */
.mark { display: inline-block; width: 22px; height: 22px; flex: none; }
.seal {
  display: inline-block; height: .78em; vertical-align: -.06em; border-radius: 3px;
  background: linear-gradient(180deg, #5b3328, var(--seal-bar));
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, .10), inset 0 0 0 1px rgba(192, 102, 80, .28);
}

/* Pills (the dice's round pill). One filled pill per screen. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--plane-3); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform 150ms var(--ease-press), background-color 160ms var(--ease-press), box-shadow 160ms var(--ease-press), color 160ms var(--ease-press);
}
.pill:hover { background: var(--plane-4); }
.pill:active { transform: scale(.97); }
.pill.key { background: var(--key); color: var(--key-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.pill.key:hover { background: #ffd34d; }
.pill[disabled], .pill[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.pill[aria-busy="true"] { cursor: progress; }
.pill .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line);
}
.stamp {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--key); box-shadow: inset 0 0 0 1px var(--key-edge);
}
.stamp i { width: 7px; height: 7px; border-radius: 50%; background: var(--key); }

/* Wallet picker (wallet-kit skeleton, this draft's look) */
.wp-back { position: fixed; inset: 0; z-index: 80; background: rgba(4, 4, 3, .66); opacity: 0; transition: opacity 250ms var(--ease-out); }
.wp-back.open { opacity: 1; }
.wp {
  position: fixed; z-index: 81; left: 50%; top: 50%; width: min(460px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 32px));
  overflow: auto; transform: translate(-50%, -48%) scale(.96); opacity: 0;
  background: var(--plane); border-radius: var(--r-panel); box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, .6);
  padding: 20px; transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.wp.open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wp h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.wp .wp-sub { margin: 4px 0 16px; color: var(--ink-3); font-size: 14px; }
.wp .wp-x { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 20px; }
.wp .wp-x:hover { background: var(--plane-3); }
.wp-label { margin: 14px 0 8px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.wp-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px; border: 0; border-radius: 12px;
  background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; text-align: left;
  transition: background-color 150ms var(--ease-press), transform 150ms var(--ease-press);
}
.wp-row + .wp-row { margin-top: 8px; }
.wp-row:hover { background: var(--plane-3); }
.wp-row:active { transform: scale(.985); }
.wp-row img { width: 32px; height: 32px; border-radius: 8px; }
.wp-row b { font-weight: 600; font-size: 15px; }
.wp-row small { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.wp-row small.last { color: var(--key); }
.wp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wp-tile {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border-radius: 12px; text-decoration: none;
  background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500;
  transition: background-color 150ms var(--ease-press), transform 150ms var(--ease-press);
}
.wp-tile:hover { background: var(--plane-3); }
.wp-tile:active { transform: scale(.97); }
.wp-tile img { width: 26px; height: 26px; border-radius: 7px; }
.wp-msg { margin-top: 14px; min-height: 20px; font-size: 14px; color: var(--ink-2); }
.wp-msg.err { color: #ff8a7a; }
.wp-done { display: grid; gap: 12px; }
.wp-done .addr { font-family: var(--mono); font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line); word-break: break-all; }
.wp-done p { margin: 0; font-size: 14px; color: var(--ink-2); }
.wp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .wp-tiles { grid-template-columns: 1fr; } }


/* Form parts, results and toasts (shared by the app, the picker and the read pages) */
.addr { display: flex; align-items: center; gap: 8px; min-height: 36px; font-family: var(--mono); font-size: 14px; color: var(--ink); }
.addr .lbl { font-family: var(--sans); font-size: 13px; color: var(--ink-3); min-width: 148px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background-color 150ms var(--ease-press), color 150ms var(--ease-press), transform 150ms var(--ease-press); position: relative; }
.iconbtn:hover { background: var(--plane-3); color: var(--ink); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn .ok { position: absolute; opacity: 0; transform: scale(.25); filter: blur(4px); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), filter 300ms var(--ease-out); color: var(--ok); }
.iconbtn .cp { transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), filter 300ms var(--ease-out); }
.iconbtn.done .ok { opacity: 1; transform: none; filter: none; }
.iconbtn.done .cp { opacity: 0; transform: scale(.25); filter: blur(4px); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-3); }
.input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--r-ctrl); border: 0; background: var(--plane-2); color: var(--ink); font-size: 16px; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 150ms var(--ease-press); }
.input.mono { font-family: var(--mono); font-size: 15px; }
.input:hover { box-shadow: inset 0 0 0 1px rgba(236, 232, 220, .26); }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--key); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bad); }
textarea.input { min-height: 150px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.hint { min-height: 18px; font-size: 13px; color: var(--ink-3); }
.hint.err { color: #ff8a8a; }
.cost { font-size: 13px; color: var(--ink-3); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result { padding: 12px; border-radius: 12px; background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; gap: 8px; }
.result.stop { box-shadow: inset 0 0 0 1px var(--key-edge); }
.result b { font-weight: 620; color: var(--ink); }
.err-box { padding: 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--bad); color: #ffb3b3; font-size: 14px; }
.toast-wrap { position: fixed; z-index: 90; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 12px; background: var(--plane-3); box-shadow: 0 0 0 1px var(--line-2), 0 12px 30px rgba(0, 0, 0, .5); font-size: 14px; transform: translateY(100%); opacity: 0; transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out); }
.toast.in { transform: none; opacity: 1; }
.seg { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--plane-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 550; font-size: 14px; cursor: pointer; transition: background-color 150ms var(--ease-press), color 150ms var(--ease-press), transform 150ms var(--ease-press); }
.seg button:hover { color: var(--ink); }
.seg button:active { transform: scale(.97); }
.seg button[aria-selected="true"] { background: var(--plane-4); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.seg button[aria-pressed="true"] { background: var(--plane-4); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.toast.err { box-shadow: 0 0 0 1px var(--bad), 0 12px 30px rgba(0, 0, 0, .5); }
.result a { color: var(--ink-2); text-underline-offset: 3px; }
.result a:hover { color: var(--ink); }
.ext { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ext:hover { color: var(--ink); }
.note { font-size: 13px; color: var(--ink-3); margin: 0; }
.wp-tile small { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.wp-from p { margin: 0 0 6px; }
.wp-bal { font-size: 13px !important; color: var(--ink-3) !important; }
.wp-done .field { margin: 0; }
.wp-done .seg { justify-self: start; }
.seal.w2 { width: 2ch; }

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