@charset "utf-8";
/* =============================================================================
   Onwyn Sign · Seal · Verify — one stylesheet for the three surfaces.

   THE RULE: Onwyn Sign follows onwyn.io. It is "a service of Onwyn", and it
   wears the parent site's design language — the tokens below are read off the
   site's own stylesheet (conformly: site/assets/site.css), not invented here.
   When the site changes, this file follows; it never leads.

   Contract: CSP is `style-src 'self'`, so every rule lives here; templates
   carry no style attributes. No external request: the fonts below are
   self-hosted under static/fonts with their licences.

   How this file is organised
     01  Fonts (Plus Jakarta Sans — the Onwyn voice; Caveat — the typed mark)
     02  Tokens (colour, status, type, space, radii, shadow, motion, z)
     03  Reset and base elements
     04  Utilities
     05  Layout: shell, header, the three-service strip, sub-nav, footer
     06  Buttons
     07  Cards, alerts, empty states, <details>, the seal mark
     08  Forms: fields, switches, the six code boxes, the drop zone
     09  Tables, lists, description lists, status pills, timelines
     10  Sender pages: steps, editor frame, field overlay, confirm strip
     11  Signer ceremony (mobile-first)
     12  verify.onwyn
     13  seal.onwyn
     14  Motion and reduced motion
     15  Responsive
     16  Print
     17  Home as a dashboard, the company chooser, the public pages
     18  The Onwyn chrome: brand lockup, Beta chip, footer links, tabs, modal

   Design rules kept here on purpose
     · Slate ground, white surfaces, navy ink, ONE interactive blue (the site's
       CTA blue). Status is the only other colour, it always comes with a word,
       and good / warn / bad are never drawn in the brand blue.
     · Every text/background pair in §02 is computed ≥ 4.5:1; control borders
       ≥ 3:1 (WCAG 2.2 1.4.3 / 1.4.11). Hairlines are decorative.
     · The focus ring is the accent, 2px, offset 2px, on every focusable thing;
       on the navy footer it is the light sky blue, as on the site.
     · Light only. onwyn.io has no dark mode, so neither does Sign.
     · Nothing moves unless the user asked; §14 turns the rest off.
   ========================================================================== */


/* =============================================================================
   01  FONTS
   Plus Jakarta Sans, variable (wght 200–800), the same two subset files the
   Onwyn website serves, from our own origin (font-src 'self').
   ========================================================================== */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
                 U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Arabic (ar) only: the brand face has no Arabic glyphs. Noto Sans Arabic,
   SIL OFL 1.1, self-hosted (static/fonts/README.md). The unicode-range means a
   page with no Arabic text never downloads it. */
@font-face {
  font-family: "Onwyn Arabic";
  src: url("../fonts/noto-sans-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}
/* The typed signature. Pillow rasterises the stored mark with the same file. */
@font-face {
  font-family: "Onwyn Script";
  src: url("../fonts/Caveat.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}


/* =============================================================================
   02  TOKENS
   The names are the ones this file has always had (--paper, --ink, --accent …)
   so every page written against them inherits the theme. The values are
   onwyn.io's; the site's own name for each is in the comment.
   ========================================================================== */
:root {
  /* ---- Surfaces ---- */
  --paper: #F8FAFC;          /* site --bg: page ground */
  --paper-alt: #F1F5F9;      /* site --slate-100: inset panels, row hover, the editor stage */
  --sheet: #FFFFFF;          /* site --surface: cards, inputs, PDF pages */
  --ink-surface: #0F172A;    /* site --navy-900: inverted surfaces (skip link, step numbers) */
  --footer-surface: #020617; /* site --navy-950: the footer */

  /* ---- Ink ramp ---- */
  --ink: #0F172A;            /* navy-900: headings, labels  17.1:1 paper · 17.9:1 white */
  --ink-2: #334155;          /* navy-700: body copy          9.9:1 paper · 10.4:1 white */
  --ink-3: #475569;          /* slate-600: metadata, help    7.2:1 paper · 7.6:1 white · 6.9:1 paper-alt */
  --ink-4: #94A3B8;          /* slate-400: DECORATIVE ONLY on light — dots, dividers, never text */
  --ink-inverse: #F8FAFC;    /* text on --ink-surface       17.1:1 */
  --on-dark: #CBD5E1;        /* links and copy on the footer 13.6:1 on navy-950 */
  --on-dark-muted: #94A3B8;  /* fine print on the footer      7.9:1 on navy-950 */
  --on-dark-focus: #7DD3FC;  /* focus ring on navy           12.1:1 on navy-950 */

  /* ---- Rules and control boundaries ---- */
  --rule: #E2E8F0;           /* site --border: hairline between rows, card edge */
  --rule-soft: #ECF1F6;      /* site --line-soft: header and section edges */
  --rule-strong: #CBD5E1;    /* slate-300: dashed edges, quiet button edge */
  --control-border: #7C8BA1; /* input/checkbox edge, 3.5:1 on white (1.4.11) */

  /* ---- The interactive blue: the site's CTA. Links, focus, primary buttons. ---- */
  --accent: #0369A1;         /* site --cta      5.9:1 white · 5.7:1 paper */
  --accent-hover: #075985;   /* site --cta-hover 7.6:1 white */
  --accent-wash: #E0F2FE;    /* site --cta-soft  6.6:1 with --accent-hover text */
  --accent-wash-edge: #BAE6FD;
  --accent-lift: #38BDF8;    /* site --cta-lift: DECORATIVE ONLY — the light end of a gradient edge */
  --accent-soft: rgba(3, 105, 161, .14);
  --on-accent: #FFFFFF;      /* text on --accent  5.9:1 · on --accent-hover 7.6:1 */

  /* ---- Status: a fill and a text, each pair ≥ 6:1. Semantic, never the brand. ---- */
  --st-neutral-fg: #475569; --st-neutral-bg: #F1F5F9;   /* Draft (outlined), Closed (filled) */
  --st-info-fg: #075985;    --st-info-bg: #E0F2FE;      /* Sent */
  --st-warn-fg: #92400E;    --st-warn-bg: #FEF3C7;      /* Viewed, Sealing, Could not verify */
  --st-ok-fg: #166534;      --st-ok-bg: #DCFCE7;        /* Signed, Sealed, Sealed & unchanged */
  --st-bad-fg: #991B1B;     --st-bad-bg: #FEE2E2;       /* Failed, Changed after sealing */
  --ok: var(--st-ok-fg);
  --warn: var(--st-warn-fg);
  --danger: var(--st-bad-fg);
  --danger-hover: #7F1D1D;

  /* ---- Type ---- */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  /* There is no serif any more. The name stays so a rule written against the
     old system still resolves — to the Onwyn face. */
  --font-serif: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --script: "Onwyn Script", "Segoe Script", "Bradley Hand", cursive;
  --fs-xs: .8125rem;   /* 13 — the site's 12 is for marketing eyebrows; product metadata stays 13 */
  --fs-sm: .875rem;    /* 14 */
  --fs-base: 1rem;     /* 16 — body, also on phones */
  --fs-md: 1.125rem;   /* 18 */
  --fs-lg: 1.3125rem;  /* 21 */
  --fs-xl: 1.625rem;   /* 26 */
  --fs-2xl: 2.125rem;  /* 34 */
  --lh-tight: 1.18;
  --lh-snug: 1.35;
  --lh-base: 1.6;
  --fw-regular: 400; --fw-medium: 600; --fw-semibold: 700; --fw-bold: 800;
  --measure: 68ch;

  /* ---- Space (4px scale) ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --gutter: 16px;            /* the side gutter at every width */
  --wrap: 1120px;            /* the site's container */
  --wrap-narrow: 440px;
  --cer-wrap: 720px;

  /* ---- Radii ---- */
  --r-sm: 6px;               /* code, tags, field overlays */
  --r-md: 10px;              /* site --r-md: inputs, buttons */
  --r-lg: 14px;              /* site --r-lg: cards */
  --r-sheet: 18px;           /* the sign sheet's top corners */
  --r-pill: 999px;

  /* ---- Shadow: the site's three, navy-tinted ---- */
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, .05);
  --shadow-md: 0 8px 26px rgba(2, 6, 23, .07);
  --shadow-page: 0 1px 3px rgba(2, 6, 23, .12), 0 10px 28px rgba(2, 6, 23, .07);
  --shadow-sheet: 0 -8px 32px rgba(2, 6, 23, .16);
  --glow-cta: 0 0 0 1px rgba(3, 105, 161, .22), 0 10px 34px rgba(3, 105, 161, .14);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 150ms;
  --dur: 220ms;

  /* ---- Layers ---- */
  --z-header: 10; --z-sticky: 20; --z-sheet: 30; --z-skip: 50;

  color-scheme: light;
}


/* =============================================================================
   03  RESET AND BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink-2);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--ink);
  margin: 0 0 var(--sp-3);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -.025em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); margin-top: var(--sp-5); }
p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
small, .muted { color: var(--ink-3); }
.muted { font-size: var(--fs-sm); }
.lede { font-size: var(--fs-md); line-height: 1.7; color: var(--ink-3); max-width: var(--measure); }
strong { font-weight: var(--fw-semibold); color: var(--ink); }
em { font-style: italic; }
code, .mono, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--paper-alt); padding: .05em .35em; border-radius: var(--r-sm); overflow-wrap: anywhere; color: var(--ink); }
pre { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--paper-alt); border-radius: var(--r-md); overflow: auto; font-size: var(--fs-xs); line-height: 1.5; color: var(--ink); }
pre:focus-visible { outline-offset: 0; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--sp-6) 0; }
img, svg { max-width: 100%; }
blockquote { margin: 0; }
time { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-wash); color: var(--ink); }
::placeholder { color: #64748B; opacity: 1; }  /* slate-500, 4.8:1 on white */


/* =============================================================================
   04  UTILITIES
   ========================================================================== */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
/* `left: 0` is load-bearing, not cosmetic. Without it `left` stays `auto`, so an
   absolutely-positioned `.sr-only` resolves to its *static* position — and in a
   wide table that is far to the right. `.table-wrap` has `overflow-x: auto` but
   no `position`, so it is not this element's containing block and therefore does
   not clip it: the span escapes the scroll container, lands against the initial
   containing block, and extends the *document* scroll width. Pinning it to the
   left edge keeps the clip-rect recipe (still read by screen readers — never
   `display: none` this) without pushing the page sideways. */
.sr-only { position: absolute; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* apps/ops/botguard.py: the honeypot field, off screen and out of the tab order */
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: -100px; inset-inline-start: var(--gutter); z-index: var(--z-skip); padding: var(--sp-2) var(--sp-4); background: var(--ink-surface); color: var(--ink-inverse); border-radius: 0 0 var(--r-md) var(--r-md); text-decoration: none; font-weight: var(--fw-medium); }
.skip:focus { top: 0; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }
.error { color: var(--danger); }
.mono { font-family: var(--font-mono); }
.measure { max-width: var(--measure); }
/* `strong` is navy on the page; inside a coloured block it keeps the block's colour. */
.msg strong, .notice strong, .status strong, .hr-notice strong, .cer-waived strong, .cer-locked strong,
.cer-sealing strong, .seal-sealing strong, .seal-failed-line strong, .site-footer strong, .cer-footer strong,
button strong, .button strong, .error strong, .verdict strong { color: inherit; }


/* =============================================================================
   05  LAYOUT: SHELL, HEADER, THE STRIP, SUB-NAV, FOOTER
   ========================================================================== */
/* The site's bar: white, a soft hairline under it. Not sticky here — a product
   page has a sub-nav and a form under it, and the phone's height is the form's. */
.site-header { background: var(--sheet); border-bottom: 1px solid var(--rule-soft); position: relative; z-index: var(--z-header); box-shadow: var(--shadow-sm); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); min-height: 68px; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }

/* the wordmark: the Onwyn mark, then the product name in the site's brand weight */
.wordmark { display: inline-flex; align-items: center; gap: 0; font-family: var(--font-sans); font-weight: var(--fw-bold); font-size: 1.125rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark:hover { color: var(--ink); }
/* a flex container swallows the space in "Onwyn <span>Sign</span>"; this puts it back */
.wordmark span { color: inherit; margin-inline-start: .26em; }
.wordmark .mark { flex: none; color: var(--accent); }

/* the mark in one colour, where it sits inside text */
.mark { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.25em; color: currentColor; }

/* the three-service strip: Sign · Seal · Verify, current one marked */
.services { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--ink-3); }
.services a { color: var(--ink-2); font-weight: var(--fw-medium); text-decoration: none; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); line-height: var(--lh-snug); min-height: 32px; display: inline-flex; align-items: center; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.services a:hover { color: var(--ink); background: var(--paper-alt); }
.services a[aria-current="page"] { color: var(--accent-hover); font-weight: var(--fw-semibold); background: var(--accent-wash); }
.services span[aria-hidden] { color: var(--ink-4); }

.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-sm); }
.lang { display: inline-flex; align-items: center; gap: var(--sp-1); }
.lang a { text-decoration: none; color: var(--ink-3); font-weight: var(--fw-medium); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-md); min-height: 32px; display: inline-flex; align-items: center; }
.lang a:hover { color: var(--ink); background: var(--paper-alt); }
.lang a[aria-current="true"] { color: var(--ink); font-weight: var(--fw-semibold); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .3em; }
.lang span[aria-hidden] { color: var(--ink-4); }

