:root {
  color-scheme: dark;
  --bg: #060606;
  --surface: #0c0c0c;
  --overlay: #111111;
  --input: #080808;
  --hover: #191919;
  --ink: #ededed;
  --muted: #a1a1a1;
  --dim: #777777;
  --line: #292929;
  --soft-line: #1d1d1d;
  --accent: #e43629;
  --action: #c52f23;
  --accent-text: #ff766a;
  --focus: #ff9c8e;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, Menlo, "SF Mono", Consolas, monospace;
  --gutter: clamp(16px, 5vw, 88px);
  font: 14px/1.6 var(--sans);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { min-height: 44px; cursor: pointer; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); padding: 10px 16px; font-size: 12px; font-weight: 500; }
button:hover:enabled { background: var(--hover); border-color: var(--dim); }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
header { min-height: 80px; padding: 16px var(--gutter); display: flex; align-items: center; gap: 32px; border-bottom: 1px solid var(--line); }
.brand { font-size: 28px; font-weight: 600; letter-spacing: -1.3px; line-height: 1; }
.edition, .network-badge { font: 11px var(--mono); color: var(--muted); }
.network-badge { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.network-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
header button { white-space: nowrap; }
.workbench { width: min(1280px, 100% - 2 * var(--gutter)); margin: auto; display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100svh - 80px); }
.rail { border-right: 1px solid var(--line); padding: 40px 16px 24px 0; display: flex; flex-direction: column; gap: 20px; }
.rail-label, .eyebrow { font: 10px/1.6 var(--mono); letter-spacing: .08em; color: var(--muted); }
.rail-label { padding-left: 16px; }
.rail nav { display: grid; gap: 4px; }
.rail nav a { padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-left: 2px solid transparent; color: var(--muted); border-radius: 3px; }
.rail nav a:hover, .rail nav a[aria-current] { background: var(--surface); color: var(--ink); }
.rail nav a[aria-current] { border-left-color: var(--accent); }
.rail nav span { color: var(--accent-text); font-size: 20px; width: 20px; }
.rail-bottom { margin-top: auto; padding: 40px 16px 0; font-size: 12px; color: var(--muted); }
.rail-bottom small { color: var(--dim); }
main { min-width: 0; padding: 24px 0 0 40px; }
.vault-create-control { display: flex; flex-direction: column; align-items: flex-start; }
.vault-loading-hint { max-width: 260px; margin: 6px 0 0; }
.wallet-startup-dialog { text-align: center; padding: 32px; }
.wallet-startup-dialog progress { width: 100%; height: 5px; accent-color: var(--accent); }
#status, #vault-status { font-size: 12px; color: var(--muted); min-height: 20px; overflow-wrap: anywhere; }
.heading { padding: 20px 0 32px; }
h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -.04em; font-weight: 500; line-height: 1.15; margin: 0; }
.lede { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
h2 { font-size: 24px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; margin: 0 0 16px; }
h3 { font-size: 20px; font-weight: 500; margin: 24px 0 12px; }
.layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.account-card { order: 1; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 355px; padding: 28px; }
.card-top, .card-bottom { display: flex; justify-content: space-between; gap: 12px; font: 10px var(--mono); color: var(--muted); }
#account-state { color: var(--accent-text); }
.amount { font-size: 60px; letter-spacing: -.04em; line-height: 1.2; margin-top: 42px; }
.amount span { font-size: 24px; color: var(--muted); }
.balance-note { font-size: 12px; color: var(--muted); }
.card-actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.card-actions button { padding: 8px 12px; }
.card-bottom { margin-top: auto; padding-top: 30px; font-size: 9px; }
.surface { border: 1px solid var(--line); background: var(--surface); padding: 28px; min-width: 0; }
.surface p, .recovery-panel p { color: var(--muted); font-size: 12px; }
.surface .eyebrow { display: block; margin-bottom: 16px; }
.choices { display: grid; gap: 12px; margin: 24px 0 12px; }
.choice { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); text-align: left; gap: 4px 10px; padding: 16px 32px 16px 12px; }
.choice span { color: var(--accent-text); grid-row: span 2; font: 11px/1.8 var(--mono); }
.choice strong { font-size: 12px; font-weight: 500; }
.choice small { font-size: 11px; color: var(--muted); font-weight: 400; }
.choice b { position: absolute; right: 14px; top: 18px; font-weight: 400; }
.text-button { border-color: transparent; padding: 8px 0; color: var(--muted); }
label { display: block; font-size: 12px; font-weight: 500; margin: 20px 0 8px; }
input, textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 3px; padding: 12px; background: var(--input); color: var(--ink); font-size: 12px; }
textarea { resize: vertical; word-break: break-all; font-family: var(--mono); line-height: 1.6; }
#network, #vault-network { font-family: var(--mono); font-size: 11px; }
#receiving { grid-column: 1; grid-row: 1; }
#short-address { display: block; font: 11px/1.7 var(--mono); overflow-wrap: anywhere; padding-bottom: 16px; }
details { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
summary { cursor: pointer; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 64px; padding: 20px 0; border-top: 1px solid var(--line); font: 10px/1.6 var(--mono); color: var(--muted); }
dialog { width: min(540px, calc(100% - 32px)); padding: 24px 32px 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--overlay); color: var(--ink); max-height: calc(100svh - 32px); overflow-y: auto; }
dialog::backdrop { background: #000000d9; }
body:has(dialog[open]) { overflow-y: hidden; }
dialog h2 { font-size: 28px; }
dialog p { font-size: 12px; color: var(--muted); }
.close { float: right; border: 0; font-size: 25px; font-weight: 400; margin: -12px -16px 0 0; padding: 0; min-width: 44px; }
.primary { background: var(--action); border-color: var(--action); color: #fff; }
.primary:hover:enabled { background: #d33125; border-color: #d33125; }
dialog .primary { width: 100%; margin-top: 12px; }
.help { color: var(--muted); font-size: 11px !important; line-height: 1.6; }
#words-view .recovery-warning { margin: 12px 0 20px; padding: 14px 16px; border: 1px solid var(--accent-text); border-left-width: 4px; background: #281512; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.6; }
#words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 0 12px 28px; gap: 12px 24px; font: 12px/1.6 var(--mono); }
#words li::marker { color: var(--dim); font-size: 10px; }
#flow-error, #vault-error, .error { color: var(--accent-text) !important; min-height: 18px; }
.skip { position: absolute; left: 20px; top: -80px; background: var(--action); color: white; padding: 14px; z-index: 10; }
.skip:focus { top: 12px; }
#saved { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
#saved button { margin-top: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.page-heading button { white-space: nowrap; }
.vault-notice { padding: 16px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.vault-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; margin-top: 32px; }
.collection-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-block: 1px solid var(--line); }
.collection-bar h2 { font-size: 14px; margin: 0; }
#vault-count { font: 12px var(--mono); color: var(--muted); margin-left: 8px; }
.vault-empty { text-align: center; padding: 40px 20px; border-bottom: 1px solid var(--line); }
.vault-empty p { color: var(--muted); font-size: 12px; }
.package-mark { display: block; font-size: 64px; font-weight: 200; color: var(--accent-text); }
.recovery-panel { border-top: 1px solid var(--line); padding-top: 16px; }
.recovery-panel h2 { margin-top: 16px; }
.recovery-panel button { width: 100%; margin: 12px 0; }
.vault-entry { padding: 24px 0; border-bottom: 1px solid var(--line); }
.vault-entry h3 { font-size: 14px; margin: 0 0 8px; }
.vault-entry p { color: var(--muted); font: 10px/1.7 var(--mono); overflow-wrap: anywhere; }
.vault-entry .actions { margin-bottom: 0; }
#vault-open-secret { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .workbench { grid-template-columns: 170px minmax(0, 1fr); }
  main { padding-left: 24px; }
  .layout, .vault-layout { grid-template-columns: minmax(0, 1fr); }
  #receiving { grid-column: auto; grid-row: auto; }
  .recovery-panel { max-width: 540px; }
}
@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 16px; padding: 18px var(--gutter); }
  .edition { display: none; }
  .brand { font-size: 24px; }
  .network-badge { font-size: 10px; }
  header button { font-size: 10px; }
  .workbench { display: block; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 0; }
  .rail-label, .rail-bottom { display: none; }
  .rail nav { display: flex; gap: 12px; }
  main { padding: 12px 0 0; }
  .account-card, .surface { padding: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; gap: 8px; }
  dialog { padding: 24px; }
  #words { gap: 10px 12px; font-size: 11px; }
}

