/* ============================================================================
   VAULTAGE — UI system
   Implements Vaultage Brand Book v1.0 (Dinnox IT Solutions, July 2026)
   §11 color · §13–14 typography · §17 layout · §18 components · §27 motion
   ============================================================================ */

/* ---------- §13 Typography: self-hosted WOFF2, no CDN requests ---------- */
@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/eb-garamond-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/eb-garamond-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Mono';
  src: url('/fonts/noto-sans-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- §28 Design tokens ---------- */
:root {
  /* §11 Private Ledger palette */
  --vault-ink: #071714;            /* primary background */
  --vault-ledger: #0E2520;         /* surface / navigation */
  --vault-ledger-raised: #14322B;  /* cards / rows */
  --vault-brass: #B28A4A;          /* primary action / rules */
  --vault-brass-light: #D2B77A;    /* highlights / focus */
  --vault-bond: #F3EEDF;           /* primary text */
  --vault-parchment: #D9D1BD;      /* secondary text */
  --vault-slate: #9AA39E;          /* muted text / metadata */
  --vault-success: #58A184;        /* success / verified */
  --vault-error: #C46C64;          /* error / revoke */
  --vault-warning: #D1A557;        /* warning / expiry */

  --vault-rule: #1C3B33;           /* hairline dividers */
  --vault-rule-strong: #27524A;

  /* §13 type families */
  --font-display: 'EB Garamond', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-credential: 'Noto Sans Mono', Consolas, ui-monospace, monospace;

  /* §17 spacing scale — 8px base grid */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* §17 corner radius */
  --r-control: 6px;
  --r-card: 10px;
  --r-panel: 18px;

  /* §27 motion */
  --motion-copy: 140ms;
  --motion-standard: 240ms;
  --motion-seal: 360ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --touch: 44px; /* §15 minimum target */
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--vault-ink);
  color: var(--vault-bond);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 22px;
  /* §16 ornament: guilloché watermark — structural, quiet */
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(178, 138, 74, 0.07), transparent 70%),
    repeating-radial-gradient(circle at 22% 28%, transparent 0 38px, rgba(178, 138, 74, 0.018) 38px 39px),
    repeating-radial-gradient(circle at 78% 72%, transparent 0 38px, rgba(178, 138, 74, 0.018) 38px 39px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- utilities ----------
   The production CSP is `style-src 'self'` (no 'unsafe-inline'), so inline
   style attributes are refused by the browser. Everything is a class. */
.center { text-align: center; }
.m-0 { margin: 0; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.signet-lg { width: 56px; height: 56px; }
.signet-md { width: 48px; height: 48px; }
.label-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.row-static { cursor: default; }
.is-strong { color: var(--vault-success); }
.is-fair { color: var(--vault-warning); }
.is-weak { color: var(--vault-error); }

/* ---------- §14 type scale ---------- */
.t-display-1 { font-family: var(--font-display); font-weight: 700; font-size: 42px; line-height: 46px; margin: 0; }
.t-display-2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 36px; margin: 0; }
.t-heading   { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 28px; margin: 0; }
.t-title     { font-family: var(--font-body); font-weight: 600; font-size: 18px; line-height: 24px; margin: 0; }
.t-body      { font-size: 15px; line-height: 22px; margin: 0; }
.t-label {
  font-family: var(--font-body); font-weight: 600; font-size: 12px; line-height: 16px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--vault-slate);
}
.t-muted { color: var(--vault-slate); font-size: 13px; line-height: 20px; }
.t-secondary { color: var(--vault-parchment); }

/* §28 credential values ALWAYS monospace */
.credential-value {
  font-family: var(--font-credential);
  font-size: 15px;
  line-height: 22px;
  color: var(--vault-bond);
  word-break: break-all;
}

/* ---------- §16 ornament: seal & eyebrow ---------- */
.signet { display: block; margin: 0 auto var(--s-4); color: var(--vault-brass); }
.signet svg { display: block; width: 100%; height: 100%; }

.eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: 12px; line-height: 16px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--vault-brass);
  text-align: center; margin-bottom: var(--s-2);
}