/* tenant + page nav */
.subnav { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; padding-bottom: var(--sp-2); font-size: var(--fs-sm); }
.subnav .tenant-name { font-weight: var(--fw-semibold); color: var(--ink); margin-inline-end: auto; padding: var(--sp-1) 0; }
.subnav a { text-decoration: none; color: var(--ink-2); font-weight: var(--fw-medium); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-md); min-height: 32px; display: inline-flex; align-items: center; }
.subnav a:hover { background: var(--paper-alt); color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); font-weight: var(--fw-semibold); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.subnav a.dev { color: var(--warn); }

main.wrap { padding-top: var(--sp-8); padding-bottom: var(--sp-16); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-6); }
.page-head h1 { margin: 0; }
.page-head .status { font-size: var(--fs-sm); }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.actions .inline-form { display: inline-flex; }

/* the site's footer: navy-950, light links */
.site-footer { padding: var(--sp-10) 0 var(--sp-8); font-size: var(--fs-sm); color: var(--on-dark-muted); background: var(--footer-surface); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-8); align-items: flex-start; }
.site-footer p { margin: 0; max-width: var(--measure); }
.site-footer a, .cer-footer a { color: var(--on-dark); }
.site-footer a:hover, .cer-footer a:hover { color: #FFFFFF; }
.site-footer :focus-visible, .cer-footer :focus-visible { outline-color: var(--on-dark-focus); }
.seal-mark { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-sans); font-weight: var(--fw-semibold); color: var(--ink); white-space: nowrap; }
.seal-mark .mark { width: 1.35em; height: 1.35em; color: var(--accent); }
.site-footer .seal-mark, .cer-footer .cer-seal-mark { color: #FFFFFF; }
.site-footer .seal-mark .mark, .cer-footer .cer-seal-mark .mark { color: var(--accent-lift); }


/* =============================================================================
   06  BUTTONS — primary (the CTA blue), default (white), quiet (bare), danger, link
   ========================================================================== */
button, .button {
  font: inherit;
  font-size: .9375rem;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
button:hover, .button:hover { background: var(--paper-alt); color: var(--ink); border-color: var(--ink-4); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); box-shadow: var(--glow-cta); }
button.primary:focus-visible, .button.primary:focus-visible { outline-offset: 3px; }
button.quiet, .button.quiet, button.secondary { background: transparent; border-color: transparent; color: var(--ink-2); }
button.quiet:hover, .button.quiet:hover, button.secondary:hover { background: var(--paper-alt); color: var(--ink); border-color: transparent; }
button.outline, .button.outline { background: var(--sheet); border-color: var(--accent); color: var(--accent); }
button.outline:hover, .button.outline:hover { background: var(--accent-wash); border-color: var(--accent-hover); color: var(--accent-hover); }
button.danger, .button.danger { color: var(--danger); border-color: var(--danger); background: var(--sheet); }
button.danger:hover, .button.danger:hover { background: var(--st-bad-bg); color: var(--danger-hover); border-color: var(--danger-hover); box-shadow: none; }
button.primary.danger, .button.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.primary.danger:hover, .button.primary.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; box-shadow: none; }
button.small, .button.small { min-height: 32px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); border-radius: 8px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font-size: inherit; font-weight: var(--fw-medium); text-decoration: underline; text-underline-offset: .18em; border-radius: var(--r-sm); box-shadow: none; }
button.link:hover { color: var(--accent-hover); background: none; }
button[disabled], .button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
button.link[disabled] { color: var(--ink-3); text-decoration: none; }
.row-button { width: 100%; justify-content: space-between; text-align: start; margin: 0 0 var(--sp-2); }
.row-button small { color: var(--ink-3); }
@media (max-width: 620px) {
  /* the site's rule: a long label wraps instead of pushing the page sideways */
  button, .button { white-space: normal; max-width: 100%; }
}


/* =============================================================================
   07  CARDS, ALERTS, EMPTY STATES, DETAILS, THE SEAL MARK
   ========================================================================== */
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-6); margin-bottom: var(--sp-5); box-shadow: var(--shadow-sm); }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: var(--wrap-narrow); margin: var(--sp-10) auto; padding: var(--sp-8); box-shadow: var(--shadow-md); }
.card.narrow h1 { font-size: var(--fs-lg); }
.card.narrow-wide { max-width: 640px; }
/* The error pages (apps/tenants/errors.py). Nothing decorative: a sentence,
   the way out, and the status number small enough to be quotable but not shouted. */