.proof-progress { margin-top: 20px; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.proof-progress p { margin: 0 0 12px; }
.proof-progress p:last-child { margin: 12px 0 0; }
.proof-progress progress { display: block; width: 100%; height: 6px; accent-color: var(--accent); }
.proof-progress progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.proof-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }

#wallet-collection { margin-bottom: 24px; }
.wallet-entry { border: 1px solid var(--line); background: var(--surface); margin: 12px 0; padding: 0; }
.wallet-entry > summary { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(180px,2fr); gap: 6px 20px; padding: 20px 24px; }
.wallet-entry > summary::before { content: '＋'; color: var(--accent-text); grid-row: span 2; }
.wallet-entry[open] > summary::before { content: '−'; }
.wallet-entry[open] > summary { border-bottom: 1px solid var(--line); }
.wallet-entry > summary strong { overflow-wrap: anywhere; font-size: 15px; }
.wallet-address-hint { color: var(--muted); font: 11px/1.8 var(--mono); }
.wallet-summary-balance { color: var(--muted); font-size: 12px; grid-column: 2/-1; }
#wallet-count { color: var(--muted); font: 11px/1.8 var(--mono); margin-left: 8px; white-space: nowrap; }
.wallet-entry-body { padding: 0 20px 20px; }
.wallet-entry-actions { display: flex; justify-content: flex-end; padding: 12px 0; }
.wallet-entry-actions button { padding: 6px 12px; font-size: 12px; }
#wallet-history { margin-top: 24px; }
.history-filters, .history-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.history-filters button[aria-pressed=true] { border-color: var(--accent-text); color: var(--accent-text); }
.history-pages { justify-content: flex-end; font-size: 11px; color: var(--muted); }
.transaction-entry { margin: 0; padding: 16px 0; }
.transaction-entry summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.transaction-title, .transaction-amount { font-weight: 500; }
.transaction-status, .transaction-date { color: var(--muted); font-size: 11px; }
.transaction-entry p { overflow-wrap: anywhere; font: 11px/1.8 var(--mono); }
#send-source { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wallet-entry > summary { padding: 16px; grid-template-columns: auto minmax(0,1fr); }
  .wallet-entry > summary::before { grid-row: span 3; }
  .wallet-address-hint { grid-column: 2; }
  .wallet-entry-body { padding: 0 12px 12px; }
  .transaction-entry summary { grid-template-columns: minmax(0,1fr); }
}