/* double-rule divider */
.rule-double {
  border: 0; height: 3px; margin: var(--s-5) 0;
  border-top: 1px solid var(--vault-rule-strong);
  border-bottom: 1px solid var(--vault-rule);
  background: none;
}

/* ---------- auth layout ---------- */
.auth-view {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--s-5);
}

.panel {
  position: relative;
  width: 100%; max-width: 468px;
  background: var(--vault-ledger);
  border: 1px solid var(--vault-rule-strong);
  border-radius: var(--r-panel);
  padding: var(--s-6);
  animation: settle var(--motion-standard) var(--ease) both;
}
/* §16 corner ornaments — quiet brass brackets */
.panel::before, .panel::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 1px solid var(--vault-brass); opacity: 0.5; pointer-events: none;
}
.panel::before { top: 10px; left: 10px; border-width: 1px 0 0 1px; border-radius: 8px 0 0 0; }
.panel::after { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; border-radius: 0 0 8px 0; }

.panel-head { text-align: center; margin-bottom: var(--s-5); }
.panel-head .t-body { color: var(--vault-parchment); margin-top: var(--s-3); }

/* ---------- §27 motion ---------- */
@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- forms ---------- */
.field { margin-bottom: var(--s-4); }
.field > .t-label { display: block; margin-bottom: var(--s-2); }

input[type="text"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  min-height: var(--touch);
  padding: var(--s-3);
  background: var(--vault-ink);
  color: var(--vault-bond);
  border: 1px solid var(--vault-rule-strong);
  border-radius: var(--r-control);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 22px;
  transition: border-color var(--motion-standard) var(--ease), box-shadow var(--motion-standard) var(--ease);
}
/* credential inputs use the monospace token */
input.mono, textarea.mono { font-family: var(--font-credential); }
textarea { min-height: 88px; resize: vertical; }

::placeholder { color: var(--vault-slate); opacity: 1; }

input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, [tabindex]:focus-visible {
  outline: none;
  border-color: var(--vault-brass-light);
  box-shadow: 0 0 0 3px rgba(210, 183, 122, 0.28);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23B28A4A' stroke-width='1.75' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s-3) center;
  padding-right: var(--s-6);
}

/* Qualified with `input` so it outranks the `input[type="…"]` base rule —
   §28 requires credential values (including one-time codes) in monospace. */
input.code-input {
  font-family: var(--font-credential);
  font-size: 28px; line-height: 36px; text-align: center;
  letter-spacing: 0.4em; padding-left: 0.4em;
  color: var(--vault-brass-light);
  min-height: 60px;
}

/* checkbox — the setup ceremony confirmation */
.check {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3); margin: var(--s-4) 0;
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-card);
  background: var(--vault-ledger-raised);
  cursor: pointer;
}
.check input {
  appearance: none; margin: 0; padding: 0;
  flex: 0 0 22px; width: 22px; height: 22px; min-height: 22px;
  border: 1.75px solid var(--vault-brass); border-radius: var(--r-control);
  background: transparent; cursor: pointer; position: relative;
}
.check input:checked { background: var(--vault-brass); }
.check input:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 8px; height: 13px;
  border: solid var(--vault-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check span { font-size: 14px; line-height: 20px; color: var(--vault-parchment); }

/* ---------- §18 buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--touch); padding: 0 var(--s-4);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-control);
  background: var(--vault-ledger-raised); color: var(--vault-bond);
  font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 20px;
  cursor: pointer;
  transition: background var(--motion-standard) var(--ease),
              border-color var(--motion-standard) var(--ease),
              color var(--motion-standard) var(--ease);
}
.btn:hover { border-color: var(--vault-brass); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: 0 0 20px; }

/* §12 rule: Vault Ink on brass only for labels ≥14px semibold */
.btn-primary {
  background: var(--vault-brass); border-color: var(--vault-brass);
  color: var(--vault-ink);
}
.btn-primary:hover { background: var(--vault-brass-light); border-color: var(--vault-brass-light); }

.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(196, 108, 100, 0.5); color: var(--vault-error); }
.btn-danger:hover { background: var(--vault-error); border-color: var(--vault-error); color: var(--vault-ink); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--vault-slate); font-weight: 400; }
.btn-quiet:hover { color: var(--vault-bond); }