.error-card .actions { margin-top: var(--sp-5); }
.error-card .error-status { margin-top: var(--sp-5); letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.seal-reference { letter-spacing: .04em; }
/* /abuse/ (apps/tenants/abuse.py): a form a stranger fills in once, in a hurry. */
.abuse-page .radio-set { border: 0; padding: 0; margin: 0 0 var(--sp-4); }
.abuse-page .radio-set legend { font-weight: var(--fw-medium); padding: 0; margin-bottom: var(--sp-2); }
/* Django renders a RadioSelect as one wrapper <div> of <div><label>…; the
   wrapper stacks, each option is a row, and the label carries the gap so a
   long option wraps under itself instead of beside the next one. */
.abuse-page .radio-set > div { display: flex; flex-direction: column; gap: var(--sp-1); }
.abuse-page .radio-set label { display: flex; align-items: center; gap: var(--sp-3); margin: 0; font-weight: var(--fw-regular); }
.abuse-page .abuse-form label { display: block; margin-top: var(--sp-4); }
.abuse-page .abuse-form label .muted { display: block; font-weight: var(--fw-regular); }
.abuse-page .abuse-form button { margin-top: var(--sp-5); }

.messages { list-style: none; padding: 0; margin: 0 0 var(--sp-5); }
.msg { display: block; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin: 0 0 var(--sp-2); background: var(--accent-wash); color: var(--accent-hover); border: 1px solid var(--accent-wash-edge); border-inline-start: 3px solid var(--accent); overflow-wrap: anywhere; font-weight: var(--fw-medium); }
.msg-error, .msg-warning { background: var(--st-bad-bg); color: var(--st-bad-fg); border-color: #FECACA; border-inline-start-color: var(--danger); }
.msg-success { background: var(--st-ok-bg); color: var(--st-ok-fg); border-color: #BBF7D0; border-inline-start-color: var(--ok); }
.msg-info { background: var(--accent-wash); color: var(--accent-hover); }
.notice { padding: var(--sp-3) var(--sp-4); border-inline-start: 3px solid var(--warn); background: var(--st-warn-bg); color: var(--st-warn-fg); border-radius: 0; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); }

.empty, .empty-state { background: var(--sheet); border: 1px dashed var(--rule-strong); border-radius: var(--r-lg); padding: var(--sp-10) var(--sp-5); text-align: center; color: var(--ink-2); }
.empty p { max-width: 44ch; margin: 0 auto var(--sp-5); }
.empty p:last-child { margin-bottom: 0; }
.empty .actions { justify-content: center; }
.empty .mark { width: 40px; height: 40px; color: var(--ink-4); margin-bottom: var(--sp-3); }
.empty h2 { color: var(--ink); }
.empty .mark { color: var(--accent); opacity: .55; }

details { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--sheet); }
details summary { cursor: pointer; padding: var(--sp-3) var(--sp-4); font-weight: var(--fw-semibold); color: var(--ink); list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; border-radius: var(--r-lg); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: .5em; height: .5em; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); flex: none; margin-inline-start: 2px; }
details[open] summary::before { transform: rotate(45deg); }
details[open] summary { border-bottom: 1px solid var(--rule); border-radius: var(--r-lg) var(--r-lg) 0 0; }
details > :not(summary) { margin-inline-start: var(--sp-4); margin-inline-end: var(--sp-4); }
details > :last-child:not(summary) { margin-bottom: var(--sp-4); }
details > :nth-child(2) { margin-top: var(--sp-4); }
details.card { padding: 0; }
details.card summary { padding: var(--sp-4) var(--sp-5); }
details.card > :not(summary) { margin-inline-start: var(--sp-5); margin-inline-end: var(--sp-5); }

.placeholder { border-inline-start: 3px solid var(--accent); padding: var(--sp-2) var(--sp-3); background: var(--paper-alt); color: var(--ink-3); }


/* =============================================================================
   08  FORMS
   ========================================================================== */
label { display: block; font-size: .9375rem; font-weight: var(--fw-semibold); margin: var(--sp-4) 0 6px; color: var(--ink); line-height: var(--lh-snug); }
label small, label .muted { font-weight: var(--fw-regular); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  line-height: var(--lh-snug);
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea { min-height: 88px; resize: vertical; line-height: var(--lh-base); }
select { appearance: none; -webkit-appearance: none; padding-inline-end: var(--sp-8); background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23334155' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--sp-3) center; }
input:hover:not([disabled]), select:hover:not([disabled]), textarea:hover:not([disabled]) { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
input[disabled], select[disabled], textarea[disabled] { background: var(--paper-alt); color: var(--ink-3); cursor: not-allowed; }
input[readonly] { background: var(--paper-alt); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; box-shadow: none; }
input[type="file"] { font: inherit; font-size: var(--fs-sm); color: var(--ink-2); max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); min-height: 36px; padding: var(--sp-1) var(--sp-3); margin-inline-end: var(--sp-3); border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--sheet); color: var(--ink); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--paper-alt); }
input[aria-invalid="true"], .field-row.has-error input, .field-row.has-error textarea { border-color: var(--danger); }
.errorlist { list-style: none; padding: 0; margin: var(--sp-1) 0 0; color: var(--danger); font-size: var(--fs-sm); }
.field-row .error, .field-row .errorlist { color: var(--danger); font-size: var(--fs-sm); margin: var(--sp-1) 0 0; }
.field-row > .muted { margin: var(--sp-1) 0 0; }
.field-row label { margin-top: 0; }
.field-row { padding: var(--sp-4) 0; border-top: 1px solid var(--rule); }
.field-row:first-of-type, .card > .field-row:first-child, h2 + .field-row, p + .field-row { border-top: 0; }
.card > .field-row:last-of-type { padding-bottom: 0; }
.field-row + .field-row { padding-top: var(--sp-4); }
.form-actions { margin-top: var(--sp-5); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-5); }
.grid-2 > .field-row { border-top: 0; }

/* inline and row forms (settings) */
.inline-form { display: inline-flex; gap: var(--sp-2); align-items: center; }
.inline-form select { width: auto; min-height: 36px; padding-block: var(--sp-1); padding-inline: var(--sp-2) var(--sp-8); font-size: var(--fs-sm); }
.inline-form button { margin: 0; }
.row-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--rule); }
.row-form label { flex-basis: 100%; margin: 0; }
.row-form input { flex: 1 1 220px; }
.row-form select { width: auto; flex: 0 1 140px; }
.row-form button { margin: 0; }

/* switches: a checkbox, a label, a consequence */
.switch-row { padding: var(--sp-3) 0; border-top: 1px solid var(--rule); }
.switch-row:first-of-type, h2 + .switch-row { border-top: 0; }
.switch-row label { display: flex; gap: var(--sp-3); align-items: flex-start; margin: 0; cursor: pointer; }
.switch-row input { margin-top: 2px; }
.switch-row .muted { margin: var(--sp-1) 0 0 calc(20px + var(--sp-3)); }

/* the six code boxes */
.cer-code-boxes { display: flex; gap: var(--sp-2); justify-content: center; margin: var(--sp-4) 0 var(--sp-2); }
.cer-code-box { width: 100%; max-width: 52px; height: 60px; text-align: center; font-size: var(--fs-xl); font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding: 0; min-height: 0; border: 1px solid var(--control-border); border-radius: var(--r-md); background: var(--sheet); color: var(--ink); caret-color: var(--accent); }
.cer-code-box:focus { border-color: var(--accent); outline-offset: 0; box-shadow: 0 0 0 4px var(--accent-wash); }
.cer-code-fallback { margin-top: var(--sp-3); letter-spacing: .35em; font-family: var(--font-mono); font-size: var(--fs-lg); text-align: center; }

/* the drop zone (editor, seal, verify) */
.dropzone { position: relative; border: 2px dashed var(--rule-strong); border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-5); text-align: center; background: var(--paper); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-wash); }
.dropzone-label { display: block; margin: 0 0 var(--sp-3); cursor: pointer; font-weight: var(--fw-regular); color: var(--ink-2); }
.dropzone-label strong { display: block; font-family: var(--font-sans); font-size: var(--fs-md); color: var(--ink); margin-bottom: var(--sp-1); }
.dropzone .mark, .dropzone .icon { width: 36px; height: 36px; color: var(--accent); margin: 0 auto var(--sp-3); display: block; }
.dropzone input[type="file"] { display: block; margin: 0 auto; max-width: 100%; }
.dropzone .error { margin-top: var(--sp-3); }


/* =============================================================================
   09  TABLES, LISTS, DESCRIPTIONS, STATUS PILLS, TIMELINES
   ========================================================================== */
