:root {
  --paper: #f3f1e9; --ink: #172019; --muted: #697168; --line: #c9cec5;
  --panel: #e8ebe2; --accent: #29d46f; --accent-ink: #092313; --danger: #a33a32;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 82% 4%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 27rem), var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 20; background: var(--ink); color: white; padding: 10px; }
.skip-link:focus { top: 12px; }
.topbar { display: flex; width: min(100% - 40px, 1180px); min-height: 74px; align-items: center; justify-content: space-between; margin: auto; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 780; letter-spacing: .09em; text-decoration: none; }
.wordmark > span { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--ink); border-radius: 9px; background: #FAEDCD; letter-spacing: 0; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.text-button:hover { color: var(--ink); }
main { width: min(100% - 40px, 1180px); margin: auto; }
.hero { min-height: 68dvh; display: grid; align-content: center; padding: 88px 0 110px; }
.eyebrow, .step { color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 18px 0 24px; font-size: clamp(50px, 9vw, 104px); line-height: .96; letter-spacing: -.07em; text-wrap: balance; }
.hero > p:not(.eyebrow) { max-width: 610px; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.7; }
code { font-family: var(--mono); }
.hero-note { display: flex; max-width: 680px; gap: 20px; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 18px; font-size: 13px; }
.hero-note span { color: var(--muted); }
.workspace { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(48px, 9vw, 130px); border-top: 1px solid var(--ink); padding: 72px 0 120px; }
.section-copy { align-self: start; position: sticky; top: 28px; }
.section-copy h2 { max-width: 360px; margin: 14px 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.03; letter-spacing: -.055em; }
.section-copy > p { max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.profile-form { display: grid; gap: 20px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 680; }
label b { color: var(--accent-ink); }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; background: color-mix(in srgb, white 28%, transparent); color: var(--ink); padding: 13px 14px; resize: vertical; }
input { min-height: 50px; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
label small { justify-self: end; color: var(--muted); font-family: var(--mono); font-weight: 500; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.primary-button, .secondary-button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; cursor: pointer; padding: 0 18px; font-weight: 760; text-decoration: none; transition: transform 150ms ease, background-color 150ms ease; }
.primary-button { background: var(--accent); color: var(--accent-ink); }
.primary-button:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.secondary-button { border-color: var(--line); color: var(--ink); background: transparent; }
.primary-button:active, .secondary-button:active { transform: translateY(1px) scale(.99); }
.primary-button:disabled { cursor: wait; opacity: .5; }
.legal { margin: -8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-message { border-left: 3px solid var(--danger); margin: 0; padding-left: 12px; color: var(--danger); font-size: 13px; }
.form-message[data-kind="success"] { border-color: var(--accent); color: var(--ink); }
.model-lock { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 18px; padding: 9px 11px; font-size: 12px; }
.model-lock span { color: var(--muted); }
.manage-stack { display: grid; gap: 18px; }
.qr-card, .secret-card, .edit-panel, .ledger-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: clamp(20px, 4vw, 30px); }
.qr-card { display: grid; grid-template-columns: 190px 1fr; gap: 26px; align-items: center; }
.qr-frame { grid-row: span 2; border-radius: 12px; background: #f3f1e9; padding: 12px; }
.qr-frame img { display: block; width: 100%; aspect-ratio: 1; }
.qr-card p { margin: 0 0 8px; font-size: 24px; font-weight: 760; letter-spacing: -.03em; }
.qr-card span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-self: end; }
.secret-card { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.secret-card h3 { margin: 10px 0 6px; font-size: 22px; }
.secret-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 12px; }
.copy-row button { border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; padding: 0 15px; font-weight: 700; }
.edit-panel summary { cursor: pointer; justify-content: flex-start; font-weight: 750; }
.compact { margin-top: 24px; }
.ledger-panel { display: grid; gap: 24px; overflow: hidden; background: color-mix(in srgb, var(--panel) 80%, white); }
.ledger-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.ledger-heading h3 { margin: 8px 0 5px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.045em; }
.ledger-heading p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.date-control { min-width: 164px; }
.date-control > span { display: inline-flex; align-items: center; }
.date-control input { min-height: 42px; padding: 9px 10px; font-family: var(--mono); font-size: 12px; }
.ledger-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.ledger-metrics > div { display: grid; gap: 5px; border-right: 1px solid var(--line); padding: 18px 16px 20px; }
.ledger-metrics > div:first-child { padding-left: 0; }
.ledger-metrics > div:last-child { border-right: 0; }
.ledger-metrics span, .ledger-metrics small { color: var(--muted); font-size: 11px; }
.ledger-metrics strong { font-family: var(--mono); font-size: clamp(22px, 3vw, 30px); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.ledger-table-wrap { overflow-x: auto; }
.ledger-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ledger-table th { border-bottom: 1px solid var(--ink); padding: 0 12px 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-align: left; }
.ledger-table td { border-bottom: 1px solid var(--line); padding: 14px 12px; vertical-align: middle; }
.ledger-table th:first-child, .ledger-table td:first-child { padding-left: 0; }
.ledger-table th:last-child, .ledger-table td:last-child { padding-right: 0; }
.pass-label { font-family: var(--mono); font-weight: 700; }
.ledger-table td i { display: block; position: relative; width: 100%; height: 3px; overflow: hidden; border-radius: 2px; margin-top: 7px; background: var(--line); }
.ledger-table td i::after { content: ""; display: block; width: var(--usage); height: 100%; background: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-active::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.status-exhausted::before, .status-disabled::before { background: var(--danger); }
.ledger-empty { display: grid; gap: 7px; place-items: center; min-height: 150px; color: var(--muted); text-align: center; }
.ledger-empty strong { color: var(--ink); font-size: 16px; }
.history-panel { border-top: 1px solid var(--line); padding-top: 18px; }
.history-panel summary { cursor: pointer; justify-content: flex-start; font-size: 12px; font-weight: 750; }
.history-list { display: grid; margin-top: 14px; }
.history-list button { display: grid; grid-template-columns: 1.1fr .6fr 1fr .8fr; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; padding: 11px 0; text-align: left; }
.history-list button:hover span { text-decoration: underline; }
.history-list span { font-family: var(--mono); }
.history-list b { font-size: 12px; }
.history-list small { color: var(--muted); }
.retention-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
dialog { width: min(100% - 30px, 500px); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); padding: 0; box-shadow: 0 30px 90px color-mix(in srgb, var(--ink) 28%, transparent); }
dialog::backdrop { background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(3px); }
.dialog-card { position: relative; display: grid; gap: 18px; padding: 32px; }
.dialog-card h2 { margin: -6px 0 0; font-size: 32px; letter-spacing: -.045em; }
.dialog-card > p:not(.eyebrow) { margin: -8px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-close { position: absolute; top: 18px; right: 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
footer { display: flex; width: min(100% - 40px, 1180px); justify-content: space-between; border-top: 1px solid var(--line); margin: auto; padding: 24px 0 40px; color: var(--muted); font-size: 12px; }
footer a { color: inherit; }
@media (max-width: 780px) {
  .hero { min-height: auto; padding: 80px 0 100px; }
  .workspace { grid-template-columns: 1fr; gap: 42px; padding-top: 50px; }
  .section-copy { position: static; }
  .qr-card { grid-template-columns: 132px 1fr; gap: 18px; }
  .button-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .ledger-heading { align-items: stretch; flex-direction: column; }
  .date-control { width: 100%; }
  .ledger-metrics { grid-template-columns: 1fr 1fr; }
  .ledger-metrics > div:nth-child(2) { border-right: 0; }
  .ledger-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ledger-metrics > div:nth-child(3) { padding-left: 0; }
}
@media (max-width: 520px) {
  .topbar, main, footer { width: min(100% - 28px, 1180px); }
  .hero h1 { font-size: 50px; }
  .hero-note, .split { grid-template-columns: 1fr; flex-direction: column; gap: 8px; }
  .qr-card { grid-template-columns: 1fr; }
  .qr-frame { width: min(100%, 230px); grid-row: auto; }
  .button-row { grid-column: auto; grid-template-columns: 1fr; }
  .history-list button { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