.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 15px; }
.btn-icon { width: var(--touch); padding: 0; }

.btn-row { display: flex; gap: var(--s-2); align-items: center; }
.btn-row-end { display: flex; gap: var(--s-2); align-items: center; justify-content: flex-end; margin-top: var(--s-5); }

/* copy confirmation (§27 — 140ms) */
.btn.is-copied {
  background: var(--vault-success); border-color: var(--vault-success); color: var(--vault-ink);
  transition-duration: var(--motion-copy);
}

/* ---------- trust cue microcopy (§08) ---------- */
.trust-cue {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  margin-top: var(--s-4); color: var(--vault-slate);
  font-size: 12px; line-height: 16px; letter-spacing: 0.04em;
}
.trust-cue svg { width: 14px; height: 14px; color: var(--vault-brass); flex: 0 0 14px; }

/* ---------- §26 states ---------- */
.msg {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4); margin-top: var(--s-4);
  border-radius: var(--r-card); border: 1px solid;
  animation: fade var(--motion-standard) var(--ease) both;
}
.msg svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.msg-state { font-weight: 600; font-size: 14px; line-height: 20px; margin: 0; }
.msg-next { font-size: 13px; line-height: 19px; margin: var(--s-1) 0 0; color: var(--vault-parchment); }
/* §12 rule: wax red is never the sole indicator — icon + explicit copy always */
.msg-error { border-color: rgba(196, 108, 100, 0.45); background: rgba(196, 108, 100, 0.1); color: var(--vault-error); }
.msg-warning { border-color: rgba(209, 165, 87, 0.45); background: rgba(209, 165, 87, 0.1); color: var(--vault-warning); }
.msg-success { border-color: rgba(88, 161, 132, 0.45); background: rgba(88, 161, 132, 0.1); color: var(--vault-success); }
.msg-info { border-color: var(--vault-rule-strong); background: var(--vault-ledger-raised); color: var(--vault-parchment); }

/* strength readout */
.strength { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.strength-track { flex: 1; height: 4px; border-radius: 2px; background: var(--vault-rule); overflow: hidden; }
.strength-fill { height: 100%; width: 0; background: var(--vault-error);
  transition: width var(--motion-standard) var(--ease), background var(--motion-standard) var(--ease); }
.strength-text { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--vault-slate); white-space: nowrap; }
.strength[data-score="3"] .strength-fill { background: var(--vault-warning); }
.strength[data-score="4"] .strength-fill,
.strength[data-score="5"] .strength-fill { background: var(--vault-success); }
.strength[data-score="4"] .strength-text,
.strength[data-score="5"] .strength-text { color: var(--vault-success); }

/* labelled divider */
.or {
  display: flex; align-items: center; gap: var(--s-3); margin: var(--s-5) 0;
  color: var(--vault-slate); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--vault-rule-strong); }

/* ============================================================================
   VAULT SHELL (§21)
   ============================================================================ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  background: var(--vault-ledger);
  border-bottom: 1px solid var(--vault-rule-strong);
}
.brand { display: flex; align-items: center; gap: var(--s-2); flex: 0 0 auto; }
.brand svg { width: 28px; height: 28px; color: var(--vault-brass); }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; }

.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-wrap svg {
  position: absolute; left: var(--s-3); top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--vault-slate); pointer-events: none;
}
.search-wrap input { padding-left: 44px; }

.topbar-actions { display: flex; gap: var(--s-2); margin-left: auto; align-items: center; }

.shell { display: flex; flex: 1; align-items: flex-start; }

.sidenav {
  flex: 0 0 216px;
  padding: var(--s-5) var(--s-3);
  border-right: 1px solid var(--vault-rule);
  position: sticky; top: 69px;
}
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%; min-height: var(--touch); padding: 0 var(--s-3);
  margin-bottom: var(--s-1);
  border: 1px solid transparent; border-radius: var(--r-control);
  background: transparent; color: var(--vault-parchment);
  font-family: var(--font-body); font-size: 14px; font-weight: 600; text-align: left;
  cursor: pointer;
  transition: background var(--motion-standard) var(--ease), color var(--motion-standard) var(--ease);
}
.nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--vault-slate); }
.nav-item:hover { background: var(--vault-ledger); color: var(--vault-bond); }
.nav-item[aria-current="true"] {
  background: var(--vault-ledger-raised); color: var(--vault-bond);
  border-color: var(--vault-rule-strong);
}
.nav-item[aria-current="true"] svg { color: var(--vault-brass); }
.nav-count { margin-left: auto; font-family: var(--font-credential); font-size: 12px; color: var(--vault-slate); }

.content { flex: 1; min-width: 0; padding: var(--s-5); max-width: 920px; }
.content-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }

/* ---------- §18 credential rows ---------- */
.rows { border-top: 1px solid var(--vault-rule); }