.table-wrap { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow-x: auto; margin: 0 0 var(--sp-5); }
.table { width: 100%; border-collapse: collapse; margin: 0; font-size: var(--fs-sm); }
.table-wrap .table { margin: 0; }
.table th, .table td { text-align: start; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table th { color: var(--ink-3); font-weight: var(--fw-semibold); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; background: var(--paper); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--paper); }
.table td a:not(.button) { color: var(--ink); font-weight: var(--fw-medium); text-decoration: none; }
.table td a:not(.button):hover { color: var(--accent); text-decoration: underline; }
.table td.row-actions, .table td.actions { text-align: end; }
.row-actions > * { display: inline-flex; vertical-align: middle; margin-block: 2px; margin-inline: var(--sp-2) 0; }
.row-actions > :first-child { margin-inline-start: 0; }
.row-actions .button, .row-actions form, .row-actions form button { margin-top: 0; margin-bottom: 0; }
.row-actions form { margin-block: 2px; margin-inline: var(--sp-2) 0; }
.row-actions form:first-child { margin-inline-start: 0; }
.card .table-wrap { box-shadow: none; }
.card .table-wrap .table th { background: var(--paper); }

.list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.list li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li small { color: var(--ink-3); }
.list li .inline-form { margin-inline-start: auto; }
ul.list.prose, ol.list.prose { list-style: disc; padding-inline-start: 1.25em; }
ul.list.prose li, ol.list.prose li { display: list-item; border: 0; padding: var(--sp-1) 0; }
ol.list.prose { list-style: decimal; }
.list.prose pre { margin: var(--sp-2) 0 var(--sp-2); width: 100%; }

.headers { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: var(--sp-2) var(--sp-5); margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.headers dt { color: var(--ink-3); }
.headers dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }

/* status pills: always a word, colour second */
.status { display: inline-flex; align-items: center; gap: 6px; padding-block: 3px; padding-inline: 10px 11px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.5; background: var(--st-neutral-bg); color: var(--st-neutral-fg); white-space: nowrap; border: 1px solid transparent; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; opacity: .85; }
.status small { font-weight: var(--fw-regular); color: inherit; opacity: .85; }
.status-draft { background: var(--sheet); color: var(--st-neutral-fg); border-color: var(--control-border); border-style: dashed; }
.status-sent { background: var(--st-info-bg); color: var(--st-info-fg); }
.status-viewed, .status-queued { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.status-signed, .status-sealed { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.status-closed { background: var(--st-neutral-bg); color: var(--st-neutral-fg); }
.status-failed { background: var(--st-bad-bg); color: var(--st-bad-fg); }
/* A seal job still queued long after the retry window closed (audit F11). */
.status-stalled { background: var(--st-bad-bg); color: var(--st-bad-fg); }
.status-queued::before { animation: pulse 1.6s ease-in-out infinite; }

/* timelines: a rail, a dot per event */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 12rem 1fr; gap: var(--sp-1) var(--sp-4); padding-block: var(--sp-2); padding-inline: var(--sp-6) 0; font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.timeline li:first-child::before { top: 1.1em; }
.timeline li:last-child::before { bottom: calc(100% - 1.1em); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 1px; top: .95em; width: 10px; height: 10px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink-3); }
.timeline li:last-child::after { border-color: var(--accent); background: var(--accent); }
.timeline time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timeline li > span { color: var(--ink); }
.timeline small { grid-column: 2; }
.timeline li.muted::after { border-color: var(--ink-4); }


/* =============================================================================
   10  SENDER PAGES: STEPS, EDITOR FRAME, FIELD OVERLAY, CONFIRM STRIP
   ========================================================================== */
.request-form > .card.step, .request-form > .confirm-strip { max-width: 820px; }
.step h2 { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule); margin-bottom: var(--sp-4); }
.step-no { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink-surface); color: var(--ink-inverse); font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex: none; letter-spacing: 0; }
.step .field-row:first-of-type { border-top: 0; padding-top: 0; }
.request-form .form-actions { max-width: 820px; }

.editor-stage { margin-top: var(--sp-3); }
.editor-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.editor-tools button { margin: 0; }
.editor-tools .muted { flex-basis: 100%; }
/* `safe center`: a page wider than the frame starts at the left edge and scrolls, never clips */
.pdf-pages { display: flex; flex-direction: column; gap: var(--sp-4); align-items: safe center; background: var(--paper-alt); padding: var(--sp-4); border-radius: var(--r-lg); overflow: auto; max-height: 75vh; border: 1px solid var(--rule); }
.pdf-page { position: relative; box-shadow: var(--shadow-page); background: var(--sheet); flex: none; }
.pdf-page canvas { display: block; }
/* flow v2 §5: the Onwyn seal as its own box — drag to move, corner handle to resize */
.seal-field { position: absolute; display: flex; align-items: center; justify-content: center; border: 2px solid #0F172A; background: rgba(255, 255, 255, .82); color: #0F172A; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: var(--fw-semibold); cursor: grab; touch-action: none; user-select: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }
.seal-field.is-default { border-style: dashed; }
.seal-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.seal-field-label { pointer-events: none; text-align: center; padding: 0 4px; }
.seal-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 3px; background: #0F172A; border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.seal-place { margin-top: var(--sp-4); }
.seal-place .editor-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.pdf-page-label { position: absolute; right: var(--sp-2); bottom: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-3); background: rgba(255, 255, 255, .9); padding: 0 var(--sp-2); border-radius: var(--r-sm); pointer-events: none; font-variant-numeric: tabular-nums; }

/* the field overlay: the one place the accent is a fill */
.sig-field, .date-field { position: absolute; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); border-radius: var(--r-sm); user-select: none; letter-spacing: .01em; }
.sig-field { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-hover); cursor: grab; touch-action: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); transition: box-shadow var(--dur-fast) var(--ease); }
.sig-field:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .6), 0 4px 12px rgba(3, 105, 161, .25); }
.sig-field.is-dragging { cursor: grabbing; opacity: .9; box-shadow: 0 6px 18px rgba(3, 105, 161, .35); }
.sig-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* several signers (multi-signer brief §1): one colour per signer slot; the
   field being placed is the solid one, the others are dashed and a click away */
