/* bytesign — design tokens and components from the design canvas. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2"); 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: "IBM Plex Sans"; font-weight: 400 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext.woff2") format("woff2"); 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; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin.woff2") format("woff2"); 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: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-ext.woff2") format("woff2"); 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; }
@font-face { font-family: "Space Grotesk"; font-weight: 500 700; font-display: swap; src: url("../fonts/space-grotesk-latin.woff2") format("woff2"); 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: "Space Grotesk"; font-weight: 500 700; font-display: swap; src: url("../fonts/space-grotesk-latin-ext.woff2") format("woff2"); 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; }

:root {
  --ink: #232121;
  --ink-2: #3B3835;
  --ink-3: #4A4642;
  --muted: #5E5A55;
  --muted-2: #8A857E;
  --bg: #F4F2EE;
  --surface: #FFFFFF;
  --faint: #FAF9F7;
  --subtle: #ECEAE6;
  --line: #E4E0D9;
  --line-2: #CFCAC2;
  --line-3: #EFECE7;
  --code-bg: #1B1A1A;
  --accent: #F0643C;
  --ok: #155A36;
  --ok-bg: #E3F1E8;
  --ok-line: #B9DCC6;
  --ok-soft: #F1F8F3;
  --warn: #6E4700;
  --warn-bg: #FCEFD2;
  --danger: #A2360F;
  --danger-bg: #FDE7DF;
  --danger-line: #F4C9B8;

  --font: "IBM Plex Sans", system-ui, sans-serif;
  --font-head: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-doc: Georgia, "Times New Roman", serif;
  /* Interaction states (see design canvas: Komponenten · Buttons und Navigation).
     Contrast: focus ring ≥ 4.6:1 on light surfaces, 5:1 on dark ones. */
  --focus: #C2410C;
  --btn-p-hover: #5E5A55;
  --btn-p-active: #000000;
  --border-strong: #8A857E;
  --radius: 10px;
  --container: 1440px; /* max layout width on large screens */
  --radius-card: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.4; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #000; text-decoration-thickness: 2px; }

/* Dark surfaces use the bright accent as focus ring (5:1 on ink). */
.app-bar, .app-header, .auth-aside, .section-dark, .float-status { --focus: var(--accent); }