.row {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3);
  border-bottom: 1px solid var(--vault-rule);
  border-left: 2px solid transparent;
  transition: background var(--motion-standard) var(--ease), border-left-color var(--motion-standard) var(--ease);
  animation: fade var(--motion-standard) var(--ease) both;
}
.row:hover { background: var(--vault-ledger); border-left-color: var(--vault-brass); }

.row-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  background: none; border: 0; padding: var(--s-1) 0;
  text-align: left; cursor: pointer; color: inherit; font: inherit;
}
.row-title { display: flex; align-items: center; gap: var(--s-2); }
.row-title .t-title { color: var(--vault-bond); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub {
  font-family: var(--font-credential); font-size: 13px; line-height: 19px; color: var(--vault-slate);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  padding: 2px var(--s-2); border-radius: 999px;
  border: 1px solid var(--vault-rule-strong);
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--vault-slate);
}
.badge-brass { border-color: rgba(178, 138, 74, 0.5); color: var(--vault-brass-light); }
.badge-success { border-color: rgba(88, 161, 132, 0.5); color: var(--vault-success); }
.badge-warning { border-color: rgba(209, 165, 87, 0.5); color: var(--vault-warning); }

/* §15 actions stay visible — no hover-only controls */
.row-actions { display: flex; gap: var(--s-2); flex: 0 0 auto; }

.star { color: var(--vault-slate); }
.star[aria-pressed="true"] { color: var(--vault-warning); }

.vault-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  flex-wrap: wrap; margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px solid var(--vault-rule);
}
.lock-timer {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--vault-slate);
}
.lock-timer svg { width: 16px; height: 16px; color: var(--vault-brass); }
.lock-timer b { font-family: var(--font-credential); font-weight: 400; color: var(--vault-parchment); letter-spacing: 0; }