.sig-field.slot-1, .signer-row.slot-1 .slot-chip { --slot: #0369A1; }
.sig-field.slot-2, .signer-row.slot-2 .slot-chip { --slot: #7C3AED; }
.sig-field.slot-3, .signer-row.slot-3 .slot-chip { --slot: #B45309; }
.sig-field.slot-4, .signer-row.slot-4 .slot-chip { --slot: #047857; }
.sig-field.slot-5, .signer-row.slot-5 .slot-chip { --slot: #BE185D; }
.sig-field.slot-6, .signer-row.slot-6 .slot-chip { --slot: #334155; }
.sig-field[class*="slot-"] { border-color: var(--slot); color: var(--slot); background: rgba(255, 255, 255, .72); }
.sig-field[class*="slot-"]:not(.is-active) { border-style: dashed; cursor: pointer; opacity: .85; }
.date-field[class*="slot-"] { border-color: var(--slot); }
.signer-row { padding: var(--sp-3) 0; border-top: 1px solid var(--rule-soft); }
.signer-row-first { border-top: 0; padding-top: 0; }
.signer-row-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.signer-row-head-first { display: none; }
.signer-row-first.is-several .signer-row-head-first { display: flex; }
.signer-row-tools { margin-inline-start: auto; display: flex; gap: var(--sp-1); }
.slot-chip { --slot: var(--accent); border: 1px solid var(--slot); color: var(--slot); background: transparent; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); cursor: pointer; }
.signing-order { border: 0; padding: 0; margin: var(--sp-3) 0; }
.signing-order legend { font-weight: var(--fw-semibold); margin-bottom: var(--sp-1); }
.signing-order label { display: block; margin: 2px 0; }
/* flow v2 §2: the signers as numbered steps */
.flow { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-3) 0; }
.flow-step { border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); background: var(--sheet); }
.flow-step-head { display: flex; align-items: center; gap: var(--sp-2); }
.flow-step-head h3 { margin: 0; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.flow-step-tools { margin-inline-start: auto; display: flex; gap: var(--sp-1); }
.flow-step-rows:empty::before { content: "—"; color: var(--ink-4); display: block; padding: var(--sp-2) 0; }
.flow-step-add { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding-top: var(--sp-2); border-top: 1px solid var(--rule-soft); }
.flow-step .signer-row:first-child { border-top: 0; }
.member-badge { font-size: var(--fs-xs); color: var(--accent-hover); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.signer-row.is-member input[readonly] { background: var(--paper-alt); }
.notify-mode { border: 0; padding: 0; margin: var(--sp-4) 0; }
.notify-mode legend { font-weight: var(--fw-semibold); margin-bottom: var(--sp-1); }
.notify-mode label { display: block; margin: 4px 0; }
.signer-list { margin: var(--sp-1) 0 0; padding-inline-start: 1.4em; }
.signer-list li { margin: 2px 0; }
.signer-status-waiting, .signer-status-invited { background: var(--st-neutral-bg); color: var(--st-neutral-fg); }
.signer-status-viewed { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.signer-status-signed { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.signer-status-declined { background: var(--st-neutral-bg); color: var(--st-neutral-fg); }
.signer-progress { white-space: nowrap; }
.date-field { border: 1px dashed var(--warn); background: rgba(146, 64, 14, .08); color: var(--warn); pointer-events: none; font-size: .7rem; }

/* the site's "featured" card: a gradient edge painted into border-box, and the CTA glow */
.confirm-strip { border: 1px solid transparent; background: linear-gradient(var(--sheet), var(--sheet)) padding-box, linear-gradient(140deg, var(--accent), var(--accent-lift) 48%, var(--accent)) border-box; box-shadow: var(--glow-cta); }
.confirm-strip h2 { margin-bottom: var(--sp-3); }
.confirm-strip .headers { margin-bottom: var(--sp-3); }
.confirm-strip .switch-row { border-top: 1px solid var(--rule); }
.confirm-strip .actions { margin-top: var(--sp-4); }
.hr-notice { border-inline-start: 3px solid var(--warn); padding: var(--sp-1) var(--sp-3); background: var(--st-warn-bg); color: var(--st-warn-fg); border-radius: 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); }

/* new home: the empty state as the spec draws it */
.home-empty { max-width: 560px; margin: var(--sp-8) auto; padding: var(--sp-10) var(--sp-6); }
.home-empty .actions { flex-direction: column; align-items: stretch; max-width: 280px; margin: 0 auto; }
.mail-text { white-space: pre-wrap; background: var(--paper-alt); padding: var(--sp-4); border-radius: var(--r-md); font-size: var(--fs-sm); overflow-wrap: anywhere; }


/* =============================================================================
   11  SIGNER CEREMONY — mobile-first, one column
   ========================================================================== */
body.ceremony { background: var(--paper); }
.cer-wrap { width: 100%; max-width: var(--cer-wrap); margin: 0 auto; padding: 0 var(--gutter); }
.cer-header { background: var(--sheet); border-bottom: 1px solid var(--rule-soft); box-shadow: var(--shadow-sm); }
.cer-header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--sp-3); padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.cer-main { padding: var(--sp-4) var(--gutter) var(--sp-10); }

.cer-head { padding: var(--sp-3) 0 var(--sp-5); }
.cer-signers { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); }
.cer-signers p { margin: 0 0 var(--sp-1); }
.cer-signers ol { margin: 0; padding-inline-start: 1.4em; }
.cer-signed-tag { color: var(--st-ok-fg); font-weight: 600; }
/* the site's eyebrow */
.cer-asks { margin: 0; color: var(--accent); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; font-weight: var(--fw-semibold); }
.cer-title { font-size: var(--fs-xl); margin: var(--sp-1) 0 var(--sp-2); overflow-wrap: anywhere; }
.cer-sender { margin: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.cer-message { margin: var(--sp-4) 0 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--rule); border-inline-start: 3px solid var(--accent); background: var(--sheet); color: var(--ink); border-radius: 0; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); white-space: pre-wrap; font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.6; }

.cer-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4); margin: 0 0 var(--sp-4); box-shadow: var(--shadow-sm); }
.cer-card > :last-child { margin-bottom: 0; }
.cer-card h2 { font-size: var(--fs-lg); }
.cer-plain { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-5); margin: var(--sp-8) 0; text-align: center; box-shadow: var(--shadow-sm); }
.cer-plain h1 { font-size: var(--fs-lg); }
.cer-plain .icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: var(--sp-3); display: block; margin-inline-start: auto; margin-inline-end: auto; }
.cer-wide { display: flex; width: 100%; }
.cer-waived { padding: var(--sp-3) var(--sp-4); background: var(--st-warn-bg); color: var(--st-warn-fg); border-inline-start: 3px solid var(--warn); border-radius: 0; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.cer-download-first { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; }
.cer-download-first a { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 32px; font-weight: var(--fw-medium); }
.cer-footer { padding: var(--sp-8) 0 var(--sp-10); text-align: center; font-size: var(--fs-sm); color: var(--on-dark-muted); background: var(--footer-surface); }
.cer-footer .muted { color: var(--on-dark-muted); }
.cer-footer p { margin: 0 0 var(--sp-2); }
.cer-seal-mark { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); font-family: var(--font-sans); font-weight: var(--fw-semibold); color: var(--ink); font-size: var(--fs-base); }
.cer-mark { display: inline-block; width: 1.35em; height: 1.35em; }

/* code */
.cer-code-form { margin-top: var(--sp-2); }
.cer-code-form .cer-wide { margin-top: var(--sp-4); }
.cer-resend { margin-top: var(--sp-4); text-align: center; font-size: var(--fs-sm); }
.cer-locked { padding: var(--sp-3) var(--sp-4); background: var(--st-warn-bg); color: var(--st-warn-fg); border-radius: var(--r-md); }

/* document */
/* no padding: ceremony.js sizes the page to the frame's clientWidth */
.cer-pdf { background: var(--paper-alt); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 0; margin: 0 0 var(--sp-4); overflow: hidden; }
.cer-pdf-loading { text-align: center; padding: var(--sp-10) 0; margin: 0; display: flex; align-items: center; justify-content: center; gap: var(--sp-3); }
.cer-pdf-loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--rule-strong); border-top-color: var(--ink-2); animation: spin 1s linear infinite; flex: none; }
.cer-pages { display: flex; flex-direction: column; gap: var(--sp-3); align-items: safe center; }
.cer-pages:not(:empty) { padding: 0 0 var(--sp-3); }
.cer-page { box-shadow: 0 1px 3px rgba(2, 6, 23, .12); }
.cer-page { max-width: 100%; }
.cer-field { position: absolute; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent-hover); border-radius: var(--r-sm); pointer-events: none; letter-spacing: .01em; }
.cer-field-date { border-style: dotted; background: rgba(3, 105, 161, .05); font-size: .7rem; }

/* actions: Sign, then three quiet links, in this order */
.cer-actions { position: sticky; bottom: 0; z-index: var(--z-sticky); background: linear-gradient(to top, var(--paper) 72%, rgba(248, 250, 252, 0)); padding: var(--sp-3) 0 var(--sp-2); margin: 0 0 var(--sp-4); }
.cer-actions .button.primary { margin: 0; min-height: 52px; font-size: var(--fs-base); box-shadow: var(--glow-cta); }
.cer-quiet-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1) var(--sp-4); margin-top: var(--sp-2); font-size: var(--fs-sm); }
.cer-quiet-actions a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-1); }
.cer-quiet-actions a:hover { color: var(--ink); }

/* the sign sheet */
.cer-sheet { position: fixed; inset: auto 0 0 0; z-index: var(--z-sheet); background: var(--sheet); border-top: 1px solid var(--rule); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet); max-height: 92vh; max-height: 92dvh; overflow: auto; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up var(--dur) var(--ease); }
.cer-sheet[data-standalone="1"] { position: static; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--rule); max-height: none; animation: none; }
.cer-sheet-inner { max-width: var(--cer-wrap); margin: 0 auto; padding: var(--sp-3) var(--gutter) var(--sp-6); }
.cer-sheet-inner::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule-strong); margin: 0 auto var(--sp-3); }
.cer-sheet[data-standalone="1"] .cer-sheet-inner::before { display: none; }
.cer-sheet-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.cer-sheet-bar h2 { margin: 0; }
.cer-sheet-bar button.link { min-height: 44px; padding: 0 var(--sp-2); }
body.cer-sheet-open { overflow: hidden; }
.cer-tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--rule); margin: 0 0 var(--sp-4); }
.cer-tab { margin: 0; border: 0; border-bottom: 2px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none; padding: var(--sp-2) var(--sp-4); color: var(--ink-3); font-weight: var(--fw-medium); min-height: 44px; margin-bottom: -1px; }
.cer-tab:hover { color: var(--ink); background: var(--paper); border-color: transparent; box-shadow: none; }
.cer-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: var(--fw-semibold); }
.cer-tab:focus-visible { outline-offset: -2px; }
.cer-pane label { margin-top: 0; }
.cer-typed-preview { font-family: var(--script); font-size: 2.75rem; line-height: 1.2; min-height: 84px; padding: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); border: 1px dashed var(--rule-strong); border-radius: var(--r-md); color: #14213D; background: var(--sheet); overflow-wrap: anywhere; display: flex; align-items: center; position: relative; }
.cer-typed-preview::after, .cer-draw-wrap::after { content: ""; position: absolute; inset-inline-start: var(--sp-4); inset-inline-end: var(--sp-4); bottom: 22%; border-bottom: 1px solid var(--ink-4); pointer-events: none; }
.cer-draw-wrap { position: relative; margin-top: var(--sp-2); }
/* flow v2 §4: an uploaded signature image, previewed on a checkerboard so a transparent background shows */
.cer-upload-preview { margin-top: var(--sp-3); min-height: 84px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); background-color: #fff; background-image: linear-gradient(45deg, #EEF2F7 25%, transparent 25%), linear-gradient(-45deg, #EEF2F7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEF2F7 75%), linear-gradient(-45deg, transparent 75%, #EEF2F7 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.cer-upload-preview img { max-width: 100%; max-height: 140px; }
.cer-draw { display: block; width: 100%; aspect-ratio: 3 / 1; height: auto; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); background: var(--sheet); touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.cer-draw-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-sm); }
.cer-draw-tools button { margin: 0; }
.cer-consent { margin: var(--sp-5) 0 var(--sp-2); padding: var(--sp-4); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); font-size: var(--fs-sm); }
.cer-consent-text { margin: 0 0 var(--sp-1); color: var(--ink-2); }
.cer-consent-version { margin: 0 0 var(--sp-3); font-size: var(--fs-xs); }
.cer-check { display: flex; gap: var(--sp-3); align-items: flex-start; margin: 0; font-weight: var(--fw-medium); font-size: var(--fs-base); cursor: pointer; }
.cer-check input { margin-top: 2px; }
.cer-sign-form .cer-wide { min-height: 52px; font-size: var(--fs-base); margin-top: var(--sp-3); }

