/* sign.online, EUDI Wallet signing.
   Concept: a sheet of paper on a desk. The sheet's signature line fills in once the wallet confirms the signer. */
@font-face { font-family: "Poppins"; font-weight: 300; font-display: swap; src: url("/fonts/poppins-300.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500.woff") format("woff"); }
/* SemiBold (600) was not available when this was built: add fonts/poppins-600.woff and it is used automatically; until then Bold stands in. */
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff") format("woff"), url("/fonts/poppins-700.woff") format("woff"); }

/* Tokens from the sign.online design system (global.css). */
:root {
  --ink: #262e36;
  --ink-soft: #5e6770;      /* --muted */
  --slate: #5c6b7b;
  --steel: #7e96aa;
  --amber: #f4a93a;
  --amber-hi: #f6b450;
  --amber-deep: #3a2700;
  --amber-soft: #fef3df;
  --amber-ink: #9a6510;
  --paper: #ffffff;
  --desk: #f5f7f9;          /* --mist */
  --rule: #e7ebef;          /* --line */
  --edge: #cfd6dd;          /* input and dashed borders */
  --footer: #39434d;
  --pen: var(--amber);
  --ok: #2d6b41;
  --ok-bg: #e8f0ea;
  --bad: #a8431f;
  --bad-bg: #fbece6;
  --warn: var(--amber-ink);
  --warn-bg: var(--amber-soft);
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --script: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 24px 50px -30px rgba(45, 57, 70, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--amber-soft); color: var(--ink); }

