/* Countersealed stylesheet. One file, self-hosted fonts (CSP style-src 'self', fonts under default-src).
   Black, grey, silver and white: states are told apart by fill, outline, dash and hatch, never by hue.
   The one exception is signature ink on paper, which matches the ink in the sealed PDF.
   Floors: body 17px, nothing a person reads under 14px. */
@font-face { font-family: Syne; font-weight: 700; src: url(../fonts/syne-v24-latin-700.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Syne; font-weight: 800; src: url(../fonts/syne-v24-latin-800.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Archivo; font-weight: 400 600; src: url(../fonts/archivo-400-600-normal.woff2) format("woff2"); font-display: swap; }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  color-scheme: dark;
  --black: #000; --coal: #0c0d0e; --iron: #17181a; --iron-2: #26282b; --rule: #3a3d41; --steel: #6c7176;
  --silver: #b7bbbf; --bright: #e4e6e8; --white: #fff; --ink: #0d1a59;
  --metal: linear-gradient(103deg, #c9cccf 0%, #d3d6d8 30%, #fff 46%, #eceeef 54%, #cdd0d3 72%, #d8dadc 100%);
  --hatch: repeating-linear-gradient(135deg, #fff 0 2px, #000 2px 6px);
  --side: clamp(1rem, 4vw, 3.4rem);
  --display: Syne, "Avenir Next", "Avenir", "Segoe UI", system-ui, sans-serif;
  --body: Archivo, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --script: "Snell Roundhand", "Apple Chancery", "Brush Script MT", "Segoe Script", cursive;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 17px; background: var(--black); }
body { margin: 0; overflow-x: clip; background: var(--black); color: var(--white); font-family: var(--body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; }
a { color: var(--white); text-underline-offset: 3px; text-decoration-color: var(--steel); }
a:hover { color: var(--white); text-decoration-color: var(--white); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
/* On paper the ring is black inside white, so it shows on both. */
.page :focus-visible, .sig-pad:focus-visible { outline: 2px solid var(--black); outline-offset: 1px; box-shadow: 0 0 0 5px var(--white); }
::selection { background: var(--white); color: var(--black); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h2 { font-size: 1.3rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }

/* ── The light: one source for the window (light.js), and every edge shows the part that reaches it ── */
.lit { position: relative; }
.edge { position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: radial-gradient(460px circle at var(--lx, -999px) var(--ly, -999px), #fff 0, rgba(255,255,255,.75) 16%, rgba(255,255,255,.2) 52%, transparent 76%), rgba(255,255,255,.17);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* A bright point that runs the perimeter, only on the thing to act on. */
.run::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--spin), transparent 0 64%, rgba(255,255,255,.35) 80%, #fff 94%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 4.6s linear infinite; }
@keyframes spin { to { --spin: 360deg; } }
/* An engraved seal. Difference blending draws it silver on black and black where it crosses paper. */
.sealcv { position: absolute; aspect-ratio: 1; mix-blend-mode: difference; pointer-events: none; }

/* ── Header ─────────────────────────────────────────────────── */
.top { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.15rem var(--side); }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--display); font-weight: 700;
  font-size: 1.3rem; color: var(--white); text-decoration: none; letter-spacing: -0.03em; }
.brand::before { content: ""; width: 1.15rem; height: 1.15rem; border: 2px solid var(--white); border-radius: 50%;
  background: linear-gradient(90deg, #000 50%, #fff 50%); }
.top nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.top nav a, .top .link { color: var(--bright); text-decoration: none; font-weight: 500; }
.top nav a:hover, .top .link:hover { color: var(--white); text-decoration: underline; text-underline-offset: 6px; }
.top nav a.btn, .top nav a.btn:hover { color: var(--black); text-decoration: none; }
.preview-bar { background: var(--iron); color: var(--bright); padding: .45rem 1rem; text-align: center; font-weight: 500; font-size: .9rem; }
main { padding: 1.5rem var(--side) 4rem; margin: 0 auto; }
/* The footer sits at the bottom of short pages instead of mid-screen. */
body:not(.editor) { min-height: 100vh; display: flex; flex-direction: column; }
body:not(.editor) > main { flex: 1 0 auto; width: 100%; }
main.narrow { max-width: 760px; } main.wide { max-width: 1360px; } main.full { max-width: none; padding: 0; }
.foot { padding: 1.5rem var(--side); font-size: .9rem; color: var(--silver); }
.foot a { color: var(--silver); }
.muted { color: var(--silver); }
.hint { display: block; color: var(--silver); font-size: .9rem; font-weight: 400; margin-top: .25rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; word-break: break-all; }
.inline { display: inline; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ── Buttons: brushed metal ─────────────────────────────────── */
.btn, .btn:hover { color: var(--black); background: var(--metal); background-size: 230% 100%; background-position: 8% 0; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 3px;
  padding: .8rem 1.5rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-position .7s cubic-bezier(.2,.7,.1,1); }
.btn:hover { background-position: 96% 0; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.small { padding: .5rem 1rem; font-size: .92rem; }
.btn.ghost, .btn.ghost:hover { background: var(--black); color: var(--white); }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--steel); }
.btn.ghost:hover { background: var(--iron); }
.btn.danger, .btn.danger:hover { background: var(--black); color: var(--white); box-shadow: inset 0 0 0 2px var(--white); }
.btn.danger:hover { background: var(--iron); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--white); text-decoration: underline;
  text-decoration-color: var(--steel); text-underline-offset: 3px; cursor: pointer; }
.link:hover { text-decoration-color: var(--white); }
.link.danger { text-decoration-style: dashed; }
.after-table { margin-top: 1.5rem; }

/* ── Forms ──────────────────────────────────────────────────── */
form.stack { display: flex; flex-direction: column; gap: 1.1rem; max-width: 460px; }
label { display: block; font-weight: 500; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: #fff; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input:not([type]), input[inputmode], textarea, select {
  display: block; width: 100%; margin-top: .35rem; padding: .75rem .85rem; font: inherit; font-weight: 400;
  color: var(--white); background: var(--coal); border: 1px solid var(--steel); border-radius: 3px; }
select { -webkit-appearance: none; appearance: none; padding-right: 2.4rem; background-repeat: no-repeat; background-size: .5rem .5rem, .5rem .5rem;
  background-image: linear-gradient(45deg, transparent 50%, #b7bbbf 50%), linear-gradient(135deg, #b7bbbf 50%, transparent 50%);
  background-position: right 1.25rem center, right .8rem center; }
input[type=search] { -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus, select:focus { border-color: var(--white); outline: none; box-shadow: 0 0 0 1px var(--white); }
input::placeholder, textarea::placeholder { color: var(--silver); opacity: 1; }
input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 99px var(--iron) inset; }
input[type=file] { display: block; margin-top: .4rem; font: inherit; font-weight: 400; padding: 1rem; width: 100%; color: var(--bright);
  border: 1px dashed var(--silver); border-radius: 3px; background: var(--coal); cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--black); background: var(--metal); border: 0;
  border-radius: 3px; padding: .5rem 1rem; margin-right: 1rem; cursor: pointer; }
table.list + form.stack { margin-top: 1.6rem; } form.stack + h2, form.stack + h3 { margin-top: 2rem; }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-weight: 500; padding: 0; margin-bottom: .35rem; }

/* ── Messages ───────────────────────────────────────────────── */
.alert { background: var(--iron); border-left: 3px solid var(--silver); padding: .75rem 1rem; margin: 0 0 1.2rem; }
.alert.error { background: var(--white); color: var(--black); border-left: 10px solid; border-image: var(--hatch) 10; }
.alert.error a { color: var(--black); }
.alert.ok { border-left: 10px solid var(--white); }
.alert ul, ul.alert { margin: 0; padding-left: 1.4rem; }
ul.alert { padding-left: 2rem; }
.warn { color: var(--white); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ── Landing ────────────────────────────────────────────────── */
.landing main { max-width: none; padding: 0; overflow: clip; }
.landing main > .alert { margin: 0 var(--side); }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center;
  gap: clamp(2rem, 4vw, 5rem); min-height: calc(100vh - 78px); padding: clamp(1.5rem, 3vw, 3rem) var(--side) clamp(3rem, 5vw, 5rem); }
.hero h1 { font-weight: 800; font-size: clamp(2.7rem, 5.9vw, 6.4rem); line-height: .97; letter-spacing: -0.045em; margin-bottom: .42em; padding-bottom: .06em;
  background: radial-gradient(52vw circle at var(--lx, 30%) var(--ly, 40%), #fff 0, #fff 24%, #c4c8cb 60%, #a4a9ad 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.alpha { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 1rem; color: var(--silver); margin-bottom: 1.5rem; }
.alpha-mark { font-weight: 600; font-size: 15px; color: var(--white); box-shadow: inset 0 0 0 1px var(--silver); border-radius: 99px; padding: .28rem .9rem; }
/* The honeypot: off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.lead { font-size: 1.22rem; max-width: 35rem; color: var(--bright); }
.hero-actions { display: flex; gap: 1.9rem; flex-wrap: wrap; margin-top: 2.1rem; align-items: center; }
.hero-actions .btn { font-size: 1.1rem; padding: 1rem 1.8rem; }
.sheet-wrap { position: relative; justify-self: end; width: 100%; max-width: 680px; padding: 0 0 7.5rem 24%; isolation: isolate; }
.sheet-wrap .sealcv { left: -11%; bottom: -8%; width: min(78%, 540px); }
.sheet { position: relative; background: linear-gradient(160deg, #fff, #f0f1f2 60%, #dfe1e3); border-radius: 2px;
  padding: clamp(2rem, 4vw, 3.4rem) clamp(1.6rem, 3.2vw, 3rem) clamp(8rem, 17vw, 15rem); }
.sheet .rule { height: .5rem; background: #d2d5d8; margin-bottom: 1.15rem; }
.sheet .rule.short { width: 62%; } .sheet .rule.mid { width: 84%; }
.sheet .sigline { position: relative; margin-top: 1rem; border-bottom: 2px solid var(--black); height: 7.4rem; cursor: crosshair; touch-action: pan-y; }
.sheet .sigline > svg { position: absolute; left: 15%; bottom: -.2rem; width: 84%; height: auto; overflow: visible; pointer-events: none; transition: opacity .25s; }
.sheet .sigline.signed > svg { opacity: 0; }
.sheet .sigline canvas { position: absolute; inset: -2.6rem -2rem -2rem; width: calc(100% + 4rem); height: calc(100% + 4.6rem); }
.sig-stroke { fill: none; stroke: var(--black); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s .5s cubic-bezier(.6,.1,.3,1) forwards; }
.sig-stroke.under { stroke-width: 2.2; animation-delay: 2.4s; animation-duration: .7s; }
.flag-tab { position: absolute; right: 100%; bottom: .7rem; margin-right: -.4rem; z-index: 4; white-space: nowrap; pointer-events: none;
  background: var(--black); color: var(--white); box-shadow: inset 0 0 0 1px var(--white); font-weight: 600; padding: .5rem 1.05rem; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.wall { padding: 0 var(--side); margin: 0 0 clamp(3rem, 6vw, 6rem); }
.namewall { display: block; width: 100%; height: auto; overflow: visible; }
.namewall text { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; fill: #000; paint-order: stroke fill; stroke-linejoin: round; }
.namewall .w1 { stroke: rgba(255,255,255,.42); stroke-width: 2.6; }
.namewall .w2 { stroke: url(#nw-light); stroke-width: 3.2; }
.namewall .w3 { stroke: #fff; stroke-width: 3.4; fill: none; stroke-dasharray: 46 820; animation: nw 9s linear infinite; }
@keyframes nw { to { stroke-dashoffset: -1732; } }

.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 clamp(4rem, 8vw, 8rem); padding: 0 var(--side); }
.steps li { counter-increment: step; position: relative; display: flex; flex-direction: column; min-height: 21rem; margin-left: -1px;
  padding: 1.7rem 1.5rem 2.4rem; background: linear-gradient(180deg, #0e0f10, #000); }
.steps li::before { content: counter(step); margin-bottom: auto; font-family: var(--display); font-weight: 800; font-size: 5.2rem; line-height: .9;
  letter-spacing: -0.05em; color: #08090a; paint-order: stroke fill; -webkit-text-stroke: 2.6px var(--silver); }
.steps strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1.32rem; line-height: 1.15; letter-spacing: -0.02em; margin: 2rem 0 .55rem; }
.steps span { color: var(--bright); line-height: 1.45; }
.steps li:last-child { background: linear-gradient(150deg, #fff, #d6d9db); }
.steps li:last-child::before { color: #f6f7f7; -webkit-text-stroke-color: #000; }
.steps li:last-child strong { color: var(--black); } .steps li:last-child span { color: #1b1c1e; }

.claims { color: var(--black); padding: clamp(3rem, 6vw, 6.5rem) var(--side);
  background: radial-gradient(60vw 130% at var(--lx, 40%) var(--ly, 30%), rgba(255,255,255,.85), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.022) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, #a9adb1, #d5d8da 28%, #b2b6ba 55%, #e3e5e7 80%, #a3a8ac); }
.claims div { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem clamp(2rem, 5vw, 6rem); align-items: start;
  border-top: 2px solid var(--black); padding: 2rem 0 3rem; }
.claims div:last-child { padding-bottom: 0; }
.claims h2 { font-weight: 800; font-size: clamp(1.7rem, 3.2vw, 3.1rem); line-height: 1.04; letter-spacing: -0.035em; margin: 0; }
.claims p { font-size: 1.16rem; max-width: 36rem; margin: 0; }

/* ── Account pages: split screen ────────────────────────────── */
.auth main { max-width: none; padding: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: calc(100vh - 82px); }
.split-art { position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate;
  padding: clamp(2rem, 5vw, 4rem); background: var(--black); }
.split-art .sealcv { left: 50%; top: 44%; width: min(88%, 620px); transform: translate(-50%, -50%); }
.split-art p { position: relative; font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 4.4vw, 4.2rem); line-height: .99;
  letter-spacing: -0.045em; max-width: 12ch; margin: 0; mix-blend-mode: difference; text-wrap: balance; }
.split-form { align-self: center; width: 100%; max-width: 560px; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 6vw, 5rem); }
.split-form h1 { font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 800; }
.split-form form.stack + p { margin-top: 1.4rem; }
.auth .foot { display: none; }

/* ── Document library ───────────────────────────────────────── */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lib-head h1 { font-weight: 800; font-size: clamp(2.2rem, 4.4vw, 3.4rem); letter-spacing: -0.045em; margin: 0; }
.lib-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem 1.2rem; align-items: center; margin: 1.6rem 0 .6rem; }
.tally { display: flex; flex-wrap: wrap; gap: .5rem; }
.tally a { display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .8rem; border-radius: 999px; background: var(--black);
  border: 1px solid var(--steel); color: var(--white); text-decoration: none; font-weight: 500; font-size: .92rem; }
.tally a::before { content: ""; width: .66rem; height: .66rem; border: 1.5px solid #fff; border-radius: 50%; background: #fff; }
.tally a b { font-variant-numeric: tabular-nums; font-weight: 600; }
.tally a:hover { border-color: var(--white); }
.tally a.t-waiting::before { background: linear-gradient(90deg, #000 50%, #fff 50%); }
.tally a.t-finishing::before { background: linear-gradient(0deg, #fff 70%, #000 70%); }
.tally a.t-drafts::before { background: #000; border-style: dashed; }
.tally a.t-stopped::before { background: var(--hatch); border-radius: 0; }
.tally a[aria-current] { background: var(--white); border-color: var(--white); color: var(--black); }
.tally a[aria-current]::before { background: #000; border-color: #000; }
.lib-search input { width: 15rem; margin: 0; padding: .5rem 1.1rem; border-radius: 999px; }
.views { display: inline-flex; border: 1px solid var(--steel); border-radius: 999px; overflow: hidden; }
.views a { padding: .35rem 1rem; color: var(--white); text-decoration: none; font-weight: 500; font-size: .92rem; }
.views a[aria-current] { background: var(--white); color: var(--black); }
.views a:not([aria-current]):hover { background: var(--iron-2); }
.lib-none { margin: 2rem 0; color: var(--silver); }

.shelf { position: relative; margin-top: 2.8rem; }
.shelf h2 { display: inline-flex; align-items: baseline; gap: .6rem; margin: 0; padding: .35rem 0; font-size: 1.5rem; }
.shelf h2 .n { font-family: var(--body); font-size: .95rem; font-weight: 600; letter-spacing: 0; color: var(--silver); }
.rack { list-style: none; margin: 0; padding: 1.1rem 0 2rem 2px; display: flex; flex-wrap: wrap; gap: 2.4rem; border-top: 1px solid var(--iron-2); }
.pkg { flex: none; width: 13rem; display: flex; flex-direction: column; gap: .4rem; }
.pkg-link { display: flex; flex-direction: column; gap: .7rem; color: var(--white); text-decoration: none; }
.pkg-sheet { position: relative; display: block; background: var(--white); box-shadow: 0 0 0 1px var(--rule); isolation: isolate; transition: box-shadow .25s; }
.pkg-link:hover .pkg-sheet, .pkg-link:focus-visible .pkg-sheet { box-shadow: 0 0 0 2px #fff, 0 0 44px rgba(255,255,255,.28); }
.pkg-sheet img { display: block; width: 100%; height: auto; aspect-ratio: 240 / 310; object-fit: cover; object-position: top; filter: grayscale(1);
  background: repeating-linear-gradient(180deg, #fff 0 18px, #e4e6e8 18px 22px); }
.s-draft .pkg-sheet img { opacity: .55; } .s-voided .pkg-sheet img, .s-declined .pkg-sheet img { opacity: .35; }
.pkg-sheet .sealcv { right: -1.7rem; bottom: -1.5rem; width: 8.4rem; }
.pkg-title { font-weight: 600; font-size: 1.08rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pkg-link:hover .pkg-title { text-decoration: underline; text-underline-offset: 4px; }
.pkg-meta { color: var(--silver); font-size: .9rem; }
.pkg.stuck .pkg-sheet { box-shadow: 0 0 0 1px #000, 0 0 0 5px #fff; }
.ring { position: absolute; z-index: 3; right: -.8rem; bottom: -.8rem; width: 4rem; height: 4rem; }
.ring .track { fill: #000; stroke: #4a4e52; stroke-width: 5; }
.ring .fill { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.ring text { font: 600 11.5px var(--body); fill: #fff; }
.pkg-flag { position: absolute; z-index: 3; left: .7rem; bottom: .8rem; background: var(--black); color: var(--white); font-weight: 500;
  font-size: .9rem; padding: .3rem .6rem; border: 1px solid var(--white); }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; }
.chip .ini { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-size: .84rem; font-weight: 600;
  letter-spacing: .02em; border: 2px solid transparent; }
.c-signed .ini { background: var(--white); color: var(--black); }
.c-sent .ini { background: var(--black); border-color: var(--white); color: var(--white); }
.c-waiting .ini { background: var(--black); border: 2px dashed var(--steel); color: var(--silver); }
.c-declined .ini { border: 3px solid transparent; background: linear-gradient(#000, #000) padding-box, var(--hatch) border-box; color: var(--white); }
.c-stopped .ini { background: var(--iron-2); color: var(--silver); }
.chips.named { gap: .35rem .9rem; margin-top: .3rem; }
.chips.named .nm { font-size: .92rem; }

.lib-list { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: .6rem; table-layout: fixed; }
.lib-list .c-doc { width: 30%; } .lib-list .c-st { width: 15%; } .lib-list .c-sg { width: 30%; } .lib-list .c-dt { width: 12.5%; }
.lib-list thead th { white-space: nowrap; text-align: left; font-size: .9rem; font-weight: 500; color: var(--silver); padding: 0 1rem .6rem; border-bottom: 1px solid var(--white); }
.lib-list tbody th, .lib-list td { padding: .85rem 1rem; text-align: left; vertical-align: top; font-weight: 400; border-bottom: 1px solid var(--iron-2); }
.lib-list tbody tr:hover { background: #101112; }
.lib-list tbody td:last-child { white-space: nowrap; }
.lib-list tbody th a { font-weight: 600; font-size: 1.08rem; text-decoration: none; }
.lib-list tbody th a:hover { text-decoration: underline; }
.lib-list .count { font-size: .92rem; color: var(--bright); }
.lib-list td:nth-child(4) { white-space: nowrap; color: var(--bright); font-size: .95rem; }
.lib-list td:last-child { color: var(--bright); font-size: .95rem; }
.status { display: inline-block; padding: .15rem .7rem; border-radius: 999px; font-size: .9rem; font-weight: 500; white-space: nowrap;
  background: var(--black); color: var(--white); box-shadow: inset 0 0 0 1px var(--steel); }
.status.s-sent, .s-sent .status { box-shadow: inset 0 0 0 1px var(--white); }
.status.s-sealing, .s-sealing .status { box-shadow: inset 0 0 0 1px var(--white); background: linear-gradient(90deg, var(--rule), var(--black)); }
.status.s-draft, .s-draft .status { box-shadow: none; outline: 1px dashed var(--silver); outline-offset: -1px; }
.status.s-completed, .s-completed .status { background: var(--white); color: var(--black); box-shadow: none; font-weight: 600; }
.status.s-declined, .status.s-voided, .s-declined .status, .s-voided .status { background: var(--iron-2); color: var(--white); box-shadow: none;
  text-decoration: line-through; text-decoration-color: var(--silver); }
.stuck .status { text-decoration: none; box-shadow: inset 0 0 0 2px var(--white); }
.empty { position: relative; margin-top: 2rem; padding: 2.5rem 2rem 2.5rem 9rem; max-width: 640px; background: var(--coal); border: 1px solid var(--rule); border-radius: 3px; }
.empty::before { content: "Start"; position: absolute; left: 1.4rem; top: 2.4rem; background: var(--black); color: var(--white); font-weight: 600;
  padding: .4rem .9rem; box-shadow: inset 0 0 0 1px var(--white); }
:lang(fr) .empty::before { content: "D\e9 part"; }

/* ── Tables (detail page) and facts ─────────────────────────── */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--iron-2); vertical-align: top; }
table.list th { font-size: .92rem; color: var(--silver); font-weight: 500; border-bottom-color: var(--white); }
.events { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--steel); }
.events li { padding: .45rem 0 .45rem 1.1rem; position: relative; }
.events li::before { content: ""; position: absolute; left: -.36rem; top: .95rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--white); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; margin: 0 0 1.6rem; padding: 1.1rem 0; border-top: 1px solid var(--white); border-bottom: 1px solid var(--iron-2); }
dl.facts dt { color: var(--silver); } dl.facts dd { margin: 0; }
/* A finished document's seal, cut from the SHA-256 of its sealed file. */
.docseal { position: relative; width: 15rem; max-width: 60%; aspect-ratio: 1; margin: 0 0 1.4rem; }
.docseal .sealcv { inset: 0; width: 100%; }
details.void { margin: 1.8rem 0; } details.void summary { cursor: pointer; font-weight: 600; }
.card { background: var(--coal); border-radius: 3px; padding: 1.4rem 1.6rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-top: 0; }
.mail header { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .5rem; }
.mail-body { white-space: pre-wrap; word-break: break-word; }

/* ── Editor ─────────────────────────────────────────────────── */
body.editor .foot { display: none; }
.prep { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - 64px); border-top: 1px solid var(--iron-2); }
.prep-side { background: var(--black); padding: 1.2rem 1.3rem 2rem; overflow-y: auto; max-height: 100vh; position: sticky; top: 0; box-shadow: 1px 0 0 var(--iron-2); }
.prep-side > label, .prep-side fieldset { margin-bottom: 1rem; }
.prep-side h2 { font-size: 1.2rem; }
.signers { list-style: none; padding: 0; margin: 0 0 .7rem; display: flex; flex-direction: column; gap: .7rem; }
.signer { border: 1px solid var(--rule); border-radius: 3px; padding: .6rem .7rem; cursor: pointer; background: var(--coal); }
.signer.active { border-color: var(--white); box-shadow: 0 0 0 1px var(--white); }
.signer .row { display: flex; gap: .5rem; align-items: center; }
.signer .dot { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid #fff; font-size: 14px; font-weight: 600; line-height: 1; }
.signer .dot::before { content: attr(data-s); }
.signer.active .dot { background: #fff; color: #000; }
.signer input, .signer select { margin-top: .3rem; padding: .55rem .7rem; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.to-pages { display: none; margin: 0 0 1rem; }
#place-here { margin-top: .6rem; }
.page:focus-visible { outline: 3px solid var(--white); outline-offset: 5px; }
.palette button { font: inherit; font-size: .95rem; font-weight: 500; padding: .55rem .6rem; border: 1px solid var(--steel); border-radius: 3px; background: var(--black); color: var(--white); cursor: pointer; text-align: left; }
.palette button:hover { border-color: var(--white); }
.palette button.armed { border-color: var(--white); background: var(--white); color: var(--black); }
.field-props { margin-top: .9rem; padding: .9rem; border-left: 3px solid var(--white); background: var(--iron); }
.prep-actions { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.save-state { margin: 0; color: var(--silver); font-size: .92rem; min-height: 1.3em; }
.pages { padding: 2.8rem 1rem 3rem; display: flex; flex-direction: column; align-items: center; gap: 2rem;
  background: radial-gradient(70vw 60vh at 50% 18%, #26282b, #0a0a0b 70%, #000); }
.page { position: relative; width: min(100%, 900px); background: #fff; color: #000; border-radius: 2px; user-select: none;
  box-shadow: 0 0 0 1px #fff, 0 0 120px rgba(255,255,255,.14); }
.page img { display: block; width: 100%; height: auto; pointer-events: none; }
.page.placing { cursor: crosshair; outline: 3px dashed var(--white); outline-offset: 6px; }
.page-no { position: absolute; top: -1.6rem; left: 0; font-size: .9rem; color: var(--silver); }
.fld { position: absolute; display: flex; align-items: center; padding: 0 5px; overflow: visible; border: 2px solid #000; border-radius: 2px;
  background: rgba(255,255,255,.82); color: #000; font-size: 14px; line-height: 1.1; cursor: move; touch-action: none; }
.fld .txt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fld.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000; }
.fld .handle { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 50%; background: #000; border: 2px solid #fff; cursor: nwse-resize; }
/* People are told apart by number, and by the line round their fields. */
.prep .fld::before { content: attr(data-s); position: absolute; left: -12px; top: -12px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: #000; color: #fff; box-shadow: 0 0 0 2px #fff; font-size: 14px; font-weight: 600; line-height: 1; pointer-events: none; }
.prep .fld[data-s="2"] { border-style: dashed; } .prep .fld[data-s="3"] { border-style: dotted; border-width: 3px; }
.prep .fld[data-s="4"] { border-style: double; border-width: 4px; } .prep .fld[data-s="5"] { border-color: #6c7176; }
.prep .fld[data-s="6"] { border-color: #6c7176; border-style: dashed; }

/* ── Signer page: the document is the only white thing on the screen ── */
.signing .fld { cursor: pointer; touch-action: auto; border-width: 1.5px; }
.signing .fld.req:not(.done)::before { content: "Sign"; position: absolute; right: calc(100% + 2px); top: 50%; transform: translateY(-50%);
  background: #000; color: #fff; font-weight: 600; font-size: 14px; line-height: 1; padding: .6rem .8rem; white-space: nowrap; pointer-events: none; }
.signing .fld.k-initials.req:not(.done)::before { content: "Initial"; }
.signing .fld.k-text.req:not(.done)::before { content: "Fill in"; }
.signing .fld.k-checkbox.req:not(.done)::before { content: "Tick"; }
.signing .fld.k-dropdown.req:not(.done)::before { content: "Choose"; }
.signing .fld.k-attachment.req:not(.done)::before { content: "Attach"; }
:lang(fr) .signing .fld.req:not(.done)::before { content: "Signer"; }
:lang(fr) .signing .fld.k-initials.req:not(.done)::before { content: "Parapher"; }
:lang(fr) .signing .fld.k-text.req:not(.done)::before { content: "Remplir"; }
:lang(fr) .signing .fld.k-checkbox.req:not(.done)::before { content: "Cocher"; }
:lang(fr) .signing .fld.k-dropdown.req:not(.done)::before { content: "Choisir"; }
:lang(fr) .signing .fld.k-attachment.req:not(.done)::before { content: "Joindre"; }
.signing .fld.k-attachment { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 4px; }
.signing .fld.req:not(.done)::after { content: ""; position: absolute; inset: -2px; border-radius: 2px; padding: 4px; pointer-events: none;
  background: conic-gradient(from var(--spin), #000 0 58%, #8e9397 72%, #fff 84%, #8e9397 94%, #000);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 3.2s linear infinite; }
.signing .fld.k-checkbox.req:not(.done) { border-width: 3px; } .signing .fld.k-checkbox.req:not(.done)::after { display: none; }
.signing .fld.done { background: rgba(255,255,255,.7); border: 1px solid var(--steel); }
.signing .fld img { max-width: 100%; max-height: 100%; }
.signing .fld input { width: 100%; height: 100%; border: 0; background: transparent; color: #000; margin: 0; padding: 0 2px; font-size: 16px; box-shadow: none; color-scheme: light; }
.signing .fld input::placeholder { color: #55595d; }
.signing .fld.k-checkbox { justify-content: center; padding: 0; }
.signing .fld input[type="checkbox"] { width: 100%; height: 100%; min-width: 0; padding: 0; accent-color: #000; }
.signing .fld select { width: 100%; height: 100%; border: 0; background: transparent; color: #000; margin: 0; padding: 0 2px; font-size: 16px; color-scheme: light; box-shadow: none;
  -webkit-appearance: auto; appearance: auto; }
.signing .fld input:focus, .signing .fld select:focus { outline: 3px solid #000; outline-offset: 2px; box-shadow: none; }
.sig-text { font-family: var(--script); font-size: 20px; color: var(--ink); white-space: nowrap; }
.sign-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem var(--side); background: var(--black); border-bottom: 1px solid var(--iron-2); }
.sign-bar strong { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; margin-right: .4rem; }
.sign-bar-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.consent { width: min(100% - 2rem, 680px); margin: 2.5rem auto; padding: 2.2rem 2.4rem; }
.consent label.check { margin-bottom: 1.4rem; } .consent .btn + .link { margin-left: 1.2rem; }
.modal { border: 0; border-radius: 4px; padding: 2rem 2.1rem; width: min(92vw, 640px); background: var(--coal); color: var(--white);
  box-shadow: 0 0 0 1px var(--steel), 0 0 140px rgba(255,255,255,.16); }
.modal h2 { margin-top: 0; font-size: 1.7rem; }
.modal[open] { animation: rise .18s ease-out; }
.modal .btn { margin-top: 1.1rem; } .modal .btn + .link { margin-left: .9rem; }
.modal::backdrop { background: rgba(0,0,0,.78); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tabs button { font: inherit; font-weight: 500; border: 1px solid var(--steel); background: var(--black); color: var(--white); border-radius: 999px; padding: .35rem 1rem; cursor: pointer; }
.tabs button[aria-selected=true] { border-color: var(--white); background: var(--white); color: var(--black); }
.sig-pad { width: 100%; height: 180px; border-radius: 3px; background-color: #fff; touch-action: none;
  background-image: linear-gradient(to top, transparent 34px, #000 34px, #000 36px, transparent 36px); }
.typed-preview { min-height: 4.4rem; margin: .7rem 0; padding: .7rem 1rem; background: #fff; border-radius: 3px; font-size: 32px; overflow: hidden; }

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li { min-height: 14rem; margin: 0 0 -1px -1px; }
  .steps li:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .sheet-wrap { justify-self: stretch; max-width: none; margin: 1rem 0 0; }
  .claims div { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .split-art { min-height: 300px; }
  .split-art .sealcv { width: 290px; left: 94%; top: 22%; }
  .prep { grid-template-columns: 1fr; }
  .prep-side { position: static; max-height: none; }
  .to-pages { display: block; }
  .palette.pinned { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: var(--black);
    padding: .5rem 1rem; box-shadow: 0 1px 0 var(--rule); grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .palette.pinned button { padding: .45rem .3rem; text-align: center; font-size: .9rem; }
  .lib-bar { grid-template-columns: minmax(0, 1fr) auto; } .lib-search input { width: 100%; }
  .tally { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; margin-right: -1rem; padding: 2px 1rem 4px 0; }
  .tally a { flex: none; }
  .pkg { width: 11rem; }
  .lib-list thead { display: none; }
  .lib-list, .lib-list tbody, .lib-list tr, .lib-list th, .lib-list td { display: block; }
  .lib-list tbody tr { border: 1px solid var(--rule); border-radius: 3px; margin-bottom: .6rem; padding: .3rem 0; }
  .lib-list tbody th, .lib-list td { border: 0; } .lib-list tbody th { padding-bottom: .2rem; } .lib-list tbody td { padding: .2rem 1rem; }
  .lib-list td.sent::before { content: "Sent "; } .lib-list td:last-child::before { content: "Last activity "; }
  :lang(fr) .lib-list td.sent::before { content: "Envoy\e9\20"; } :lang(fr) .lib-list td:last-child::before { content: "Derni\e8 re activit\e9\20"; }
  .empty { padding-left: 1.5rem; padding-top: 4.8rem; } .empty::before { top: 1.3rem; }
  .signing .fld.req:not(.done)::before { display: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li { min-height: 0; } .steps li::before { font-size: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sig-stroke { animation: none; stroke-dashoffset: 0; }
  .run::after, .signing .fld.req:not(.done)::after, .modal[open] { animation: none; }
  .namewall .w3 { display: none; }
  .btn, .pkg-sheet { transition: none; }
}

/* Signer table on a phone: one block per signer, labels beside values. */
@media (max-width: 599px) {
  table.stacked thead { display: none; }
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; width: 100%; }
  table.stacked tr { padding: .8rem 0; border-bottom: 1px solid var(--steel); }
  table.stacked td { padding: .2rem 0; border: 0; }
  table.stacked td[data-label]::before { content: attr(data-label) ": "; color: var(--silver); }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.facts dd { margin-bottom: .6rem; }
}
details.fix { margin-top: .4rem; }
details.fix summary { cursor: pointer; }
.waiting { display: block; color: var(--silver); font-size: .92rem; }
.by { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; color: var(--silver); font-size: .9rem; font-weight: 400; }
.by .ini { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--iron-2); color: var(--white); font-size: .84rem; font-weight: 600; }

/* Plan page: one card per plan when there are several. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.plan h2 { margin-top: 0; }

/* API reference: code samples keep their lines and scroll inside their box. */
pre.code { background: var(--black); border: 1px solid var(--rule); border-radius: 3px; padding: .8rem 1rem;
  overflow-x: auto; white-space: pre; word-break: normal; font-size: .9rem; }

/* Signing on a phone: a box drawn for a full-size page is about half as tall here. Grow it to its text and keep one line.
   sign.js places boxes near the right edge by their right side, so they grow into the page. Dates and names only show
   something, so taps pass through them, and checkboxes stay on top. A checkbox is drawn at its own size, so it hides no
   printed words; a tap ticks it up to 24px across, as far as sign.js (reach) finds clear, less a pixel for rounding.
   Inputs stay at 16px: smaller, and a phone zooms the page when one is tapped. */
@media (max-width: 699px) {
  .signing .pages { overflow-x: clip; }
  .signing .fld { padding: 0 2px; }
  .signing .fld.k-text, .signing .fld.k-dropdown, .signing .fld.k-attachment { min-height: 20px; }
  .signing .fld.k-date, .signing .fld.k-name { min-height: 18px; pointer-events: none; }
  .signing .fld.k-name { display: block; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .signing .fld.k-date, .signing .fld.k-signature:not(.done), .signing .fld.k-initials:not(.done) { white-space: nowrap; min-width: max-content; }
  .signing .fld.k-signature.req:not(.done), .signing .fld.k-initials.req:not(.done) { font-size: 0; padding: 0 4px; }
  .signing .fld.k-signature.req:not(.done)::before, .signing .fld.k-initials.req:not(.done)::before { display: block; position: static; transform: none; padding: 0; background: none; color: #000; }
  .signing .fld.req:not(.done)::after { padding: 3px; }
  .signing .fld.k-checkbox { z-index: 2; }
  .signing .fld.k-checkbox.under { z-index: auto; }
  .signing .fld.k-checkbox.tap, .signing .fld.k-checkbox.tap.req:not(.done) { border: 0; background: none; }
  .signing .fld.k-checkbox.tap input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: max(100% - 1px, min(24px, 100% + var(--gap-w) - 1px)); height: max(100% - 1px, min(24px, 100% + var(--gap-h) - 1px)); background: none; }
  .signing .fld.k-checkbox.tap::after, .signing .fld.k-checkbox.tap.req:not(.done)::after { content: ""; display: block; position: absolute; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 100%; height: 100%; box-sizing: border-box; padding: 0; border: 1px solid #555; border-radius: 2px;
    background: rgba(255,255,255,.8) center / contain no-repeat; -webkit-mask: none; mask: none; animation: none; pointer-events: none; forced-color-adjust: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .signing .fld.k-checkbox.tap.req:not(.done)::after { border: 2px solid #000; }
  .signing .fld.k-checkbox.tap.ticked::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 5 9.5 10.5 2.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
}