/* done and evidence record */
.cer-done h2 { color: var(--st-ok-fg); display: flex; align-items: center; gap: var(--sp-2); }
.cer-done h2 .mark { color: var(--st-ok-fg); }
.cer-done-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) 0; }
.cer-done-links .button { margin: 0; flex: 1 1 12rem; }
.cer-sealing { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--st-warn-bg); color: var(--st-warn-fg); border-radius: var(--r-md); }
.cer-sealing p { margin: 0; }
.cer-sealing .muted { color: inherit; opacity: .9; }
.cer-spinner { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid rgba(146, 64, 14, .3); border-top-color: var(--st-warn-fg); animation: spin 1s linear infinite; }
.cer-facts { display: grid; grid-template-columns: minmax(6rem, max-content) 1fr; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.cer-facts dt { color: var(--ink-3); }
.cer-facts dd { margin: 0; overflow-wrap: anywhere; }
.cer-identity { padding: var(--sp-3) var(--sp-4); border-inline-start: 3px solid var(--accent); background: var(--paper); border-radius: 0; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.6; color: var(--ink); }
.cer-timeline { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.cer-timeline li { padding-block: var(--sp-2); padding-inline: var(--sp-5) 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); position: relative; }
.cer-timeline li::before { content: ""; position: absolute; inset-inline-start: 3px; top: 1.05em; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.cer-timeline li:last-child { border-bottom: 0; }
.cer-timeline li:last-child::before { background: var(--accent); }
.cer-timeline time { color: var(--ink-3); font-family: var(--font-mono); font-size: var(--fs-xs); flex-basis: 100%; }


/* =============================================================================
   12  verify.onwyn
   ========================================================================== */
.verify-intro { max-width: var(--measure); margin-bottom: var(--sp-5); }
.verify-intro h1 { font-size: var(--fs-2xl); letter-spacing: -.03em; line-height: 1.1; }
.verify-form { margin-bottom: var(--sp-5); }
.verify-drop { padding: var(--sp-12) var(--sp-5); background: var(--sheet); }
.verify-drop .dropzone-label strong { font-size: var(--fs-lg); margin-bottom: var(--sp-2); max-width: 30ch; margin-inline-start: auto; margin-inline-end: auto; }
.verify-drop input[type="file"] { margin: var(--sp-4) auto var(--sp-3); }
.verify-drop button { margin-top: var(--sp-2); }
.verify-drop progress { display: block; width: 100%; max-width: 420px; margin: var(--sp-4) auto 0; height: 8px; accent-color: var(--accent); }
.verify-status { margin: var(--sp-2) 0 0; min-height: 1.2rem; }
.verify-privacy, .verify-services, .verify-offline { font-size: var(--fs-sm); max-width: var(--measure); }
.verify-privacy { display: flex; gap: var(--sp-2); align-items: flex-start; }
.verify-privacy .mark { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.verify-result { max-width: 760px; }
.verify-result .verdict { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; line-height: 1.3; padding: var(--sp-5) var(--sp-6); border-inline-start: 8px solid var(--st-neutral-fg); background: var(--st-neutral-bg); color: var(--ink); border-radius: var(--r-lg); margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm); }
.verdict-sealed_unchanged .verdict { border-color: var(--st-ok-fg); background: var(--st-ok-bg); }
.verdict-sealed_changed .verdict { border-color: var(--st-bad-fg); background: var(--st-bad-bg); }
.verdict-not_onwyn .verdict { border-color: var(--st-neutral-fg); background: var(--st-neutral-bg); }
.verdict-could_not_verify .verdict { border-color: var(--st-warn-fg); background: var(--st-warn-bg); }
.verdict-label { display: block; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .1em; text-transform: uppercase; margin-bottom: var(--sp-2); color: var(--st-neutral-fg); }
.verdict-sealed_unchanged .verdict-label { color: var(--st-ok-fg); }
.verdict-sealed_changed .verdict-label { color: var(--st-bad-fg); }
.verdict-could_not_verify .verdict-label { color: var(--st-warn-fg); }
.verdict-note { margin-block: 0 var(--sp-5); margin-inline: var(--sp-6) 0; color: var(--ink-2); padding-inline-start: calc(8px + var(--sp-6) - var(--sp-6)); }
.checked-list { margin: 0; padding-inline-start: 0; list-style: none; }
.checked-list li { margin: 0; padding-block: var(--sp-3); padding-inline: var(--sp-8) 0; border-top: 1px solid var(--rule); position: relative; color: var(--ink-2); }
.checked-list li:first-child { border-top: 0; padding-top: 0; }
.checked-list li:first-child::before { top: 2px; }
.checked-list li::before { content: ""; position: absolute; inset-inline-start: 2px; top: calc(var(--sp-3) + 2px); width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M4.5 8.5l2.2 2.2L11.5 5.7'/%3E%3C/svg%3E") center / 12px no-repeat; }
/* The mark follows the row's outcome, not the row being present: a check that did
   not pass shows a cross, a scope sentence shows a neutral dash. The glyph
   differs, so the meaning does not rest on colour, and the row's screen-reader
   prefix (`.sr-only`) does not rest on the glyph either. */
.checked-list li.check-fail::before { border-color: var(--st-bad-fg); background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23991B1B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6'/%3E%3C/svg%3E") center / 12px no-repeat; }
.checked-list li.check-info::before { background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' d='M4.8 8h6.4'/%3E%3C/svg%3E") center / 12px no-repeat; }
.verify-technical summary { font-weight: var(--fw-semibold); }
.verify-technical .headers { margin-top: 0; }
.sha { overflow-wrap: anywhere; }
.raw-report { background: var(--paper-alt); padding: var(--sp-4); border-radius: var(--r-md); font-size: var(--fs-xs); overflow: auto; max-height: 24rem; }
.verify-result .actions { margin: var(--sp-5) 0; }


/* =============================================================================
   13  seal.onwyn
   ========================================================================== */
.seal-upload .lede { margin-bottom: var(--sp-4); }
.seal-form .field-row:first-of-type { border-top: 0; padding-top: 0; }
.seal-status .lede { margin-bottom: var(--sp-4); }
.seal-status progress { width: 100%; max-width: 420px; height: 8px; accent-color: var(--warn); display: block; }
.seal-sealing { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--st-warn-bg); color: var(--st-warn-fg); border-radius: var(--r-md); }
.seal-sealing .cer-spinner { border-color: rgba(146, 64, 14, .3); border-top-color: var(--st-warn-fg); }
.seal-sealed-line { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); background: var(--st-ok-bg); color: var(--st-ok-fg); border-radius: var(--r-md); margin-bottom: var(--sp-4); }
.seal-sealed-line .mark { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.seal-sealed-line p { margin: 0; color: var(--ink); }
.seal-failed, .cer-sealing-failed { margin: var(--sp-4) 0; }
.seal-failed-line { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); background: var(--st-bad-bg); color: var(--st-bad-fg); border-radius: var(--r-md); margin-bottom: var(--sp-4); font-weight: var(--fw-medium); }
.verify-hint { font-size: var(--fs-sm); color: var(--ink-3); margin-top: var(--sp-3); }
.error-detail, .pem { white-space: pre-wrap; word-break: break-all; font-size: var(--fs-xs); background: var(--paper-alt); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); color: var(--ink-2); }
.error-detail { border-inline-start: 3px solid var(--danger); }
code.hash { word-break: break-all; font-size: var(--fs-xs); }
/* the code on a sealed document: one click selects all of it, ready to copy */
.doc-code { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.doc-code p { margin: 0; }
.doc-code-label { color: var(--ink-3); }
.doc-code-value { user-select: all; -webkit-user-select: all; font-weight: var(--fw-semibold); letter-spacing: .04em; white-space: nowrap; margin-inline-end: var(--sp-2); }
.trust-certs td, .trust-crls td { vertical-align: top; }
.trust-intro { display: flex; gap: var(--sp-4); align-items: flex-start; }
.trust-intro .mark { flex: none; width: 44px; height: 44px; color: var(--accent); }
.trust-page h1 { font-size: var(--fs-2xl); max-width: 26ch; letter-spacing: -.03em; line-height: 1.1; }
.trust-page .card h2 { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule); margin-bottom: var(--sp-4); }
.trust-page .list.prose li { display: list-item; }
.trust-page pre { font-size: var(--fs-xs); }


/* =============================================================================
   14  MOTION
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .85; } 50% { opacity: .3; } }
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .cer-spinner, .cer-pdf-loading::before, .status-queued::before { animation: none; }
  .cer-spinner, .cer-pdf-loading::before { border-top-color: inherit; border-style: dashed; }
  .cer-sheet { animation: none; }
}


/* =============================================================================
   15  RESPONSIVE
   ========================================================================== */
@media (max-width: 720px) {
  h1 { font-size: var(--fs-lg); }
  .verify-intro h1, .trust-page h1 { font-size: var(--fs-xl); }
  .header-row { gap: var(--sp-2) var(--sp-3); min-height: 60px; }
  .services { order: 3; flex-basis: 100%; justify-content: flex-start; margin-inline-start: calc(-1 * var(--sp-2)); }
  .header-tools { gap: var(--sp-2); }
  .subnav { gap: var(--sp-1); }
  .subnav .tenant-name { flex-basis: 100%; margin-inline-end: 0; }
  main.wrap { padding-top: var(--sp-5); padding-bottom: var(--sp-12); }
  .card { padding: var(--sp-4); }
  .card.narrow { margin: var(--sp-5) auto; padding: var(--sp-5); }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head .actions { flex-basis: 100%; }
  .page-head .actions .button { flex: 1 1 auto; }
  .table-wrap { border-radius: var(--r-md); }
  .table th, .table td { padding: var(--sp-2) var(--sp-3); }
  .table.requests th:nth-child(4), .table.requests td:nth-child(4) { display: none; }
  .table td.row-actions .button, .table td.row-actions button { min-height: 36px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .site-footer .wrap { flex-direction: column; }
  .cer-code-boxes { gap: var(--sp-1); }
  .cer-code-box { max-width: 48px; height: 56px; }
  .cer-done-links .button { flex-basis: 100%; }
  .verify-result .verdict { font-size: var(--fs-lg); padding: var(--sp-4); border-inline-start-width: 6px; }
  .verdict-note { margin-inline-start: 0; padding-inline-start: 0; }
  .trust-intro { flex-direction: column; }
  .row-form select { flex: 1 1 120px; }
  .editor-tools .button, .editor-tools button { flex: 1 1 auto; }
}
@media (max-width: 480px) {
  /* the signer's name and the time go; the document, its status and the actions stay */
  .table.requests th:nth-child(2), .table.requests td:nth-child(2) { display: none; }
  .table.requests td:first-child { max-width: 40vw; overflow-wrap: anywhere; }
  .table td.row-actions { text-align: start; }
  .actions .button, .actions button { flex: 1 1 auto; }
  .actions .inline-form { flex: 1 1 auto; }
  .actions .inline-form button { width: 100%; }
}
@media (min-width: 721px) {
  .cer-title { font-size: var(--fs-2xl); }
  .cer-timeline time { flex-basis: auto; }
  .cer-card { padding: var(--sp-6); }
  .cer-main { padding-top: var(--sp-8); }
  .cer-quiet-actions { gap: var(--sp-1) var(--sp-6); }
}


/* =============================================================================
   16  PRINT
   ========================================================================== */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .cer-header, .cer-actions, .cer-sheet, .skip, .actions, .lang { display: none !important; }
  .card, .cer-card, .table-wrap { box-shadow: none; border-color: #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .cer-footer { display: none !important; }
}


/* =============================================================================
   17  HOME AS A DASHBOARD, THE COMPANY CHOOSER, THE PUBLIC PAGES   (W-D)

   Appended as one block so it merges cleanly beside the other workstreams.
   The list here is `.table.reqlist`, not `.table.requests`: on a phone the old
   table dropped the Signer and When columns outright, and a row with neither
   who nor when is not a row (audit U6). These stack instead.
   ========================================================================== */

/* the two states between the signature and the sealed file (audit U2) */
.status-sealing { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.status-sealing::before { animation: pulse 1.6s ease-in-out infinite; }
.status-sealing_failed { background: var(--st-bad-bg); color: var(--st-bad-fg); }

.banner-failed { border-inline-start: 3px solid var(--danger); }
.banner-failed h2 { margin-top: 0; font-size: var(--fs-lg); }

/* "This week": four counts that are links */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin: 0 0 var(--sp-5); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-4); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-md); }
.tile-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: var(--fw-semibold); }
.tile-value { font-size: 2.125rem; font-weight: var(--fw-bold); letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-note { font-size: var(--fs-xs); color: var(--ink-3); }
.tile-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile-attention .tile-value { color: var(--st-bad-fg); }

.list-filter { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-4); }
.list-filter input[type="search"] { flex: 1 1 16rem; margin: 0; }
.list-filter select { flex: 0 1 14rem; margin: 0; }
.list-count { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.pager { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-5); font-size: var(--fs-sm); }