/* One visible focus style for everything keyboard-reachable. */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
.icon { flex-shrink: 0; }
.h { font-family: var(--font-head); letter-spacing: -0.01em; font-weight: 700; }
.mono { font-family: var(--font-mono); }
.doc { font-family: var(--font-doc); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Buttons and inputs ---- */
/* Buttons: every variant has a clearly different hover and pressed state;
   ghost buttons also underline on hover so the change is not colour-only. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius); font: 600 15px/1 var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; background: none; color: var(--ink); transition: background-color .12s, border-color .12s, color .12s; }
.btn-p { background: var(--ink); color: #fff; }
.btn-p:hover { background: var(--btn-p-hover); color: #fff; }
.btn-p:active { background: var(--btn-p-active); }
.btn-s { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-s:hover { background: var(--subtle); color: var(--ink); border-color: var(--ink); }
.btn-s:active { background: var(--line); }
.btn-g { background: transparent; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-g:hover { background: var(--line); color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.btn-g:active { background: var(--line-2); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--line); color: var(--ink); }
.btn-outline-light { color: #fff; border-color: var(--border-strong); }
.btn-outline-light:hover { color: #fff; background: var(--ink-2); border-color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--subtle); color: var(--muted-2); border-color: transparent; cursor: not-allowed; text-decoration: none; }
.inp:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice:hover { border-color: var(--muted); }
.choice:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.inp { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 12px; font: 400 15px var(--font); background: var(--surface); color: var(--ink); }
.inp.mono { font-family: var(--font-mono); }
.inp[aria-invalid="true"] { border-color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.field .error { font-size: 13px; font-weight: 500; color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; }
.choice:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }
.choice-title { display: block; font-size: 15px; font-weight: 600; }
.choice-text { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---- Cards, badges, notices ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.card h2 { font-size: 15px; font-weight: 600; }
.card p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.notice { display: flex; gap: 10px; padding: 16px 18px; border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--surface); }
.notice-title { font-weight: 600; font-size: 15px; }
.notice-text { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.notice-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.notice-ok > .icon { color: var(--ok); }
.notice-error { background: var(--danger-bg); border-color: var(--danger-line); }
.notice-error > .icon { color: var(--danger); }
.notice-warn { background: var(--warn-bg); border-color: #EBD3A0; }
.notice-warn > .icon, .notice-warn .notice-text { color: var(--warn); }
.notice-action { margin-top: 10px; }
.status { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.status-ok { color: var(--ok); }
.status-error { color: var(--danger); }
.status-warn { color: var(--warn); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--subtle); color: var(--ink-3); }
.pill { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }

.terminal { background: var(--code-bg); color: var(--line); border-radius: 12px; padding: 16px 18px; font: 500 12.5px/1.7 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal .hl { color: var(--accent); }

/* ---- Site layout (landing, legal) ---- */
/* Centered layout: padding grows so the content never exceeds --container.
   Backgrounds stay full width. --gutter is the edge padding per component. */
.wrap, .app-header, .setup-main, .setup-footer, .app-main { padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))); }
.wrap { --gutter: 120px; }
.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.site-nav { display: flex; gap: 32px; font-size: 15px; }
/* Navigation links: underline on hover (non-colour cue). */
.site-nav a { text-decoration: none; padding-block: 10px; text-underline-offset: 6px; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.site-actions { display: flex; gap: 10px; }
.site-header { position: relative; }
.menu { display: none; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-toggle { padding: 0 10px; }
.menu .menu-close, .menu[open] .menu-open { display: none; }
.menu[open] .menu-close { display: block; }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(35,33,33,.12); padding: 8px 20px 20px; display: flex; flex-direction: column; }
.menu-panel > a { display: flex; align-items: center; min-height: 52px; font-size: 17px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); text-underline-offset: 6px; }
.menu-panel > a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.menu-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.site-footer { padding-block: 28px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer nav a { color: var(--ink-2); }
.site-footer .brand-line { display: flex; align-items: center; gap: 10px; }

.hero { padding-block: 72px 88px; display: flex; align-items: center; justify-content: space-between; gap: 64px; }
.hero-text { display: flex; flex-direction: column; gap: 28px; max-width: 640px; }
.hero h1 { font-size: 64px; line-height: 1.04; }
.hero .lead { font-size: 20px; line-height: 1.5; color: var(--ink-2); }
.hero .note { font-size: 14px; color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art { position: relative; width: 520px; height: 480px; flex-shrink: 0; }
.paper { position: absolute; left: 40px; top: 20px; width: 380px; height: 440px; background: #fff; box-shadow: 0 2px 4px rgba(35,33,33,.06), 0 24px 48px rgba(35,33,33,.12); padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; }
.paper-title { font-weight: 700; font-size: 15px; }
.paper-line { height: 6px; background: var(--subtle); border-radius: 3px; }
.paper-line:nth-of-type(8n+1) { width: 92%; } .paper-line:nth-of-type(8n+2) { width: 86%; } .paper-line:nth-of-type(8n+3) { width: 95%; } .paper-line:nth-of-type(8n+4) { width: 70%; }
.paper-line:nth-of-type(8n+5) { width: 88%; } .paper-line:nth-of-type(8n+6) { width: 91%; } .paper-line:nth-of-type(8n+7) { width: 64%; } .paper-line:nth-of-type(8n) { width: 80%; }
.paper-spacer { flex-grow: 1; }
.paper-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.paper-sig { display: flex; flex-direction: column; gap: 4px; }
.paper-sig-area { height: 46px; display: flex; align-items: flex-end; }
.paper-sig-label { border-top: 1px solid #1B1B1B; padding-top: 3px; font-size: 10px; color: var(--ink-2); }
.paper-sig-field { height: 46px; border: 2px solid #B45A00; background: #FBEEDD; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #9A4A00; font-size: 12px; font-weight: 600; }
.float-card { position: absolute; border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 28px rgba(35,33,33,.12); display: flex; }
.float-e2e { right: 0; top: 70px; width: 210px; background: #fff; border: 1px solid var(--line); flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.float-status { left: 0; bottom: 30px; background: var(--ink); color: #fff; align-items: center; gap: 10px; box-shadow: 0 12px 28px rgba(35,33,33,.18); }
.float-status .dot { width: 28px; height: 28px; border-radius: 50%; background: #1E7A4C; display: flex; align-items: center; justify-content: center; }
.float-status strong { display: block; font-size: 13px; }
.float-status span { font-size: 12px; color: var(--line-2); }

.section { padding-block: 88px; display: flex; flex-direction: column; gap: 40px; }
.section-white { background: var(--surface); }
.section-dark { background: var(--ink); color: #fff; }
.section h2 { font-size: 42px; }
.section .intro { max-width: 720px; }
.section .intro p { margin-top: 12px; font-size: 18px; line-height: 1.5; color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.step-card-top { display: flex; align-items: center; justify-content: space-between; }
.step-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.step-num { font-family: var(--font-head); font-size: 40px; font-weight: 700; color: var(--line); }
.step-card h3, .sec-card h3 { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.step-card p, .sec-card p { font-size: 16px; line-height: 1.55; color: var(--ink-2); }

.security { flex-direction: row; gap: 80px; padding-block: 96px; }
.security-text { width: 460px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.security-text h2 { line-height: 1.1; }
.security-text > p { font-size: 18px; line-height: 1.55; color: var(--line); }
.security-list { margin-top: 8px; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.5; color: var(--line); }
.security-list li { display: flex; gap: 12px; }
.security-list .icon { color: var(--accent); margin-top: 2px; }
.security-cards { flex-grow: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-content: start; }
.sec-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.sec-card .badge { font-size: 13px; padding: 4px 10px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; }
.features li { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; border-top: 1px solid var(--line-2); }
.features h3 { font-size: 18px; font-weight: 600; }
.features p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
#funktionen { padding-bottom: 72px; gap: 32px; }


.cta { --gutter: 120px; margin: 0 max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))) 88px; /* above: the 88px of the section before */ background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: 56px 64px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta h2 { font-size: 38px; }
.cta h2 { margin: 0; }
.cta p { margin: 10px 0 0; font-size: 18px; color: var(--ink-2); }

/* Compact variants only shown on small screens (LandingMobile). */
.only-sm { display: none; }

/* ---- Plain pages (legal, locked, notices) ---- */
/* Text pages: left-aligned inside the centered container, readable line length. */
.plain { padding-block: 72px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.plain > * { max-width: 720px; }
.plain h1 { font-size: 40px; }
.plain p { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.plain > .legal-tiles { max-width: none; }
/* API documentation */
.api-docs > * { width: 100%; max-width: 860px; }
.api-docs p { font-size: 15px; margin: 0; }
.api-docs .lead { font-size: 17px; }
.api-docs code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg); border-radius: 5px; padding: 1px 5px; }
.api-docs .terminal { margin: 0; }
.api-docs .notice { flex-direction: column; align-items: flex-start; }
.api-toc { flex-direction: row !important; flex-wrap: wrap; gap: 6px 18px !important; font-size: 14px; font-weight: 600; }
.api-section { gap: 14px; align-items: stretch !important; scroll-margin-top: 90px; }
.api-section h2 { font-size: 22px; margin: 0; }
.api-table td:first-child { white-space: nowrap; vertical-align: top; }
.api-table { font-size: 14px; }
.legal-tiles { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.legal-tiles .card { padding: 20px; gap: 10px; }
.legal-tiles h2 { font-size: 15px; font-weight: 600; margin: 0; }
.legal-tiles p { margin: 0; font-size: 16px; }

/* ---- Setup layout ---- */
.app-header { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; --gutter: 32px; background: var(--ink); color: #fff; }
.app-header .brand-name { font-size: 20px; color: #fff; }
.app-header .tag { margin-left: 8px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ink-2); color: var(--line); }
.app-header .meta { font-size: 14px; color: var(--line-2); }

.setup { min-height: 100vh; display: flex; flex-direction: column; }
.setup form.setup-form { flex-grow: 1; display: flex; flex-direction: column; }
.stepper { min-height: 72px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; }
.stepper ol { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.stepper li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.stepper .num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.stepper .done { color: var(--ink-3); }
.stepper .done .num { width: 28px; height: 28px; border: 0; background: var(--ok-bg); color: var(--ok); }
.stepper .current { color: var(--ink); font-weight: 600; }
.stepper .current .num { width: 28px; height: 28px; border: 0; background: var(--ink); color: #fff; font-weight: 600; }
.stepper .bar { width: 40px; height: 2px; background: var(--line); }
.stepper .bar.done { background: var(--ink); }

.setup { --container: 1280px; } /* setup screens are designed at 1280 */
.setup-main { flex-grow: 1; display: flex; gap: 40px; padding-block: 28px; --gutter: 64px; align-items: flex-start; }
.setup-col { flex-grow: 1; display: flex; flex-direction: column; gap: 16px; max-width: 640px; min-width: 0; }
.setup-col.wide { max-width: 720px; }
.setup-col.narrow { max-width: 560px; }
.setup-col h1 { font-size: 30px; }
.setup-col .sub { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.setup-aside { width: 420px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.setup-aside.slim { width: 340px; }
.setup-footer { height: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; --gutter: 48px; background: var(--surface); border-top: 1px solid var(--line); gap: 16px; }

.keylist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.keylist li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line-3); }
.keylist li.head { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--faint); border-top: 0; }
.keylist .ok { width: 24px; height: 24px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.keylist .name { font-weight: 600; font-size: 15px; }
.keylist .desc { font-size: 13px; color: var(--muted); }
.keylist .grow { flex-grow: 1; }
.fingerprint { font-size: 13px; line-height: 1.6; word-break: break-all; }

.kit-preview { width: 380px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(35,33,33,.08); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.kit-top { display: flex; align-items: center; justify-content: space-between; }
.kit-top .title { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.kit-confidential { font-size: 11px; font-weight: 600; color: var(--danger); border: 1px solid var(--danger-line); border-radius: 4px; padding: 2px 6px; }
.kit-meta { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.kit-meta div { display: flex; justify-content: space-between; gap: 12px; }
.kit-meta dt { color: var(--muted); }
.kit-meta dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kit-words { border-top: 1px solid var(--line-3); padding-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kit-words li { display: flex; gap: 6px; font-size: 13px; }
.kit-words .n { color: var(--muted-2); width: 18px; text-align: right; }
.kit-words .w { font-family: var(--font-mono); letter-spacing: .08em; color: var(--muted-2); }
.kit-preview figcaption { font-size: 11px; line-height: 1.45; color: var(--muted); border-top: 1px solid var(--line-3); padding-top: 12px; }
.unseal-choice .snippet { display: none; }
.unseal-choice:has(#unseal-env:checked) .snippet-env, .unseal-choice:has(#unseal-file:checked) .snippet-file { display: block; }

.errors { display: flex; flex-direction: column; gap: 4px; }
/* Mail step: SMTP fields only when SMTP is chosen. */
.smtp-fields { display: flex; flex-direction: column; gap: 16px; }
.setup-form:has(input[name="transport"][value="log"]:checked) .smtp-fields { display: none; }
.status:empty { display: none; }
.btn-block { width: 100%; }

/* Script-driven flows (admin account, Notfall-Kit, verification) */
.setup-app { flex-grow: 1; display: flex; flex-direction: column; }
.flow-view { flex-grow: 1; display: flex; justify-content: center; align-items: center; gap: 64px; padding: 32px max(24px, calc((100% - 1280px) / 2 + 64px)); }
.flow-col { width: 520px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; }
.flow-col h1, .flow-view h1 { font-size: 34px; line-height: 1.15; outline: none; }
.lead-text { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.round-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.round-lg { width: 64px; height: 64px; }
.round-danger { background: var(--danger-bg); color: var(--danger); }
.round-ok { background: var(--ok-bg); color: var(--ok); }
.round-neutral { background: var(--bg); color: var(--ink); }
.checklist { display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 600; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist li > div { display: flex; flex-direction: column; gap: 2px; }
.checklist .muted { font-size: 13px; font-weight: 400; }
.checklist .ok, .checklist .no { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist .ok { background: var(--ok-bg); color: var(--ok); }
.checklist .no { background: var(--danger-bg); color: var(--danger); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.kit-body { display: flex; gap: 18px; align-items: center; border-top: 1px solid var(--line-3); padding-top: 16px; }
.kit-body .kit-words { border-top: 0; padding-top: 0; flex-grow: 1; }
.kit-words.revealed .w { letter-spacing: normal; color: var(--ink); }
.kit-qr svg { width: 112px; height: 112px; }
.flow-view .card h1 { font-size: 28px; }
.confirm-card { width: 560px; max-width: 100%; padding: 36px; gap: 20px; }
.confirm-card h1 { font-size: 28px; }

/* ---- Auth pages (login, registration, recovery) ---- */
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 14px; }
.center { justify-content: center; text-align: center; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.auth-split { min-height: 100vh; display: flex; }
.auth-aside { width: 520px; flex-shrink: 0; background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside .brand-name { color: #fff; }
.auth-claim { display: flex; flex-direction: column; gap: 28px; }
.auth-claim h2 { font-size: 38px; line-height: 1.12; }
.auth-claim ul { display: flex; flex-direction: column; gap: 14px; }
.auth-claim li { display: flex; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--line); }
.auth-claim .icon { color: var(--accent); margin-top: 2px; }
.auth-foot { margin: 0; font-size: 13px; color: var(--line-2); display: flex; flex-wrap: wrap; gap: 8px; }
.auth-foot a { color: inherit; }
.auth-foot a:hover { color: #fff; }
.auth-split > .auth-mobile-foot { display: none; }
.auth-main { flex-grow: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-split > .auth-mobile-head { display: none; }
.auth-form { width: 420px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; }
.auth-form.wide { width: 560px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider[hidden] { display: none; }

/* Unlocking on a new device (designs: UnlockChoose, UnlockDevice, UnlockPhone) */
.unlock-view { display: flex; flex-direction: column; gap: 16px; }
.unlock-view[hidden] { display: none; }
.signed-in { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ok); }
.method-card { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.method-card:hover { border-color: var(--border-strong); }
.method-card.recommended { border: 2px solid var(--ink); }
.method-card:disabled { opacity: .6; cursor: wait; }
.method-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.method-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.method-text { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.steps-list { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.device-pair { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.device-qr { width: 200px; height: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 10px; }
.device-qr svg { width: 100%; height: 100%; display: block; }
.code-box { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 12px; background: var(--bg); }
.code-box .mono { font-size: 34px; letter-spacing: .08em; }
.code-box.strong { background: var(--surface); border: 2px solid var(--ink); align-items: center; }
.code-box[hidden] { display: none; }
.unlock-view > .btn-g, .unlock-view > form { align-self: flex-start; }
.unlock-view h1:focus, .flow-view h1:focus { outline: none; }
.device-approve .round-icon { background: var(--surface); border: 1px solid var(--line); }
.facts-card dl { margin: 0; }
.device-approve { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.device-approve h1 { font-size: 26px; margin: 0; }
.device-approve p { margin: 0; }
.device-actions { display: flex; flex-direction: column; gap: 10px; }
.device-actions[hidden] { display: none; }
.passkey-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-3); }
.passkey-list li:first-child { border-top: 0; }
.passkey-add { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-3); padding-top: 14px; }
.auth-form h1 { font-size: 32px; }
.auth-alt { font-size: 14px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: 16px; }
.auth-alt a { font-weight: 600; }
.field-head { display: flex; justify-content: space-between; gap: 12px; }
.field-head a { font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.meter { display: flex; gap: 4px; }
.meter span { flex-grow: 1; height: 4px; border-radius: 2px; background: var(--line); }
.meter[data-score="1"] span:nth-child(-n+1), .meter[data-score="2"] span:nth-child(-n+2) { background: #B45A00; }
.meter[data-score="3"] span:nth-child(-n+3), .meter[data-score="4"] span { background: #1E7A4C; }
.word-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.word-grid label { display: flex; align-items: center; gap: 8px; }
.word-grid .n { width: 20px; text-align: right; font-size: 13px; color: var(--muted-2); flex-shrink: 0; }
.flow { min-height: 100vh; display: flex; flex-direction: column; }
.flow-header { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; }
.flow-main { flex-grow: 1; display: flex; flex-direction: column; }
.verify-card { width: 580px; max-width: 100%; padding: 40px; gap: 20px; }
.code-input { height: 64px; font-size: 30px; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.fineprint { border-top: 1px solid var(--line-3); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.fineprint p { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }

/* ---- App shell (logged in) ---- */
.app-bar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--ink); color: #fff; padding-inline: max(32px, calc((100% - var(--container)) / 2 + 32px)); }
.app-bar-left, .app-bar-right { display: flex; align-items: center; gap: 40px; }
.app-bar-right { gap: 12px; }
.app-bar .brand-name { color: #fff; font-size: 20px; }
.app-nav { display: flex; gap: 24px; font-size: 15px; align-self: stretch; }
/* App navigation: grey bar on hover, accent bar + bold for the current page. */
.app-nav a { color: var(--line-2); text-decoration: none; display: flex; align-items: center; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.app-nav a:hover { color: #fff; border-bottom-color: var(--border-strong); }
.app-nav a[aria-current="page"] { color: #fff; font-weight: 600; border-bottom-color: var(--accent); }
.app-nav a:focus-visible { outline-offset: -3px; }
.app-user { font-size: 14px; color: var(--line-2); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover .avatar, .avatar:hover { box-shadow: 0 0 0 3px var(--border-strong); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2F5FD0; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 16px 32px rgba(35,33,33,.16); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.user-menu-nav { display: none; flex-direction: column; }
.user-menu-nav a { min-height: 44px; display: flex; align-items: center; text-decoration: none; border-top: 1px solid var(--line); text-underline-offset: 6px; }
.user-menu-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.app-main { --gutter: 48px; padding-block: 36px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 36px; }
.page-head .sub { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 15px; color: var(--muted); }
.empty-state { align-items: flex-start; padding: 32px; gap: 12px; }
.empty-state h2 { font-size: 18px; }

/* ---- Documents: overview ---- */
.grow { flex-grow: 1; min-width: 0; }
.small { font-size: 13px; }
.notice-turn { align-items: center; gap: 16px; background: #FFF7F3; border-color: var(--danger-line); }
.notice-turn .notice-text { font-size: 14px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: 500 14px var(--font); cursor: pointer; }
.filters button:hover { background: var(--subtle); border-color: var(--ink); }
.filters button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.filters button { display: inline-flex; align-items: center; gap: 6px; }
.filters button[hidden] { display: none; }
.dot-danger { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.badge-org { background: #E8EEFB; color: #2447A0; }
.doc-table { padding: 0; gap: 0; overflow: hidden; }
.doc-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-3); }
.doc-head { border-top: 0; background: var(--faint); font-size: 13px; font-weight: 600; color: var(--muted); padding-block: 10px; }
.doc-row a.doc-title { font-weight: 600; text-decoration: none; }
.doc-row a.doc-title:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.doc-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.doc-row.proof-row { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto; }
.doc-table .empty { padding: 24px 20px; color: var(--muted); font-size: 15px; }
.avatars { display: flex; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; border: 2px solid var(--surface); margin-left: -6px; }
.avatars .avatar-sm:first-child { margin-left: 0; }
.badge-status { background: var(--subtle); color: var(--ink-3); }
.badge-turn { background: var(--danger-bg); color: var(--danger); }
.badge-sent { background: #E8EEFB; color: #2447A0; }

/* ---- Documents: wizard ---- */
.wizard-notice:has(> [data-keys-missing][hidden] + [data-page-error][hidden]) { display: none; }
.wizard-notice { --gutter: 48px; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.wizard-main { --gutter: 48px; flex-grow: 1; padding-block: 28px 100px; display: flex; justify-content: center; }
.wizard-split { justify-content: flex-start; gap: 32px; }
.wizard-col { width: 720px; max-width: 100%; display: flex; flex-direction: column; gap: 20px; }
.wizard-col.wide { width: auto; flex-grow: 1; }
.wizard-col h1 { font-size: 30px; }
.wizard-aside { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.wizard-footer { position: sticky; bottom: 0; z-index: 5; height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border-top: 1px solid var(--line); padding-inline: max(48px, calc((100% - var(--container)) / 2 + 48px)); }
body.app:has(.wizard-footer) { display: flex; flex-direction: column; min-height: 100vh; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface); padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone.drag { border-color: var(--ink); background: var(--faint); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone-title { font-size: 17px; font-weight: 600; }
.file-card, .doc-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.file-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.segmented { display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 12px; background: var(--subtle); gap: 4px; }
.segmented button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; font: 500 14px var(--font); color: var(--ink-3); cursor: pointer; }
.segmented button:hover { background: var(--line); color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(35,33,33,.12); }
.list-card { padding: 0; gap: 0; overflow: hidden; }
.list-head { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--faint); }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-3); }
.person .stage { width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.person .avatar-sm { margin-left: 0; width: 36px; height: 36px; font-size: 13px; border: 0; }
.person-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.person .stage-icon { width: 26px; display: flex; justify-content: center; flex-shrink: 0; }
.person .grip { color: #282626; cursor: grab; display: flex; flex-shrink: 0; }
.person .grip-slot { width: 18px; flex-shrink: 0; }
.person .mv-slot { width: 72px; flex-shrink: 0; }
.person.dragging { opacity: .45; }
.person.drop-before { box-shadow: inset 0 3px 0 var(--ink); }
.person.drop-after { box-shadow: inset 0 -3px 0 var(--ink); }
.person .check { font-size: 13px; white-space: nowrap; }
.person .mv { display: flex; flex-shrink: 0; }
.person .mv .icon-btn { min-height: 36px; min-width: 36px; }
.icon-btn { min-height: 44px; min-width: 44px; padding: 0; }
.role-block.drop-target { outline: 2px dashed var(--ink); outline-offset: -2px; }
.block-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--faint); flex-wrap: wrap; }
.block-head h2 { font-size: 17px; margin: 0; }
.block-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.block-sub { padding: 0 16px; background: var(--faint); display: flex; flex-direction: column; gap: 10px; }
.block-sub:not(:empty) { padding-bottom: 12px; }
.block-sub .row { align-items: center; gap: 10px; }
.block-sub p { margin: 0; line-height: 1.45; }
.block-sub p:empty { display: none; }
.segmented button[aria-disabled="true"] { color: var(--line-2); text-decoration: line-through; cursor: not-allowed; }
.segmented button[aria-disabled="true"]:hover { background: transparent; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
.flow-steps li { display: flex; gap: 10px; }
.flow-steps .num { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--ink-3); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.flow-steps .num.note { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); box-sizing: border-box; }
.people-stack { display: flex; flex-direction: column; gap: 12px; }
.add-card { gap: 12px; }
.add-card h2 { font-size: 17px; margin: 0; }
.add-card p { margin: 0; }
.add-person { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.add-person .field { font-size: 13px; }
.list-card ol:empty { display: none; }
.access-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.access-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.access-list .strong { font-size: 14px; }
.access-list select.inp { width: 180px; }
.level-intro { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.security-card h2 { font-size: 19px; }
.security-card.warn { background: #FFFBF0; border-color: #EBD49A; }
.settings-card legend { font-size: 17px; margin-bottom: 4px; }
.settings-card { gap: 10px; }
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }

/* ---- Documents: field editor ---- */
.fields-main { flex-grow: 1; display: flex; min-height: 0; }
.fields-side { width: 280px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.side-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.signer-pick { display: flex; flex-direction: column; gap: 8px; }
.signer-pick button { min-height: 48px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 12px; display: flex; align-items: center; gap: 10px; font: 600 14px var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.signer-pick button:hover { border-color: var(--muted); }
.signer-pick button[aria-checked="true"] { border-width: 2px; padding: 0 11px; }
.signer-pick .swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.signer-pick .count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.palette button { height: 64px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font: 500 13px var(--font); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: grab; }
.palette button:hover { background: var(--subtle); border-color: var(--ink); }
.page-stage { flex-grow: 1; background: #E9E6E0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; overflow: auto; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(35,33,33,.12), 0 8px 24px rgba(35,33,33,.08); }
.page-wrap canvas { display: block; }
.field-layer { position: absolute; inset: 0; }
.field-box { position: absolute; border: 1.5px dashed currentColor; border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; font: 600 12px var(--font); cursor: move; user-select: none; overflow: hidden; }
.field-box:focus-visible, .field-box.selected { border-style: solid; border-width: 2px; outline: none; box-shadow: 0 0 0 3px var(--focus); }
.field-box .resize { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; background: #fff; border: 1.5px solid currentColor; border-radius: 2px; cursor: nwse-resize; }
.thumbs { width: 112px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--line); padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-y: auto; }
.thumbs button { border: 0; background: transparent; padding: 4px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 500 12px var(--font); color: var(--muted); cursor: pointer; }
.thumbs button:hover { background: var(--subtle); }
.thumbs button[aria-current="page"] { color: var(--ink); font-weight: 600; }
.thumbs button[aria-current="page"] canvas { outline: 2px solid var(--ink); }
.thumbs canvas { border: 1px solid var(--line); border-radius: 3px; background: #fff; }

/* ---- Documents: detail ---- */
.detail { display: flex; flex-direction: column; gap: 24px; }
.detail > .back-link { margin-bottom: -8px; }
.detail .page-head { align-items: flex-end; flex-wrap: wrap; row-gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail .page-head h1 { margin: 0; line-height: 1.15; }
.detail .page-head .badges { margin-top: 12px; }
.contacts-page .page-head { padding-bottom: 0; border-bottom: 0; }
.detail .notice-text { font-size: 14px; }
.detail > .status:empty { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.badges { gap: 8px; margin-top: 8px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.detail-grid .card h2 { font-size: 18px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.timeline { display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-3); }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; font-weight: 700; border: 2px solid var(--line-2); color: var(--muted); }
.timeline .dot.done { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.timeline .dot.turn { background: var(--ink); border-color: var(--ink); color: #fff; }
.timeline .who { font-weight: 600; }
.timeline .what { font-size: 14px; color: var(--muted); }
.timeline .what.quote { color: var(--ink-2); font-style: italic; }
.timeline li.group { flex-direction: column; gap: 0; padding: 0 0 14px; }
.timeline .group-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; }
.timeline .group ol { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.timeline .group ol li { border-top: 0; padding: 8px 0; }
.declined-card { border-color: var(--danger-line); gap: 8px; }
.declined-card h2 { font-size: 20px; margin: 0; }
.review-note { margin: 4px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--bg); font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.review-note:empty { display: none; }
.next-list { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.sign-footer .muted.row { align-items: center; gap: 8px; font-size: 14px; }
.facts { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.events { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.events time { display: block; font-size: 12px; color: var(--muted); }

/* ---- Administration ---- */
.admin { flex-grow: 1; display: flex; min-height: calc(100vh - 64px); max-width: var(--container); width: 100%; margin-inline: auto; }
.admin-nav { width: 250px; flex-shrink: 0; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.admin-nav-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 8px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; color: var(--ink-3); text-decoration: none; }
.admin-nav a:hover { background: var(--subtle); color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.admin-nav a[aria-current="page"] { background: var(--line); color: var(--ink); font-weight: 600; }
.admin-nav-note { margin-top: auto; padding: 12px; font-size: 13px; line-height: 1.45; color: var(--muted); display: flex; gap: 8px; }
.admin-main { flex-grow: 1; min-width: 0; padding: 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.admin-main h1 { font-size: 30px; }
.admin-main .card { align-items: flex-start; }
.admin-main > .page-head { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.admin-main .page-head .sub { display: block; margin: 6px 0 0; }
.admin-main h2 { margin: 0; font-size: 18px; }
.admin-nav a .grow { flex-grow: 1; }
.admin-nav a .badge { font-size: 11px; padding: 2px 6px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.admin-col, .admin-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.toolbar .inp { max-width: 320px; }
.table-card { padding: 0; overflow-x: auto; align-items: stretch !important; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.row.end { justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.nowrap { white-space: nowrap; }
.user-cell { display: flex; gap: 12px; align-items: center; }
.user-cell .avatar-sm, .table .avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.form-card { display: flex; flex-direction: column; gap: 14px; align-items: stretch !important; }
.form-card .row { align-items: center; }
.settings-form, .stack { display: flex; flex-direction: column; gap: 16px; }
/* Page with a side column (AdminSaml, SettingsApi) */
.aside-layout { display: flex; gap: 24px; align-items: flex-start; }
.aside-col { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.copy-field { display: flex; flex-direction: column; gap: 4px; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-value { flex-grow: 1; font-size: 12.5px; word-break: break-all; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
/* Settings · Integrationen (design: SettingsApi) */
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.table-head.flush { padding: 0; }
.table-head h2, .aside-col h2 { font-size: 15px; font-weight: 600; margin: 0; }
.table-card .table thead th { background: var(--bg); }
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.plain-fieldset legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.notice-secret { flex-direction: column; }
.notice-secret .notice-title { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.notice-secret .inp { font-size: 13px; }
.scope-list { display: flex; flex-wrap: wrap; gap: 4px; }
.link-danger { border: 0; background: transparent; padding: 0; font: inherit; font-size: 13px; color: var(--danger); text-decoration: underline; cursor: pointer; }
.key-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; font-weight: 600; }
.aside-col .security-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.small-terminal { font-size: 12px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.chip-x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 16px; cursor: pointer; }
.chip-x:hover { background: var(--line); }
.chip-input { width: 180px; height: 36px; }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.idp-card .stack-sm > .field { width: 100%; }
.form-card > .badge { align-self: flex-start; }
.idp-card textarea.inp { height: auto; padding: 10px 12px; font-size: 12.5px; }
.idp-card .row.end { border-top: 1px solid var(--line-3); padding-top: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack-sm p { margin: 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.split-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }
.mail-failures li { overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.renew { width: 100%; }
.renew > summary { list-style: none; display: inline-flex; }
.renew > summary::-webkit-details-marker { display: none; }
.renew[open] > summary { margin-bottom: 14px; }
textarea.inp.textarea { height: auto; padding: 10px 12px; font-size: 13px; resize: vertical; }
.sig-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.sig-slot { display: flex; flex-direction: column; gap: 6px; }
.sig-slot-box { position: relative; height: 130px; border: 1px solid var(--line); border-radius: 12px; background: var(--faint); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sig-slot-box img { max-width: 80%; max-height: 80px; }
.sig-slot-box.empty { border: 1.5px dashed var(--line-2); background: var(--surface); }
.sig-slot.confirming .sig-slot-box { opacity: .45; }
.sig-slot-actions { display: flex; gap: 2px; margin-left: -10px; }
.sig-slot-actions .danger { color: var(--danger); }
.sig-slot .sig-confirm { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #FFF7F3; border: 1px solid var(--danger-line); }
.sig-slot .sig-confirm > span:first-child { font-size: 13px; font-weight: 600; color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #FFFFFF; }
@media (max-width: 900px) { .sig-slots { grid-template-columns: 1fr; } }
.big-code { font-size: 26px; letter-spacing: .08em; text-align: center; padding: 16px; background: var(--faint); border-radius: 12px; }
/* Security code (design: Flow 14) */
.code-theirs { display: flex; flex-direction: column; gap: 6px; }
.code-mine { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.code-mine .mono { font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.code-dialog .notice { padding: 12px 14px; }
.own-code { padding: 0; }
.own-code summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.own-code summary::-webkit-details-marker { display: none; }
.own-code summary strong { color: var(--ink); }
.own-code-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.own-code-toggle .icon { transition: transform .15s; }
.own-code[open] .own-code-toggle .icon { transform: rotate(180deg); }
.own-code .when-open, .own-code[open] .when-closed { display: none; }
.own-code[open] .when-open { display: inline; }
.own-code-body { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); margin: 0 16px; padding: 12px 0 14px; }
.own-code-value { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.own-code-digits { font-size: 22px; letter-spacing: .06em; padding: 10px 16px; background: var(--bg); border-radius: 10px; }
.code-check { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--ok-line); margin-top: 6px; padding-top: 10px; }
.check-card.warn .code-check { border-color: var(--danger-line); }
.code-check .btn { align-self: flex-start; margin-top: 6px; }
@media (max-width: 560px) { .own-code summary { flex-wrap: wrap; } .code-mine { flex-direction: column; align-items: flex-start; } .code-mine .mono { white-space: normal; } }
.unlock-card { max-width: 520px; width: 100%; }
.danger-card { border-color: var(--danger-line); }
.unlock-card h2 { margin: 0; font-size: 20px; }

/* ---- Signing (SignDesktop, SignSignature) ---- */
body.focus { display: flex; flex-direction: column; min-height: 100vh; }
.sign { display: flex; flex-direction: column; flex-grow: 1; min-height: 100vh; }
.sign-bar { --focus: var(--accent); position: sticky; top: 0; z-index: 6; height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: var(--ink); color: #fff; }
.sign-bar-left, .sign-bar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sign-back { color: #fff; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0; }
.sign-back:hover { color: #fff; background: var(--ink-2); }
.sign-title { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 15px; }
.sign-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-sub { font-size: 13px; font-weight: 400; color: var(--line-2); }
.btn-dark { background: transparent; color: #fff; border-color: var(--muted); }
.btn-dark:hover { background: var(--ink-2); color: #fff; border-color: #fff; }
.sign-notices:has(> :not([hidden])) { padding-block: 16px 0; }
.sign-main { flex-grow: 1; display: flex; min-height: 0; }
.sign-pages { flex-grow: 1; min-width: 0; background: #E9E6E0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 16px 32px; }
.page-pill { font-size: 13px; color: var(--ink-3); background: var(--surface); padding: 4px 12px; border-radius: 999px; margin-top: 8px; }
.sign-page { position: relative; width: min(820px, 100%); background: #fff; box-shadow: 0 1px 3px rgba(35,33,33,.12), 0 8px 24px rgba(35,33,33,.08); }
.sign-page canvas { display: block; width: 100%; height: 100%; }
.sign-field { position: absolute; border: 1.5px dashed currentColor; border-radius: 4px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font: 600 12px var(--font); overflow: hidden; white-space: nowrap; background: transparent; }
.sign-field.other { opacity: .6; font-weight: 500; font-size: 11px; }
.sign-field.mine { border: 2px solid currentColor; cursor: pointer; }
.sign-field.mine:hover { box-shadow: 0 0 0 4px rgba(35,33,33,.12); }
.sign-field.mine.filled, .sign-field.mine.auto { border-style: dashed; border-width: 1.5px; background: transparent; }
.sign-field.auto { cursor: default; justify-content: flex-start; color: #1B1B1B !important; font: 400 12px var(--font-doc); }
.sign-field.input { font: 400 12px var(--font-doc); color: #1B1B1B !important; justify-content: flex-start; cursor: text; }
.sign-field.done { border: 0; padding: 0; }
.sign-value { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.sign-value img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sign-value.text { justify-content: flex-start; color: #1B1B1B; font: 400 12px var(--font-doc); }
.sign-field:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sign-side { width: 340px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--line); }
.sign-side-inner { position: sticky; top: 64px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.sign-me { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.avatar-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.strong { font-weight: 600; }
.side-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.my-fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.my-field { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 500 14px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.my-field:hover { background: var(--subtle); }
.my-field.done .my-field-label::before { content: "✓ "; color: var(--ok); }
.my-field.open { font-weight: 600; }
.message-card { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.message-card p { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.check-card { border: 1px solid var(--ok-line); background: var(--ok-soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.check-card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.check-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ok); }
.check-card.warn { border-color: var(--danger-line); background: var(--danger-bg); }
.check-card.warn .check-title { color: var(--danger); }
.code { font-size: 15px; letter-spacing: .04em; }
.side-note { display: flex; gap: 8px; margin: 0; line-height: 1.45; }
.sign-footer { position: sticky; bottom: 0; z-index: 5; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 32px; background: var(--surface); border-top: 1px solid var(--line); }
.sign-footer .row { align-items: center; }
.progress { width: 180px; height: 8px; border-radius: 999px; background: var(--subtle); overflow: hidden; }
.progress-bar { height: 8px; width: 0; background: var(--ink); transition: width .2s; }
.sign-done, .sign-gate { background: var(--bg); }
.sign-gate .confirm-card p { margin: 8px 0 0; }
.sign-gate .security-card p { margin: 0; font-size: 14px; line-height: 1.45; }
.cta-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cta-card h2 { margin: 0; font-size: 18px; }
.cta-card p { margin: 0 !important; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.sign-done .confirm-card p { margin: 8px 0 0; }
.final-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.final-box:not(:has(> :not([hidden]))) { display: none; }
.checklist .wait { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; }
.pad { width: min(560px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 20px; box-shadow: 0 24px 64px rgba(35,33,33,.3); color: var(--ink); }
.pad::backdrop { background: rgba(35,33,33,.5); }
.pad-form { display: flex; flex-direction: column; gap: 16px; }
.pad-head { display: flex; align-items: center; justify-content: space-between; }
.pad-head h2 { margin: 0; font-size: 22px; }
.btn-icon { width: 44px; padding: 0; }
.pad .segmented { align-self: stretch; }
.pad .segmented button { flex-grow: 1; height: 40px; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(35,33,33,.12); }
.pad-area { position: relative; height: 180px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--faint); }
.pad-area canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; left: 20px; right: 20px; bottom: 36px; border-top: 1px solid var(--line-2); pointer-events: none; }
.pad-clear { position: absolute; top: 6px; right: 6px; }
.pad-upload { display: flex; align-items: center; justify-content: center; cursor: pointer; text-align: center; padding: 16px; }
.pad-upload:hover, .pad-upload.drag { border-color: var(--ink); }
.pad-upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.pad-upload [data-pad-upload-empty] { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pad-upload img { max-width: 80%; max-height: 140px; }
.pad-tabs { display: flex; flex-direction: column; gap: 6px; }
.pad-saved { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.pad-saved legend { padding: 0; margin-bottom: 8px; }
.pad-saved .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.pad-cards { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sig-card { position: relative; }
.sig-card label, .sig-card .sig-confirm { position: relative; height: 104px; border: 1px solid var(--line); border-radius: 12px; background: var(--faint); display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; cursor: pointer; }
.sig-card label:has(input:checked) { border: 2px solid var(--ink); }
.sig-card label:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.sig-card input { position: absolute; left: 10px; top: 10px; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.sig-card img { max-width: 80%; max-height: 56px; }
.sig-card .sig-del { position: absolute; right: 4px; top: 4px; width: 32px; min-height: 32px; padding: 0; }
.sig-card .sig-confirm { flex-direction: column; gap: 8px; cursor: default; border-color: var(--danger-line); background: #FFF7F3; }
.sig-confirm > span:first-child { font-size: 13px; font-weight: 600; color: var(--danger); }
.sig-kind { position: absolute; left: 10px; bottom: 8px; padding: 1px 7px; border-radius: 999px; background: var(--subtle); color: var(--ink-3); font-size: 11px; font-weight: 600; }
.sig-last { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--muted); }
.pad-replace { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.pad-thumbs { display: flex; gap: 8px; padding-left: 30px; }
.pad-thumbs label { position: relative; flex: 1; height: 64px; border: 1px solid var(--line); border-radius: 10px; background: var(--faint); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; box-sizing: border-box; }
.pad-thumbs label:has(input:checked) { border: 2px solid var(--ink); }
.pad-thumbs input { position: absolute; left: 8px; top: 8px; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.pad-thumbs img { max-width: 70%; max-height: 40px; }
.pad-thumbs[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.pad-actions { display: flex; gap: 10px; justify-content: flex-end; }
.pad-actions [data-pad-submit]:only-child, .pad-actions [data-pad-cancel][hidden] + [data-pad-submit] { flex-grow: 1; }
.icon-line { display: flex; gap: 8px; margin: 0; line-height: 1.45; }
.icon-line svg { flex-shrink: 0; margin-top: 1px; }
@media (max-width: 560px) { .pad-cards { grid-template-columns: 1fr 1fr; } .pad-thumbs { padding-left: 0; } }
.pad .check { align-items: flex-start; line-height: 1.45; }
.pad .check input { margin-top: 1px; flex-shrink: 0; }

/* ---- Verification (VerifyFile, VerifyQR) ---- */
.verify { display: flex; flex-direction: column; gap: 24px; padding-block: 40px 64px; }
.verify-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.verify-head h1 { margin: 0; font-size: 40px; }
.verify-head .sub { margin: 0; color: var(--ink-2); font-size: 16px; }
.verify-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.verify-main { display: flex; flex-direction: column; gap: 16px; }
.verify-side { display: flex; flex-direction: column; gap: 16px; }
.verify-side .card { gap: 10px; align-items: flex-start; }
.verify-side h2 { margin: 0; font-size: 17px; }
.verify-side p { margin: 0; line-height: 1.45; }
.fingerprint { word-break: break-all; line-height: 1.5; }
.verify-result { padding: 24px; gap: 18px; }
.verify-status { display: flex; gap: 16px; align-items: flex-start; }
.verify-status .round-icon { font-size: 24px; font-weight: 700; }
.verify-status h2 { margin: 0; font-size: 24px; }
.verify-status p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.5; }
.verify-doc { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line-3); padding-top: 16px; }
.signers { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-3); padding-top: 16px; }
.signers h3 { margin: 0; font-size: 17px; }
.signer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.signer-list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-3); }
.signer-list li:first-child { border-top: 0; padding-top: 4px; }
.signed-at { text-align: right; flex-shrink: 0; }
.signer-list .avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ---- Accessibility preferences ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* Windows high contrast: keep buttons and the current page visible. */
@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
  .btn:disabled { border-color: GrayText; color: GrayText; }
  .app-nav a[aria-current="page"] { border-bottom-color: Highlight; }
  .sign-field.mine { border-color: ButtonText; }
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .legal-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap, .cta { --gutter: 48px; }
  .hero-art { display: none; }
  .security { flex-direction: column; gap: 40px; }
  .security-text { width: auto; }
  .setup-main { flex-direction: column; padding-block: 24px; --gutter: 32px; }
  .setup-aside, .setup-aside.slim, .kit-preview { width: 100%; max-width: 640px; }
  .flow-view { flex-direction: column; gap: 32px; }
}

@media (max-width: 1000px) {
  .auth-aside { display: none; }
  .auth-split { flex-direction: column; }
  .auth-split > .auth-mobile-head { display: flex; }
  .auth-split > .auth-mobile-foot { display: block; padding: 24px 16px 32px; }
  .auth-mobile-foot .auth-foot { color: var(--muted); }
  .auth-mobile-foot .auth-foot a:hover { color: var(--ink); }
  .auth-main { padding: 24px 16px 40px; align-items: flex-start; }
  .app-user, .app-nav { display: none; }
  .user-menu-nav { display: flex; }
  /* Full-width menu right below the bar */
  .app-bar { position: relative; }
  .user-menu { position: static; }
  .user-menu-panel { left: 0; right: 0; top: 100%; width: auto; border-radius: 0; border-width: 0 0 1px; padding: 8px 16px 16px; }
  .user-menu-nav a:first-child { border-top: 0; }
  .wizard-split, .detail-grid { display: flex; flex-direction: column; }
  .wizard-aside { width: 100%; }
  .fields-main, .admin { flex-direction: column; }
  .admin-nav { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav-note { margin-top: 8px; }
  .admin-main { padding: 20px 16px; }
  .fields-side { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .thumbs { width: 100%; flex-direction: row; overflow-x: auto; border-left: 0; border-top: 1px solid var(--line); padding: 8px 16px; }
  .stepper li:not(.current) .label { display: none; }
  .stepper .bar { width: 24px; }
}

@media (max-width: 760px) {
  .wrap { --gutter: 20px; }
  .site-header { height: 60px; --gutter: 16px; }
  .brand-name { font-size: 19px; }
  .site-nav, .site-actions > .btn-p, .hide-sm { display: none; }
  .only-sm { display: flex; }
  .site-actions { gap: 4px; align-items: center; }
  .site-actions > .btn-g { padding: 0 12px; }
  .menu { display: block; }
  .hero { padding-block: 36px 40px; }
  .hero-text { gap: 20px; }
  .hero h1 { font-size: 38px; line-height: 1.08; }
  .hero .lead { font-size: 17px; }
  .hero .row .btn { width: 100%; }
  .hero .note { text-align: center; }
  .section { padding-block: 36px; gap: 20px; }
  .section h2 { font-size: 28px; }
  .security { padding-block: 40px; gap: 16px; }
  .security-cards { grid-template-columns: 1fr; gap: 16px; }
  .sec-card { border-radius: 14px; padding: 18px; gap: 8px; }
  .sec-card p { font-size: 15px; line-height: 1.5; }
  .steps-sm { display: flex; flex-direction: column; gap: 18px; }
  .steps-sm li { display: flex; gap: 14px; }
  .steps-sm .num { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; flex-shrink: 0; }
  .steps-sm strong { font-size: 16px; }
  .steps-sm p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-top: 2px; }
  .cta-sm { padding: 36px 20px; flex-direction: column; gap: 12px; }
  .cta-sm .btn { width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; font-size: 13px; padding: 20px; gap: 8px; }
  .site-footer nav { gap: 16px; }
  .site-footer .brand-line .logo { display: none; }
  .plain { padding-block: 40px; }
  .plain h1 { font-size: 30px; }

  .app-header { --gutter: 16px; }
  .app-header .meta { display: none; }
  .stepper .label, .stepper .bar { display: none; }
  .setup-main { padding-block: 20px; --gutter: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .setup-footer { --gutter: 16px; }
  .confirm-card, .verify-card { padding: 20px; }
  .flow-header { padding: 0 16px; }
  .flow-col h1, .flow-view h1 { font-size: 28px; }
  .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-tiles { grid-template-columns: 1fr; }
  .aside-layout { flex-direction: column; align-items: stretch; }
  .aside-col { width: 100%; }
  .check-grid { grid-template-columns: 1fr; }
  .api-table td:first-child { white-space: normal; }
  .app-main { --gutter: 16px; padding-block: 24px; }
  .app-bar { padding-inline: 16px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .wizard-main, .wizard-notice { --gutter: 16px; padding-block: 20px 100px; }
  .wizard-footer { padding-inline: 16px; }
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .doc-row > :nth-child(2), .doc-row > :nth-child(4), .doc-head { display: none; }
  .doc-row.proof-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .split { flex-direction: column; align-items: stretch; }
  .sign-main { flex-direction: column; }
  .sign-side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .sign-side-inner { position: static; max-height: none; padding: 16px; }
  .sign-bar { padding: 0 8px 0 4px; }
  .sign-bar .logo, .sign-bar [data-badge] { display: none; }
  .guest .sign-bar { padding-left: 16px; }
  .guest .sign-bar .logo { display: block; flex-shrink: 0; }
  .sign-footer { padding: 12px 16px; }
  .sign-footer .row:last-child { width: 100%; }
  .sign-footer .row:last-child .btn { flex-grow: 1; }
  .sign-done, .sign-gate { padding: 24px 16px; }
  .verify { --gutter: 16px; padding-block: 24px 48px; }
  .verify-grid { grid-template-columns: 1fr; }
  .admin { flex-direction: column; min-height: 0; }
  .admin-nav { width: auto; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav-label, .admin-nav-note { display: none; }
  .admin-main { padding: 20px 16px; }
  .admin-grid, .choices { grid-template-columns: 1fr; }
  .verify-head h1 { font-size: 30px; }
  .sign-gate .confirm-card { padding: 24px; }
  .sign-done .confirm-card { padding: 24px; }
  .sign-done .row .btn { width: 100%; }
}
/* Login in two steps: the address, then password or company login */
.login-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.auth-form .stack { gap: 14px; }
/* Registration: company login offered for the address's domain */
.company-offer { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--surface); }
.company-offer p { margin: 0; }
/* Templates (M13) */
.template-dialog, .decline-dialog { width: min(640px, calc(100% - 32px)); }
.template-roles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; width: 100%; }
.template-roles li { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line-3); }
.template-roles .stage { align-self: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.template-roles .was { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
.template-roles li > .stage { grid-row: span 2; }
@media (max-width: 640px) { .template-roles li { grid-template-columns: 28px minmax(0, 1fr); } .template-roles li > .field:last-child { grid-column: 2; } }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > span { position: absolute; left: 12px; color: var(--muted); display: flex; }
.search-field .inp { width: 280px; padding-left: 36px; }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-tools .search-field:only-child { margin-left: auto; }
.template-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.template-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; display: flex; gap: 16px; align-items: center; }
.template-thumb { width: 64px; height: 84px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 4px; padding: 8px; box-sizing: border-box; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.template-thumb .line { height: 4px; background: var(--line); border-radius: 2px; }
.template-thumb .boxes { margin-top: auto; display: flex; gap: 3px; }
.template-thumb .boxes span { height: 12px; flex-grow: 1; border: 1.5px dashed currentColor; border-radius: 3px; }
.template-item h2 { margin: 0; font-size: 17px; font-weight: 600; font-family: inherit; letter-spacing: 0; }
.template-roles-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.role-dot { display: inline-flex; align-items: center; gap: 6px; }
.role-dot::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.role-dot span { color: var(--ink-2); }
.template-menu { position: relative; }
.template-menu > summary { list-style: none; }
.template-menu > summary::-webkit-details-marker { display: none; }
.template-menu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(35,33,33,.15); padding: 6px; display: flex; flex-direction: column; }
.template-menu-panel button { justify-content: flex-start; }
.plain-bullets { margin: 0; padding-left: 18px; line-height: 1.6; }
@media (max-width: 720px) {
  .template-item { flex-wrap: wrap; }
  .template-thumb { display: none; }
  .search-field, .search-field .inp { width: 100%; }
  .page-head { flex-wrap: wrap; }
}
.stack-xs { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.use-roles-card { padding: 4px 18px; }
.use-roles { list-style: none; margin: 0; padding: 0; }
.use-roles > li { display: grid; grid-template-columns: 28px 150px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-3); }
.use-roles > li:first-child { border-top: 0; }
.use-roles .stage { width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.use-person { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }
.use-person .field { font-size: 12px; }
.use-fixed { display: flex; align-items: center; gap: 10px; min-height: 44px; flex-wrap: wrap; }
.template-summary { flex-direction: row !important; align-items: center; gap: 14px; }
.template-summary .template-thumb { width: 56px; height: 74px; }
.small-h { font-size: 15px; margin: 0; }
.kv { margin: 0; display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 720px) {
  .use-roles > li { grid-template-columns: 28px minmax(0, 1fr); }
  .use-roles > li > :last-child { grid-column: 1 / -1; }
  .use-person { grid-template-columns: 1fr; }
}
.template-summary .line:nth-child(1) { width: 90%; }
.template-summary .line:nth-child(2) { width: 72%; }
.template-summary .line:nth-child(3) { width: 84%; }
/* Privacy policy: readable long text */
.legal-text > * { width: 100%; max-width: 760px; }
.legal-text section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.legal-text h2 { font-size: 24px; margin: 12px 0 0; }
.legal-text p, .legal-text li { font-size: 16px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.legal-text ul { margin: 0; padding-left: 20px; }
.legal-text li + li { margin-top: 6px; }
/* Text button inside running text (e.g. opt-out of the page view counter) */
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }
.legal-toc { flex-direction: row !important; flex-wrap: wrap; gap: 6px 18px !important; font-size: 14px; font-weight: 600; }
/* Registration "coming soon": the form is shown, but greyed out */
.register-fields { display: flex; flex-direction: column; gap: inherit; }
.register-fields:disabled { opacity: .5; }
.register-fields:disabled * { cursor: not-allowed; }
.toggle-row.is-disabled { opacity: .5; cursor: not-allowed; }

/* Legal footer fixed at the bottom on desktop (app and short legal pages),
   content scrolls behind it. In the app it lines up with the app bar; wizard
   and signing pages keep their own action bar instead. */
body.app > .site-footer, body.fixed-footer > .site-footer { background: var(--bg); }
body.app:has(.wizard-footer, .sign-footer) > .site-footer { display: none; }
@media (min-width: 761px) {
  body.app:has(> .site-footer):not(:has(.wizard-footer, .sign-footer)), body.fixed-footer { --footer-h: 79px; padding-bottom: var(--footer-h); }
  body.app > .site-footer, body.fixed-footer > .site-footer { position: fixed; inset: auto 0 0; z-index: 4; height: var(--footer-h, 79px); box-sizing: border-box; padding-block: 0; }
  body.app > .site-footer { --gutter: 32px; }
  body.app .admin { min-height: calc(100vh - 64px - var(--footer-h, 0px)); }
}
