/* tokens.css, theme.css and theme.js are the wallet's own files. Only the accent differs, so this
   page reads as a separate site. */
:root {
  --accent: #a8c8e0;
  --link: #a8c8e0;
  --on-accent: #17191e;
}
[data-theme="light"] {
  --accent: #2f6a94;
  --link: #2f6a94;
  --on-accent: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
a { color: var(--link); }
[hidden] { display: none !important; }
code { font-family: var(--font-mono); font-size: 0.92em; overflow-wrap: anywhere; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; font-family: var(--font-sans); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-header); }
.header-left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.header-logo { width: auto; height: 30px; flex-shrink: 0; }
h1 { font-size: 16px; font-weight: 700; white-space: nowrap; }
.header-links { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.header-links a { color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.header-links a:hover { color: var(--text); }

.header-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
#variants { font: inherit; font-size: 13px; width: auto; max-width: 200px; border: 1px solid var(--border); color: var(--text); appearance: none; -webkit-appearance: none; min-height: 32px; padding: 6px 34px 6px 14px; border-radius: 999px; cursor: pointer; background: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%) calc(100% - 19px) 50% / 5px 5px no-repeat, linear-gradient(135deg, var(--text-dim) 50%, transparent 50%) calc(100% - 14px) 50% / 5px 5px no-repeat, var(--bg-input); }
#variants option { background: var(--bg-surface); color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; padding: 7px 14px; border: 1px solid transparent; border-radius: 999px; background: var(--bg-btn); color: var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--bg-btn-hover); }
.btn-sm { font-size: 12px; padding: 3px 11px; }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent); opacity: 0.9; }
#theme-toggle { background: transparent; border-color: var(--border); }
#theme-toggle:hover { background: var(--bg-btn); }

main { flex: 1; display: grid; align-content: start; gap: 16px; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.build-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 0 24px; }
.build-title h2 { font-size: 20px; font-weight: 700; }
.build-title a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.session-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 12px 8px 24px; background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--bg-surface)); border-radius: 24px; font-size: 13px; color: var(--text); }
.session-state { min-width: 0; }
.session-bar code { color: var(--text); }
.session-bar .claims { flex-basis: 100%; padding: 8px 0 6px; border-top: 1px solid color-mix(in srgb, var(--accent) 35%, var(--bg-surface)); }
.step { display: grid; justify-items: start; gap: 14px; padding: 20px 24px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 24px; }
.step > * { max-width: 100%; }
h2 { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.step.done h2::before { content: "✓"; display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); font-size: 12px; }

.choice { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px; border-radius: 22px; background: var(--bg-track); }
.choice button { font: inherit; font-size: 14px; font-weight: 500; height: 34px; padding: 0 16px; border: 0; border-radius: 17px; background: none; color: var(--text-dim); cursor: pointer; }
.choice button:hover { color: var(--text); }
.choice button[aria-pressed="true"] { background: var(--bg-segment); color: var(--text-segment); font-weight: 600; box-shadow: var(--shadow-segment); }

.login, .claims { display: grid; gap: 4px; width: 100%; font-size: 13px; }
.login div, .claims div { display: flex; align-items: center; gap: 12px; }
dt { flex: none; width: 76px; color: var(--text-dim); }
dd { display: flex; min-width: 0; align-items: center; gap: 6px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.about-flow { width: 100%; height: auto; color: var(--text-dim); }
.about-node { fill: var(--bg-raised); stroke: var(--border-subtle); }
.about-name { fill: var(--text); font-size: 15px; font-weight: 600; }
.about-label { fill: var(--text-dim); font-size: 12px; }
.about-edge { stroke: currentColor; stroke-width: 1.5; }
.about-edge.copied { stroke-dasharray: 4 4; }
.about-facts dt { width: 110px; }
@media (max-width: 480px) { .about-name { font-size: 20px; } .about-label { font-size: 14px; } }
.about-gaps { display: grid; gap: 6px; width: 100%; font-size: 13px; }
.about-gaps h3 { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.about-gaps ul { display: grid; gap: 4px; list-style: none; }
.about-gaps li { display: flex; gap: 8px; }
.about-gaps li::before { content: "!"; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--warn-bg); color: var(--warn-fg); font-size: 11px; font-weight: 700; }

#error { padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); overflow-wrap: anywhere; }

dialog { position: fixed; margin: auto; width: 90%; max-width: 600px; max-height: 80vh; padding: 22px; overflow-y: auto; background: var(--bg-dialog); color: var(--text); border: 1px solid var(--border-dialog); border-radius: 22px; box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: var(--scrim); }
.dialog-title { margin-bottom: 14px; font-size: 18px; font-weight: 700; }
.dialog-buttons { display: flex; justify-content: flex-end; }
.trust-section { margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg-raised); }
.trust-section-title { margin-bottom: 4px; font-size: 14px; font-weight: 700; }
.trust-section-hint { margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
.howto { display: grid; gap: 12px; margin-bottom: 16px; font-size: 13px; }
.howto div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.howto dt { width: auto; font-weight: 600; color: var(--text); }
.howto dd { display: block; }
.trust-rows { display: grid; gap: 8px; }
.trust-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.trust-row a { color: var(--link); text-decoration: none; }
.trust-row a:hover { text-decoration: underline; }
.trust-row span { display: block; font-size: 12px; color: var(--text-dim); }
.trust-list-menu { position: relative; margin-left: auto; }
.trust-list-menu summary { list-style: none; white-space: nowrap; }
.trust-list-menu summary::-webkit-details-marker { display: none; }
.trust-list-menu summary::after { content: " ▾"; color: var(--text-dim); }
.trust-list-menu-items { position: absolute; right: 0; z-index: 10; display: flex; flex-direction: column; min-width: 150px; margin-top: 4px; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.trust-list-menu-items button { min-height: 36px; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--text); text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.trust-list-menu-items button:hover { background: var(--bg-raised); }

footer { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 16px 12px; font-size: 12px; color: var(--text-dim); text-align: center; }
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 16px; }
.footer-version, a.footer-version { font-family: var(--font-mono); font-size: 11px; color: var(--text); }

@media (max-width: 640px) {
  header { padding: 12px 16px; }
  .header-links { display: none; }
  .step { padding: 18px; }
}