/* the company chooser, with enough on each row to tell two companies apart */
.chooser-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; width: 100%; }
.chooser-name { font-weight: var(--fw-semibold); }
.chooser-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-xs); color: var(--ink-3); }
.chooser-slug { font-family: var(--font-mono); }

/* the public pages: prose, not product chrome */
.public-page h2 { font-size: var(--fs-lg); margin-top: var(--sp-6); }
.public-page .pairs { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-sm); }
.public-page .pairs dt { color: var(--ink-3); }
.public-page .pairs dd { margin: 0; }
.site-footer .legal { font-size: var(--fs-xs); color: var(--ink-3); }

@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .list-filter input[type="search"], .list-filter select { flex: 1 1 100%; }

  /* Stack, do not hide: every row keeps its document, signer, status and date. */
  .table.reqlist, .table.reqlist tbody, .table.reqlist tr, .table.reqlist td { display: block; width: 100%; }
  .table.reqlist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table.reqlist tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule); }
  .table.reqlist tr:last-child { border-bottom: 0; }
  .table.reqlist td { border-bottom: 0; padding: 2px 0; overflow-wrap: anywhere; }
  .table.reqlist td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: var(--fs-xs); }
  .table.reqlist td:first-child::before { content: none; }
  .table.reqlist td:first-child { font-weight: var(--fw-medium); font-size: var(--fs-base); }
  .table.reqlist td.row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); text-align: start; padding-top: var(--sp-3); }
}

/* ---- Sign-in: the SSO buttons and the "or" divider ----
 *
 * These rules were a `<style>` element in templates/registration/login.html
 * until MIN-28. `style-src 'self'` carries no `'unsafe-inline'`, so the browser
 * refused the whole block and the sign-in page (sign and seal both) drew the
 * provider buttons as bare links. They also named five custom properties this
 * design system does not define — --border, --surface, --surface-hover, --text
 * and --text-muted — so the block would not have painted correctly even if the
 * policy had allowed it. The real tokens are used below.
 */
.sso-buttons { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.sso-button { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--sheet); color: var(--ink); text-decoration: none; font-weight: var(--fw-medium); }
.sso-button:hover { background: var(--paper-alt); border-color: var(--accent); color: var(--ink); }
.sso-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0; color: var(--ink-3); font-size: var(--fs-xs); }
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* The credentials table on a service account sits under the "Issue credential"
 * button; the gap was an inline `margin-top` the policy dropped (MIN-28). */
.card > .button + .table-wrap { margin-top: var(--sp-4); }

/* ============================================================================
 * Template graph builder (the template create + edit pages) — MIN-35.
 *
 * These rules were a <style> element in templates/templates/template_create.html
 * and _edit.html until MIN-35. `style-src 'self'` carries no 'unsafe-inline',
 * so an enforcing browser refused the whole block and the two-column grid the
 * graph builder's fields sit in drew with no layout at all on the very pages
 * the enterprise admin uses most.
 *
 * Both pages set `template-create` / `template-edit` as their body class, so the
 * rules are scoped to those classes and cannot leak onto other surfaces. The
 * old block also referenced two custom properties this design system does not
 * define (--border and --surface-raised); they are mapped to --rule and --sheet
 * so the rules actually paint.
 * ========================================================================== */
body.template-create .form-section,
body.template-edit .form-section { margin-bottom: 2rem; }