/* ---------- §26 empty state ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-4); animation: fade var(--motion-standard) both; }
.empty .signet { width: 56px; height: 56px; opacity: 0.6; }
.empty .t-heading { margin-bottom: var(--s-2); }

/* ============================================================================
   MODALS (§27 — fade + 8px settle, 240ms, no overshoot)
   ============================================================================ */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  background: rgba(4, 12, 10, 0.72);
  animation: fade var(--motion-standard) var(--ease) both;
}
.modal-card {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--vault-ledger);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-panel);
  padding: var(--s-6);
  animation: settle var(--motion-standard) var(--ease) both;
}
.modal-card.wide { max-width: 620px; }
.modal-head { margin-bottom: var(--s-5); }
.modal-head .t-heading { margin-bottom: var(--s-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

.input-group { display: flex; gap: var(--s-2); align-items: stretch; }
.input-group input { flex: 1; }

/* ---------- §22 generator ---------- */
.generator {
  margin: var(--s-4) 0; padding: var(--s-4);
  background: var(--vault-ledger-raised);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-card);
}
.gen-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.gen-value {
  padding: var(--s-3); margin-bottom: var(--s-3);
  background: var(--vault-ink); border: 1px solid var(--vault-rule); border-radius: var(--r-control);
  min-height: var(--touch); display: flex; align-items: center;
}
.gen-controls { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.gen-len { display: flex; align-items: center; gap: var(--s-2); flex: 1; min-width: 190px; }
.gen-len input[type="range"] { flex: 1; accent-color: var(--vault-brass); min-height: 0; padding: 0; }
.gen-len output { font-family: var(--font-credential); font-size: 13px; color: var(--vault-bond); min-width: 2ch; }

.chip {
  min-height: 36px; padding: 0 var(--s-3);
  border: 1px solid var(--vault-rule-strong); border-radius: 999px;
  background: transparent; color: var(--vault-slate);
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  transition: background var(--motion-standard) var(--ease),
              color var(--motion-standard) var(--ease),
              border-color var(--motion-standard) var(--ease);
}
.chip:hover { border-color: var(--vault-brass); color: var(--vault-parchment); }
.chip[aria-pressed="true"] {
  background: var(--vault-brass); border-color: var(--vault-brass); color: var(--vault-ink);
}
.chip-group { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; min-height: var(--touch); }

/* ---------- §23 share result / §16 state stamp ---------- */
.seal-result { text-align: center; }
.seal-stamp {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-3); padding: var(--s-2) var(--s-4);
  border: 1px solid var(--vault-success); border-radius: 999px;
  color: var(--vault-success); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.seal-stamp svg { width: 18px; height: 18px; }
.seal-stamp svg * { stroke-dasharray: 260; animation: draw var(--motion-seal) var(--ease) both; }

.link-box {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3); margin: var(--s-4) 0;
  background: var(--vault-ink); border: 1px solid var(--vault-rule-strong); border-radius: var(--r-control);
}
.link-box .credential-value { flex: 1; text-align: left; font-size: 14px; }

/* ---------- §25 settings ---------- */
.set-group { margin-bottom: var(--s-5); }
.set-group > .t-label { display: block; margin-bottom: var(--s-2); }
.set-row {
  display: flex; align-items: center; gap: var(--s-4);
  min-height: 64px; padding: var(--s-3) var(--s-4);
  background: var(--vault-ledger-raised);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-card);
  margin-bottom: var(--s-2);
}
.set-row-main { flex: 1; min-width: 0; }
.set-row-main .t-title { font-size: 15px; }
.set-row-val { font-size: 13px; color: var(--vault-slate); margin-top: 2px; }
.set-detail {
  padding: var(--s-4); margin: 0 0 var(--s-2);
  background: var(--vault-ink);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-card);
  animation: settle var(--motion-standard) var(--ease) both;
}
.qr-frame {
  display: block; margin: var(--s-4) auto; padding: var(--s-2);
  background: var(--vault-bond); border-radius: var(--r-control);
}
.list-row {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--touch); padding: var(--s-2) 0;
  border-bottom: 1px solid var(--vault-rule);
  font-size: 13px;
}
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-sub { font-family: var(--font-credential); font-size: 12px; color: var(--vault-slate); }

/* ---------- bulk import review ---------- */
.import-summary {
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3);
  border: 1px solid var(--vault-rule-strong); border-radius: var(--r-card);
  background: var(--vault-ledger-raised); font-size: 14px; line-height: 20px;
}
.import-summary b { color: var(--vault-brass-light); font-weight: 600; }

.import-toolbar {
  display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap;
  margin-bottom: var(--s-2);
}
.import-toolbar .btn { margin-top: 0; min-height: 36px; font-size: 12px; }