:root {

  color-scheme: dark;
  --color-canvas: #060606;
  --color-surface: #0c0c0c;
  --color-overlay: #111111;
  --color-input: #080808;
  --color-hover: #191919;
  --color-text: #ededed;
  --color-secondary: #cfcfcf;
  --color-muted: #a1a1a1;
  --color-dim: #777777;
  --color-rule: #292929;
  --color-rule-soft: #1d1d1d;
  --color-accent: #e43629;
  --color-accent-hover: #ff4a3d;
  --color-accent-text: #ff766a;
  --color-accent-surface: #24100d;
  --color-action: #c52f23;
  --color-action-hover: #d33125;
  --color-on-accent: #ffffff;
  --color-focus: #ff9c8e;
  --color-backdrop: #000000d9;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, Menlo, "SF Mono", Consolas, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --layout-max: 1280px;
  --layout-gutter: clamp(16px, 5vw, 88px);
  --text-caption: 11px;
  --text-small: 12px;
  --text-body: 14px;
  --text-title: 24px;
  --radius-control: 3px;
  --radius-dialog: 6px;
  --rule-width: 1px;
  --dur-fast: 150ms;
  --dur-enter: 220ms;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}
.parcel-scene { display: grid; justify-items: center; padding: 44px 0 28px; margin: 0 0 24px; border-bottom: 1px solid var(--color-rule); }
.parcel { position: relative; width: 164px; height: 112px; perspective: 600px; margin-right: 28px; }
.parcel::before, .parcel::after { content: ''; position: absolute; border: 1px solid var(--color-accent); background: var(--color-surface); }
.parcel::before { left: 164px; top: 16px; width: 28px; height: 96px; transform: skewY(-30deg); transform-origin: left top; }
.parcel::after { left: 14px; top: 0; width: 164px; height: 16px; transform: skewX(-60deg); }
.parcel-body { position: absolute; inset: 16px 0 0; background: var(--color-surface); border: 1px solid var(--color-accent); }
.parcel-paper { position: absolute; width: 108px; height: 76px; top: -12px; left: 28px; background: var(--color-secondary); z-index: 1; padding: 20px; opacity: 0; }
.parcel-paper i { display: block; height: 4px; background: var(--color-dim); margin-bottom: 8px; }
.parcel-flap { position: absolute; width: 83px; top: 16px; bottom: 0; background: var(--color-surface); border: 1px solid var(--color-accent); z-index: 2; backface-visibility: hidden; }
.parcel-flap.left { left: 0; transform-origin: left center; }
.parcel-flap.right { right: 0; transform-origin: right center; }
.parcel-lid { position: absolute; top: 16px; left: 0; width: 164px; height: 36px; background: var(--color-surface); border: 1px solid var(--color-accent); z-index: 3; transform-origin: center top; backface-visibility: hidden; }
.parcel-stamp { position: absolute; width: 36px; height: 98px; top: 15px; left: 64px; background: var(--color-accent); color: var(--color-on-accent); font: 16px/1 var(--font-mono); text-align: center; padding-top: 32px; z-index: 4; border: 1px solid var(--color-accent-hover); }
.parcel-stamp span { display: block; font-size: 6px; letter-spacing: .08em; margin-top: 8px; }
.parcel-caption { color: var(--color-muted); font: 9px var(--font-mono); letter-spacing: .1em; margin-top: 24px; }
.vault-entry-animation .parcel-scene { padding: 36px 0 20px; margin: 0; border: 0; }
.vault-entry-animation { --parcel-wait: 600ms; }
.vault-entry-animation + #vault-list:not(:empty) { border-top: 1px solid var(--color-rule-soft); }
.animate-parcel .parcel-paper { animation: pack-paper 650ms var(--parcel-wait, 0ms) var(--ease-out) both; }
.animate-parcel .parcel-flap.left { animation: fold-left 450ms calc(450ms + var(--parcel-wait, 0ms)) var(--ease-out) both; }
.animate-parcel .parcel-flap.right { animation: fold-right 450ms calc(650ms + var(--parcel-wait, 0ms)) var(--ease-out) both; }
.animate-parcel .parcel-lid { animation: close-lid 400ms calc(1050ms + var(--parcel-wait, 0ms)) var(--ease-out) both; }
.animate-parcel .parcel-stamp { animation: seal-package 350ms calc(1450ms + var(--parcel-wait, 0ms)) var(--ease-out) both; }
@keyframes pack-paper { from { transform: translateY(-28px); opacity: 0; } 25%, 60% { opacity: 1; } to { transform: translateY(36px); opacity: 0; } }
@keyframes fold-left { from { transform: rotateY(-115deg); } to { transform: rotateY(0); } }
@keyframes fold-right { from { transform: rotateY(115deg); } to { transform: rotateY(0); } }
@keyframes close-lid { from { transform: rotateX(110deg); opacity: 0; } 20% { opacity: 1; } to { transform: rotateX(0); opacity: 1; } }
@keyframes seal-package { from { transform: translateY(-8px) scale(.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {.parcel *, .parcel::before, .parcel::after {animation:none !important;transition:none !important;} .parcel-paper {opacity:0;}}