body.template-create .form-section legend,
body.template-edit .form-section legend {
  font-size: 1.1rem;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--rule);
  width: 100%;
}

body.template-create .field-row,
body.template-edit .field-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

body.template-create .field-row .field,
body.template-edit .field-row .field { flex: 1; min-width: 180px; }

body.template-create .fields-table input[type="text"],
body.template-create .fields-table select,
body.template-edit .fields-table input[type="text"],
body.template-edit .fields-table select { width: 100%; box-sizing: border-box; }

body.template-create .node-row,
body.template-edit .node-row {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  position: relative;
}

body.template-create .node-row .node-header,
body.template-edit .node-row .node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

body.template-create .node-row .node-body,
body.template-edit .node-row .node-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

body.template-create .edges-table input[type="text"],
body.template-edit .edges-table input[type="text"] { width: 100%; box-sizing: border-box; }

body.template-create .graph-edges-heading,
body.template-edit .graph-edges-heading { margin-top: 1.5rem; }


/* =============================================================================
   18  THE ONWYN CHROME   (the onwyn.io theme, 28 Sep 2026)

   What the base templates draw on every host: the brand lockup, the section
   name on seal and verify, the Beta chip, the quiet line back to the parent,
   and the footer's links. Plus the shared components a page may reach for —
   tabs, pagination, a modal — so that a page written tomorrow does not invent
   its own.
   ========================================================================== */

/* ---- the brand lockup ---- */
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-3); min-width: 0; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; margin-inline-end: 10px; }
.brand-section { display: inline-flex; align-items: center; font-size: 1.125rem; font-weight: var(--fw-medium); letter-spacing: -.02em; color: var(--ink-3); padding-inline-start: var(--sp-3); border-inline-start: 1px solid var(--rule-strong); line-height: 1.2; white-space: nowrap; }
/* Beta is a fact about the service, not a status of a document: it is drawn in
   the brand's quiet pill, never in a status colour. */
.chip-beta { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--accent-wash-edge); background: var(--accent-wash); color: var(--accent-hover); font-size: .6875rem; font-weight: var(--fw-semibold); letter-spacing: .1em; text-transform: uppercase; line-height: 1.6; white-space: nowrap; }
.chip-beta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.brand-parent { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); text-decoration: none; white-space: nowrap; min-height: 24px; display: inline-flex; align-items: center; }
.brand-parent:hover, .brand-parent:focus-visible { color: var(--accent); text-decoration: underline; }
.brand-parent::before { content: "·"; margin-inline-end: var(--sp-3); color: var(--ink-4); }

/* ---- the footer's links ---- */
.footer-brand { flex: 1 1 22rem; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.footer-links { flex: 0 1 auto; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 0 var(--sp-8); }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; font-weight: var(--fw-medium); }
.footer-links a:hover, .footer-links a:focus-visible { text-decoration: underline; }
.site-footer .legal { flex-basis: 100%; max-width: none; border-top: 1px solid #1E293B; padding-top: var(--sp-5); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--on-dark-muted); }
.cer-footer .footer-links { margin-top: var(--sp-4); }
.cer-footer .footer-links ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--sp-5); }
.cer-footer .legal { margin: var(--sp-4) 0 0; font-size: var(--fs-xs); color: var(--on-dark-muted); }

/* ---- eyebrow, as on the site ---- */
.eyebrow { display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-2); }

/* ---- banners: a full-width fact above the page (demo, read-only, Beta) ---- */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-5); border: 1px solid var(--accent-wash-edge); border-inline-start: 3px solid var(--accent); border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent-hover); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.banner-warn { border-color: #FDE68A; border-inline-start-color: var(--warn); background: var(--st-warn-bg); color: var(--st-warn-fg); }
.banner-bad { border-color: #FECACA; border-inline-start-color: var(--danger); background: var(--st-bad-bg); color: var(--st-bad-fg); }
.banner a { color: inherit; font-weight: var(--fw-semibold); }
.banner-failed { background: var(--sheet); }

/* ---- tabs (the sign sheet's .cer-tabs is the same drawing) ---- */
.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1); border-bottom: 1px solid var(--rule); margin: 0 0 var(--sp-5); padding: 0; list-style: none; }
.tabs a, .tabs button { margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none; box-shadow: none; padding: var(--sp-2) var(--sp-4); min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-3); font-size: .9375rem; font-weight: var(--fw-medium); text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--ink); background: var(--paper-alt); }
.tabs [aria-current="page"], .tabs [aria-selected="true"], .tabs .is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: var(--fw-semibold); }

/* ---- pagination ---- */
.pager { color: var(--ink-3); }
.pager a, .pager .button { text-decoration: none; }
.pager .current { font-weight: var(--fw-semibold); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- a modal, for a page that needs one: <dialog class="modal"> ---- */
dialog.modal { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-6); width: min(520px, calc(100vw - 2 * var(--gutter))); background: var(--sheet); color: var(--ink-2); box-shadow: 0 20px 50px rgba(2, 6, 23, .12); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .6); }
dialog.modal h2 { margin-bottom: var(--sp-3); }
dialog.modal .actions { margin-top: var(--sp-5); justify-content: flex-end; }

/* ---- a form's own button never touches the field above it ----
   :where() keeps these at the weight of a bare element selector, so any rule
   a component already has for its button still wins. */
:where(form:not(.inline-form):not(.row-form):not(.list-filter)) > :where(input, select, textarea, .field-row, .grid-2, .switch-row) + :where(button, .button) { margin-top: var(--sp-5); }
:where(.card.narrow) form + p { margin-top: var(--sp-5); }
/* two fields side by side start on the same line */
.grid-2 > .field-row, .step .grid-2 > .field-row:first-of-type { padding-top: var(--sp-4); }

/* ---- the sign-in and error cards ---- */
.card.narrow h1 { letter-spacing: -.02em; }
.card.narrow .lede, .card.narrow > p.muted { font-size: var(--fs-sm); }

@media (max-width: 720px) {
  .brand { gap: 0 var(--sp-2); }
  .brand-mark { width: 28px; height: 28px; }
  .brand-section { font-size: 1rem; padding-inline-start: var(--sp-2); }
  /* the line back to the parent goes under the name, aligned with it */
  .brand-parent { flex-basis: 100%; padding-inline-start: 38px; margin-top: -4px; }
  .brand-parent::before { content: none; }
  /* the footer is a column here, where a flex-basis would be a height */
  .footer-brand, .footer-links { flex: 0 0 auto; }
  .footer-links ul { gap: 0 var(--sp-6); }
  .site-footer { padding: var(--sp-8) 0; }
}

/* flow v2 §3: the member's "Your turn to sign" list on the dashboard */
.my-turns { margin-bottom: var(--sp-4); }
.my-turns h2 { margin-top: 0; }
.my-turns-list { list-style: none; margin: 0; padding: 0; }
.my-turns-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--rule-soft); }
.my-turns-list li:first-child { border-top: 0; }
.my-turns-list .button { margin-inline-start: auto; }
.signer-step-head { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }

/* "Report a problem" (Beta testers): a quiet link at the foot of every page;
   the form is its own page (templates/feedback/form.html). */
.report-problem { flex-basis: 100%; margin: var(--sp-2) 0 0; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.report-form { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0 0; text-align: start; }
.report-form label { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.report-form textarea, .report-form input[type="email"] { width: 100%; }
.report-form .report-note { margin: 0; color: var(--ink-3); font-size: var(--fs-xs); }

/* =============================================================================
   RIGHT-TO-LEFT (ar)
   Layout above is written in logical properties (inline-start/end), so it
   mirrors by itself under <html dir="rtl">. What is left here is what logical
   properties cannot say: background positions, rotated chevrons, arrows.
   Inside RTL, the PDF canvas, document codes, emails, URLs, hashes and times
   stay left-to-right (`.ltr`, `dir="ltr"`, <bdi>).
   ========================================================================== */
[dir="rtl"] select { background-position: left var(--sp-3) center; }
[dir="rtl"] details summary::before { transform: rotate(135deg); }
[dir="rtl"] details[open] summary::before { transform: rotate(45deg); }
[dir="rtl"] .icon-flip, [dir="rtl"] .arrow { transform: scaleX(-1); display: inline-block; }
.ltr, [dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .pdf-pages, [dir="rtl"] .pdf-page, [dir="rtl"] .editor-stage .pdf-pages { direction: ltr; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] .mono, [dir="rtl"] code, [dir="rtl"] .doc-code-value { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"] { text-align: end; }
/* Arabic script: the brand face (Plus Jakarta Sans) has no Arabic glyphs. */
:lang(ar) { --font-sans: "Onwyn Arabic", "Plus Jakarta Sans", system-ui, sans-serif; }
/* Negative tracking breaks the joins of Arabic script. */
:lang(ar) :not(.doc-code-value):not(code):not(.mono) { letter-spacing: normal; }