.top { display: flex; align-items: center; gap: 20px; min-height: 76px; padding: 12px clamp(16px, 4vw, 48px); background: #fff; border-bottom: 1px solid var(--rule); }
[hidden] { display: none !important; }
/* Hide untranslated text for a moment while the language file loads; never longer than 1.5s. */
html.i18n-pending body { visibility: hidden; animation: reveal 0s 1.5s forwards; }
@keyframes reveal { to { visibility: visible; } }
/* Language switcher — port of the sign.online design-system pill + dropdown. */
.lang { position: relative; }
.lang-btn { font-family: inherit; display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 500; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 999px; padding: 9px 14px; cursor: pointer; transition: border-color .15s; }
.lang-btn:hover { border-color: var(--steel); }
.lang-btn .globe { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; opacity: .7; flex: none; }
.lang-btn .globe::after { content: ""; position: absolute; left: -1.5px; right: -1.5px; top: 50%; border-top: 1.5px solid currentColor; transform: translateY(-50%); }
.lang-btn .globe::before { content: ""; position: absolute; top: -1.5px; bottom: -1.5px; left: 50%; width: 7px; transform: translateX(-50%); border: 1.5px solid currentColor; border-top: none; border-bottom: none; border-radius: 50%; }
.lang-btn .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .7; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 18px 44px -22px rgba(45, 57, 70, .45); padding: 7px; min-width: 172px; max-height: 360px; overflow: auto; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 60; }
.lang:hover .lang-menu, .lang:focus-within .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14.5px; color: var(--ink-soft); padding: 9px 12px; border-radius: 9px; transition: background .12s, color .12s; text-decoration: none; cursor: pointer; }
.lang-menu a:hover { background: var(--desk); color: var(--ink); }
.lang-menu a.on { color: var(--ink); font-weight: 600; }
.lang-menu a .code { font-size: 11px; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; opacity: .75; }
.lang-menu a.on .code { color: var(--amber-ink); opacity: 1; }
/* On-dark variant for the splash screen. */
.lang-btn.on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.lang-btn.on-dark:hover { border-color: rgba(255, 255, 255, .55); }
.splash-top { display: flex; justify-content: flex-end; padding: 18px clamp(20px, 5vw, 56px) 0; }
.brand { display: inline-flex; align-items: center; font: 600 22px/1 var(--sans); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand i { font-style: normal; color: var(--amber); }
.brand .logo { display: block; height: 44px; width: auto; }
.sheet-brand { align-self: flex-start; margin-bottom: 26px; }
.sheet-brand .logo { height: 46px; }
.brand.on-dark { color: #fff; font-size: 26px; }
.brand.on-dark i { color: #ffc163; }
.brand.on-dark .logo { height: 52px; }
.top-note { color: var(--ink-soft); font-size: 14px; }
.lock { font-size: 14px; }
.top .lang { margin-left: auto; }
.mode:not([hidden]) + .lang { margin-left: 0; }
.mode { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 5px 12px; border-radius: 999px; border: 1px solid #f6e2bd; }

.desk { flex: 1; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 640px); gap: clamp(24px, 4vw, 56px); justify-content: center; align-items: start; padding: 40px clamp(16px, 4vw, 48px) 56px; }

/* Card panels — tabs row + three stacked tabpanels. Preview keeps the
   paper-sheet aesthetic; the two info panels share the same shell. */
.card-panels { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.card-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tab { font: 500 13px var(--sans); color: var(--ink-soft); background: #fff; border: 1px solid var(--rule); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.card-tab:hover { border-color: var(--steel); color: var(--ink); }
.card-tab[aria-selected="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-deep); font-weight: 600; }
.card-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.card-panels .sheet { position: static; transform: none; }
.card-info { gap: 14px; overflow-y: auto; aspect-ratio: auto; min-height: clamp(360px, 60vh, 540px); padding: 36px clamp(28px, 6%, 48px); }
.card-info h2 { margin: 0; font: 600 20px/1.3 var(--sans); color: var(--ink); }
.card-info-lede { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.shield-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.shield-list li { position: relative; padding: 10px 12px 10px 38px; font-size: 13.5px; line-height: 1.55; color: var(--ink); background: var(--desk); border-radius: 10px; }
.shield-list li::before { content: ""; position: absolute; left: 12px; top: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(244, 169, 58, .18); }
.shield-list li::after { content: "✓"; position: absolute; left: 14px; top: 11px; font-size: 12px; font-weight: 700; color: var(--amber-deep); }
.shield-list li b { color: var(--ink); font-weight: 600; }

/* Flow animation — five steps, amber sweep cycles through them. */
.flow { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; position: relative; padding-left: 4px; }
.flow::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--rule); z-index: 0; }
.flow-step { position: relative; display: flex; align-items: center; gap: 14px; padding: 6px 4px; z-index: 1; }
.flow-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--rule); color: var(--ink-soft); font: 600 12px var(--sans); display: inline-flex; align-items: center; justify-content: center; transition: background .4s, border-color .4s, color .4s, box-shadow .4s; }
.flow-label { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
/* Flow dot state is driven by the real workflow step: completed → solid
   green, current → pulsing green, pending → neutral. */
.flow .flow-step.completed .flow-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.flow .flow-step.current .flow-dot { background: #fff; border-color: var(--ok); color: var(--ok); animation: flowCurrent 1.6s ease-in-out infinite; }
@keyframes flowCurrent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 107, 65, .35); }
  50%      { box-shadow: 0 0 0 7px rgba(45, 107, 65, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .flow .flow-step.current .flow-dot { animation: none; }
}

/* ---------- the sheet ---------- */
.sheet { position: sticky; top: 24px; background: var(--paper); aspect-ratio: 210 / 297; padding: 9% 9% 7%; display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 26px 56px -34px rgba(45, 57, 70, .4); transform: rotate(-0.6deg); }

/* Multi-signer preview: compact density classes so a dozen signatures still
   fit on the virtual A4. The first sigline keeps its "margin-top: auto"
   push-to-bottom; subsequent ones stack closely above it. */
.sheet .sigline + .sigline { margin-top: 14px; }
.sheet[data-signer-count="3"] .sigline, .sheet[data-signer-count="4"] .sigline { font-size: 0.9em; }
.sheet[data-signer-count="3"] .sigline + .sigline, .sheet[data-signer-count="4"] .sigline + .sigline { margin-top: 10px; }
.sheet[data-signer-count="5"] .sigline, .sheet[data-signer-count="6"] .sigline, .sheet[data-signer-count="7"] .sigline { font-size: 0.8em; }
.sheet[data-signer-count="5"] .sigline + .sigline, .sheet[data-signer-count="6"] .sigline + .sigline, .sheet[data-signer-count="7"] .sigline + .sigline { margin-top: 7px; }
.sheet[data-signer-count="8"] .sigline, .sheet[data-signer-count="9"] .sigline, .sheet[data-signer-count="10"] .sigline { font-size: 0.72em; }
.sheet[data-signer-count="8"] .sigline + .sigline, .sheet[data-signer-count="9"] .sigline + .sigline, .sheet[data-signer-count="10"] .sigline + .sigline { margin-top: 5px; }
.sheet-name { font: 600 18px/1.3 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sheet-meta { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.sheet-lines { flex: 1; margin: 9% 0; min-height: 40px; background: repeating-linear-gradient(to bottom, transparent 0 13px, #eef1f4 13px 15px); mask-image: linear-gradient(to right, #000 0 86%, transparent 86%); -webkit-mask-image: linear-gradient(to right, #000 0 86%, transparent 86%); }
.sheet-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--ink-soft); font-size: 14px; border: 2px dashed var(--edge); border-radius: 10px; background: var(--desk); margin-bottom: 9%; padding: 16px; }
.hash { font: 11px/1.5 var(--mono); color: var(--ink-soft); overflow-wrap: anywhere; margin-top: 10px; }
.hash b { display: block; font: 600 12px var(--sans); color: var(--ink); }
.sigline { position: relative; }
.sig-name { font: 32px/1.1 var(--script); color: var(--edge); min-height: 38px; padding: 0 4px; overflow-wrap: anywhere; transition: color .5s; }
.sig-rule { border-top: 2px dashed var(--steel); margin-top: 2px; padding-top: 6px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-soft); }
.sheet[data-state="signed"] .sig-name { color: var(--ink); }
.sheet[data-state="signed"] .sig-rule { border-top-style: solid; border-top-color: var(--ink); }
.sheet[data-state="signed"] .sig-name span { display: inline-block; animation: write .9s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -5% 0 0); } }
.sheet[data-state="refused"] .sig-name { color: var(--edge); text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.seal { position: absolute; right: -4%; bottom: 44px; width: 96px; height: 96px; color: var(--ok); transform: rotate(-11deg); animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-11deg) scale(1.6); } }

/* ---------- the stage ---------- */
.stage { min-width: 0; }
.steps { display: flex; gap: 6px; margin-bottom: 28px; counter-reset: step; }
.steps li { flex: 1; font-size: 13px; color: var(--ink-soft); padding-top: 10px; border-top: 3px solid var(--rule); counter-increment: step; }
.steps li::before { content: counter(step) ". "; }
.steps li[data-on="done"] { border-color: var(--slate); color: var(--ink); }
.steps li[data-on="now"] { border-color: var(--amber); color: var(--ink); font-weight: 600; }

h1 { font: 300 clamp(30px, 4.2vw, 44px)/1.06 var(--sans); letter-spacing: -0.025em; text-wrap: balance; }
h1 b { font-weight: 600; }
.lede { color: var(--ink-soft); margin-top: 10px; max-width: 56ch; }
h2 { font: 600 19px/1.3 var(--sans); letter-spacing: -0.01em; margin: 40px 0 14px; }

.form { margin-top: 28px; display: grid; gap: 20px; }
.drop { display: block; border: 2px dashed var(--steel); border-radius: 18px; background: #f3f7fa; padding: 22px; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: #fff; border-color: var(--slate); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }
.drop strong { display: block; }
.drop span { color: var(--ink-soft); font-size: 14px; }
.drop.has { border: 1.5px solid var(--steel); background: #fff; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-soft); }
.field input { width: 100%; padding: 13px 15px; border: 1.5px solid var(--edge); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 4px rgba(126, 150, 170, .2); }
.field input:hover { border-color: var(--steel); }
.field.dob { max-width: 240px; }
.error { color: var(--bad); background: var(--bad-bg); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.error:empty { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 999px; border: 1.5px solid var(--amber); background: var(--amber); color: var(--amber-deep); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: 0 6px 18px -8px rgba(244, 169, 58, .8); transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { background: var(--amber-hi); border-color: var(--amber-hi); transform: translateY(-1px); }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn.quiet { background: #fff; color: var(--ink); border-color: var(--rule); box-shadow: none; }
.btn.quiet:hover { border-color: var(--steel); color: var(--slate); background: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }

/* wallet step */
.handoff { margin-top: 28px; display: grid; grid-template-columns: 208px 1fr; gap: 28px; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; padding: 24px; }
.qr { width: 208px; height: 208px; }
.qr svg { width: 100%; height: 100%; display: block; }
.handoff p + p { margin-top: 10px; }
.handoff .btn { margin-top: 14px; }
.waiting { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-weight: 600; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--pen); animation: pulse 1.4s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.muted { color: var(--ink-soft); font-size: 14px; }

.sim { margin-top: 24px; border: 1px solid #f6e2bd; background: var(--amber-soft); border-radius: 18px; padding: 20px 22px; }
.sim h3 { font: 600 17px var(--sans); }
.sim > p { font-size: 14px; color: var(--amber-ink); margin-top: 4px; }
.sim fieldset { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.sim label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.sim label small { color: var(--amber-ink); }
.sim .btn { margin-top: 16px; background: var(--slate); border-color: var(--slate); color: #fff; box-shadow: none; }
.sim .btn:hover { background: #697888; border-color: #697888; }

/* result */
.verdict { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.verdict svg { width: 44px; height: 44px; }
.verdict[data-outcome="verified"] svg { color: var(--ok); }
.verdict[data-outcome="mismatch"] svg, .verdict[data-outcome="failed"] svg { color: var(--bad); }
.verdict[data-outcome="declined"] svg, .verdict[data-outcome="expired"] svg { color: var(--warn); }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; padding: 8px 24px; }
table.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; overflow-wrap: anywhere; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.compare tbody th { font-weight: 600; width: 26%; }
.compare td:last-child { width: 92px; text-align: right; padding-right: 0; white-space: nowrap; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.tag.pass { color: var(--ok); background: var(--ok-bg); }
.tag.fail { color: var(--bad); background: var(--bad-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }

.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.checks li:last-child { border-bottom: 0; }
.checks svg { width: 22px; height: 22px; margin-top: 1px; }
.checks strong { font-weight: 600; display: block; }
.checks span { color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.checks .pass svg { color: var(--ok); } .checks .fail svg { color: var(--bad); } .checks .warn svg { color: var(--warn); } .checks .skip svg { color: var(--edge); }
.checks .skip strong { color: var(--ink-soft); font-weight: 400; }
.checks .fail span { color: var(--bad); }

dl.facts { display: grid; grid-template-columns: minmax(120px, 32%) 1fr; }
.facts dt, .facts dd { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-soft); font-size: 14px; padding-right: 12px; }
.facts dd { overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.facts .mono { font: 13px/1.5 var(--mono); }

details.tech { margin-top: 20px; }
details.tech summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.tech pre { background: var(--ink); color: #dfe5ea; border-radius: 14px; padding: 16px; overflow: auto; font: 12.5px/1.55 var(--mono); max-height: 420px; margin: 8px 0 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.next { margin-top: 36px; background: var(--slate); color: #fff; border-radius: 22px; padding: 34px 32px; box-shadow: 0 20px 44px -30px rgba(18, 26, 34, .55); }
.next h2 { margin: 0 0 8px; color: #fff; font-size: 24px; font-weight: 300; letter-spacing: -0.01em; }
.next p { color: rgba(255, 255, 255, .86); max-width: 54ch; }
.next .btn { margin-top: 20px; }
.next .btn.quiet { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.next .btn.quiet:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .3); }
.next .handoff { background: transparent; border: 0; padding: 0; margin-top: 20px; }
.next .handoff .qr { background: #fff; border-radius: 12px; overflow: hidden; }
.next .facts dt { color: rgba(255, 255, 255, .8); } .next .facts dt, .next .facts dd { border-color: rgba(255, 255, 255, .16); }
.next .error { margin-top: 14px; }
.done-mark { display: flex; align-items: center; gap: 12px; }
.done-mark svg { width: 34px; height: 34px; color: var(--amber); flex: none; }
.done-mark svg path { stroke: var(--amber-deep); }
.next .waiting .pulse { background: var(--amber); }

.foot { padding: 20px clamp(16px, 4vw, 48px) 0; color: var(--ink-soft); font-size: 13px; text-align: center; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; margin: 20px calc(-1 * clamp(16px, 4vw, 48px)) 0; padding: 16px clamp(16px, 4vw, 48px); background: var(--footer); color: rgba(255, 255, 255, .74); text-align: left; }
.legal nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.legal a { color: #fff; text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal a:focus-visible { outline-color: #fff; }

@media (max-width: 860px) {
  .desk { grid-template-columns: minmax(0, 640px); }
  .sheet { position: static; aspect-ratio: auto; transform: none; padding: 22px; }
  .sheet-lines { display: none; }
  .sheet-empty { min-height: 0; margin-bottom: 18px; }
  .sigline { margin-top: 18px; }
  .seal { width: 72px; height: 72px; right: 0; }
  .top-note { display: none; }
}
@media (max-width: 560px) {
  .top { gap: 8px 10px; min-height: 60px; flex-wrap: wrap; }
  .brand .logo { height: 30px; }
  .mode { display: none; }
  .lang-btn { padding: 8px 12px; font-size: 13px; }
  .row, .handoff { grid-template-columns: 1fr; }
  .handoff .qr { margin: 0 auto; }
  .steps li { font-size: 0; } .steps li::before { font-size: 13px; content: counter(step); }
  .compare thead { display: none; }
  .compare tbody th { display: block; width: auto; border: 0; padding-bottom: 0; }
  .compare td { display: block; border: 0; padding: 2px 0; }
  .compare td::before { content: attr(data-label) ": "; color: var(--ink-soft); font-size: 13px; }
  .compare td:last-child { width: auto; text-align: left; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
  .compare td:last-child::before { content: none; }
  dl.facts { grid-template-columns: 1fr; } .facts dt { border: 0; padding-bottom: 0; } .facts dd { padding-top: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- password page ---------- */
body.splash { background: var(--slate); color: #fff; }
.splash-main { flex: 1; display: grid; grid-template-columns: minmax(0, 460px) minmax(300px, 400px); gap: clamp(32px, 7vw, 96px); align-items: center; justify-content: center; padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 56px); }
.splash-main.single { grid-template-columns: minmax(0, 520px); }
.splash-intro h1 { margin-top: clamp(28px, 6vh, 52px); font-size: clamp(34px, 5vw, 54px); line-height: 1.04; color: #fff; }
.splash-intro h1 b { color: #ffc163; }
.splash-intro p { margin-top: 20px; color: rgba(255, 255, 255, .88); font-size: 18px; max-width: 40ch; }
.splash-sheet { background: var(--paper); color: var(--ink); padding: 40px 36px 34px; display: flex; flex-direction: column; border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(18, 26, 34, .7); transform: rotate(1deg); animation: settle .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes settle { from { opacity: 0; transform: translateY(26px) rotate(4deg); } }
.splash-sheet .sheet-lines { flex: none; height: 92px; margin: 26px 0 30px; }
.splash-sheet.plain { transform: none; animation: none; padding: 44px 40px; }
.splash-sheet.plain h1 { font-size: clamp(26px, 4vw, 34px); }
.splash-sheet.plain p { margin-top: 14px; color: var(--ink-soft); }
.pw label { display: block; font-size: 14px; font-weight: 600; }
.pw-line { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px dashed var(--steel); }
.pw-line:focus-within { border-bottom: 2px solid var(--amber); }
.pw-line input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 2px 8px; font-size: 22px; letter-spacing: .08em; color: var(--ink); outline: none; }
.pw-line input[type="text"] { letter-spacing: 0; }
.splash-sheet .error { margin-top: 14px; }
.splash-sheet .btn { margin-top: 22px; align-self: flex-start; min-width: 140px; }
.splash-sheet.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: rotate(1deg) translateX(-7px); } 40%, 80% { transform: rotate(1deg) translateX(7px); } }
.splash-sheet.unlocked { transition: transform .35s ease-in, opacity .35s; transform: translateY(-30px) rotate(-2deg); opacity: 0; }
body.splash .foot { padding-top: 0; }
body.splash .legal { margin-top: 0; }
@media (max-width: 820px) {
  .splash-main { grid-template-columns: minmax(0, 460px); align-content: center; }
  .splash-intro h1 { margin-top: 24px; }
  .brand.on-dark .logo { height: 42px; }
  .splash-sheet { transform: none; padding: 28px 24px; }
  .splash-sheet .pw { margin-top: 22px; }
}

/* several signers on one forwarded document */
.group { margin-top: 18px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; color: var(--ink-soft); font-size: 15px; max-width: 60ch; }
.group strong { color: var(--ink); font-weight: 600; }
.next .group { background: rgba(0, 0, 0, .16); border-color: transparent; color: #fff; margin: 14px 0 6px; }
.next .group strong { color: #fff; }

/* several signers: form blocks and the round overview */
.person { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; }
.person + .person { border-top: 1px solid var(--rule); padding-top: 20px; }
.person legend { font-weight: 600; padding: 0; margin-bottom: 4px; display: flex; gap: 14px; align-items: baseline; }
.person legend .linkbtn { font-weight: 400; font-size: 14px; }
.field.starter { max-width: 420px; }
.signers li { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.signers li:last-child { border-bottom: 0; }
.signers .who { display: grid; gap: 2px; min-width: 0; }
.signers .who span { color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.signers .who .why { color: var(--bad); }
.signers .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.signers .qr.small { grid-column: 1 / -1; width: 180px; height: 180px; }
.signers .qr.small svg { width: 100%; height: 100%; display: block; }
a.linkbtn { color: var(--ink-soft); }
.stage > #view > .facts { margin-top: 18px; }

.signmode { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.signmode legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.signmode label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }

/* -------- Accessibility -------- */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 8px; z-index: 1000; text-decoration: none; }
/* The language dropdown now also opens on .is-open (JS-driven) so keyboard
   activation (Enter / Space on the button) works, not only hover. */
.lang.is-open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* -------- Mobile responsive -------- */
@media (max-width: 760px) {
  .desk { grid-template-columns: 1fr; gap: 24px; padding: 24px clamp(14px, 4vw, 24px) 40px; }
  .card-panels { position: static; }
  .card-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
  .card-tabs::-webkit-scrollbar { display: none; }
  .card-tab { flex: 0 0 auto; scroll-snap-align: start; }
}
@media (max-width: 500px) {
  .sheet { aspect-ratio: auto; min-height: 320px; padding: 24px 22px; }
  .card-info { min-height: auto; padding: 24px 22px; }
  .top { flex-wrap: wrap; row-gap: 8px; }
  .top-note { flex: 1 1 100%; order: 10; }
  /* Password field: keep the reveal button in-line without pushing the input off-screen. */
  .pw-line { flex-wrap: nowrap; min-width: 0; }
  .pw-line > input { min-width: 0; flex: 1 1 auto; }
  .pw-line > button { flex: 0 0 auto; }
}

/* Destructive "delete my data now" linkbtn. */
.actions.destructive { margin-top: 18px; }
.linkbtn.danger { color: var(--bad); font-weight: 600; }
.linkbtn.danger:hover { color: var(--bad); text-decoration: underline; }