.import-rows {
  max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--vault-rule); border-radius: var(--r-card);
}
.import-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 1fr;
  gap: var(--s-2);
  padding: var(--s-3);
  border-bottom: 1px solid var(--vault-rule);
  align-items: start;
}
.import-row:last-child { border-bottom: 0; }
.import-row.is-flagged { background: rgba(209, 165, 87, 0.07); border-left: 2px solid var(--vault-warning); }
.import-row.is-skipped { opacity: 0.45; }
.import-row input[type="checkbox"] {
  appearance: none; margin: 6px 0 0; width: 20px; height: 20px; min-height: 20px; padding: 0;
  border: 1.75px solid var(--vault-brass); border-radius: var(--r-control);
  background: transparent; cursor: pointer; position: relative;
}
.import-row input[type="checkbox"]:checked { background: var(--vault-brass); }
.import-row input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 7px; height: 12px;
  border: solid var(--vault-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.import-row input[type="text"], .import-row input[type="password"] {
  min-height: 36px; padding: var(--s-2); font-size: 13px; margin-top: 0;
}
.import-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.import-field .t-label { font-size: 10px; letter-spacing: 0.1em; }
.import-warn {
  grid-column: 2 / -1;
  font-size: 12px; line-height: 17px; color: var(--vault-warning);
  display: flex; gap: var(--s-2); align-items: flex-start;
}
.import-warn svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; }
.import-notes {
  grid-column: 2 / -1;
  font-family: var(--font-credential); font-size: 11px; line-height: 16px;
  color: var(--vault-slate); white-space: pre-wrap; word-break: break-word;
  max-height: 4.6em; overflow-y: auto;
}
.import-progress {
  margin-top: var(--s-3); height: 4px; border-radius: 2px;
  background: var(--vault-rule); overflow: hidden;
}
.import-progress > div {
  height: 100%; width: 0; background: var(--vault-brass);
  transition: width var(--motion-standard) var(--ease);
}

@media (max-width: 720px) {
  .import-row { grid-template-columns: 28px 1fr; }
}

/* ---------- §24 recipient view ---------- */
.recipient-fields { margin: var(--s-5) 0; }
.rf {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-4) 0; border-bottom: 1px solid var(--vault-rule);
}
.rf:last-child { border-bottom: 0; }
.rf-main { flex: 1; min-width: 140px; }
.rf-main .t-label { display: block; margin-bottom: var(--s-1); }
.rf-main .credential-value, .rf-main .t-title, .rf-main .t-body { display: block; }
.credential-center { display: block; text-align: center; font-size: 13px; }

.burn-badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-3); border-radius: 999px;
  border: 1px solid rgba(209, 165, 87, 0.5); color: var(--vault-warning);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.burn-badge svg { width: 14px; height: 14px; }

.shared-by { text-align: center; color: var(--vault-parchment); margin-top: var(--s-2); }
.shared-by b { font-weight: 600; color: var(--vault-bond); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  background: var(--vault-ledger-raised);
  border: 1px solid var(--vault-success); border-radius: 999px;
  color: var(--vault-success); font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: settle var(--motion-copy) var(--ease) both;
}
.toast svg { width: 18px; height: 18px; }
.toast.is-error { border-color: var(--vault-error); color: var(--vault-error); }

.brand-foot {
  margin-top: var(--s-5); text-align: center;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vault-slate);
}

/* ============================================================================
   §29 QA — responsive (1280px desktop / 390px mobile)
   ============================================================================ */
@media (max-width: 860px) {
  .sidenav {
    position: static; flex: none; width: 100%;
    border-right: 0; border-bottom: 1px solid var(--vault-rule);
    padding: var(--s-3) var(--s-4);
    display: flex; gap: var(--s-2); overflow-x: auto;
  }
  .nav-item { width: auto; flex: 0 0 auto; margin: 0; white-space: nowrap; }
  .nav-count { margin-left: var(--s-2); }
  .shell { flex-direction: column; }
  .content { padding: var(--s-4); width: 100%; }
}

@media (max-width: 620px) {
  .t-display-1 { font-size: 32px; line-height: 36px; }
  .t-display-2 { font-size: 26px; line-height: 32px; }
  .topbar { flex-wrap: wrap; padding: var(--s-3) var(--s-4); gap: var(--s-3); }
  .search-wrap { order: 3; max-width: none; flex: 1 0 100%; }
  .brand-word { font-size: 18px; }
  .panel, .modal-card { padding: var(--s-5) var(--s-4); border-radius: var(--r-card); }
  .grid-2 { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; gap: var(--s-2); }
  .row-actions { width: 100%; }
  .row-actions .btn { flex: 1; }
  .btn-row-end { flex-wrap: wrap; }
  .btn-row-end .btn { flex: 1 0 auto; }
  .modal { padding: 0; align-items: stretch; }
  .modal-card { max-height: 100vh; border-radius: 0; border: 0; }
}
