*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #0A0A0A;
  --ink-soft:   #1A1A1A;
  --ink-mid:    #2C2C2C;
  --slate:      #4A4A4A;
  --slate-lt:   #6B6B6B;
  --rule:       #E2DDD5;
  --paper:      #F8F5EF;
  --paper-warm: #F0EBE1;
  --leather:    #8B7355;
  --leather-lt: #A08B6A;
  --leather-dk: #6B5840;
  --red:        #8B2020;
  --green:      #1E5C3A;
  --amber:      #7A5C1E;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ── SCREENS ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
#screen-login, #screen-setup {
  align-items: stretch;
  background: var(--ink);
}
/* Setup wizard: wider form column, progress list in the left panel */
.login-right.wide { width: 560px; overflow-y: auto; }
.setup-steps { list-style: none; margin-top: 28px; padding: 0; }
.setup-steps li {
  font-size: 13px; color: var(--slate-lt); padding: 7px 0 7px 26px; position: relative;
}
.setup-steps li::before {
  content: ''; position: absolute; left: 4px; top: 12px; width: 8px; height: 8px;
  border-radius: 50%; border: 1px solid #444;
}
.setup-steps li.active { color: var(--paper); }
.setup-steps li.active::before { background: var(--leather); border-color: var(--leather); }
.setup-steps li.done { color: #6B8F71; }
.setup-steps li.done::before { background: #3E6B47; border-color: #3E6B47; }
.secret-box {
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; letter-spacing: 0.04em;
  color: var(--leather-lt); background: var(--ink-soft); border: 1px solid #2A2A2A;
  padding: 14px; word-break: break-all; text-align: center; margin-bottom: 12px;
}
.dark-note { font-size: 12px; color: var(--slate-lt); line-height: 1.6; margin-bottom: 18px; }
.dark-note code { font-family: 'IBM Plex Mono', monospace; color: var(--paper); font-size: 11px; }
.check-line {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12px;
  color: var(--slate-lt); margin-bottom: 18px; cursor: pointer;
}
.check-line input { margin-top: 2px; accent-color: var(--leather); }
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-right: 1px solid #1E1E1E;
  background: var(--ink-soft);
}
.login-left-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--paper);
}
.login-left-logo span { color: var(--leather); }
.login-left-body {
  max-width: 420px;
}
.login-left-body h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--paper);
  margin-bottom: 20px;
}
.login-left-body h1 em {
  font-style: italic;
  color: var(--leather-lt);
}
.login-left-body p {
  font-size: 14px;
  color: var(--slate-lt);
  line-height: 1.7;
  max-width: 340px;
}
.login-left-footer {
  font-size: 11px;
  color: #333;
  letter-spacing: 0.04em;
}
.login-right {
  width: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  background: var(--ink);
}
.login-right h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--paper);
  margin-bottom: 8px;
}
.login-right .sub {
  font-size: 12px;
  color: var(--slate-lt);
  margin-bottom: 36px;
  letter-spacing: 0.02em;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-lt);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--ink-soft);
  border: 1px solid #2A2A2A;
  border-bottom: 1px solid #3A3A3A;
  color: var(--paper);
  padding: 11px 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--leather);
}
.field input[type="radio"], .field input[type="checkbox"] {
  width: auto;
  padding: 0;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--leather);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select option { background: var(--ink-soft); }
.field-hint { font-size: 11px; color: var(--slate-lt); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--leather);
  color: var(--paper);
  width: 100%;
}
.btn-primary:hover { background: var(--leather-lt); }
.btn-outline {
  /* Fixed contrast bug: this was color: var(--paper) (near-white),
     but every real usage of this class sits on a light paper
     background (topbar, vault detail header) — the text was
     rendering nearly invisible, distinguishable only by the border.
     Confirmed via browser screenshot during testing. */
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--slate-lt);
}
.btn-outline:hover { border-color: var(--leather); color: var(--leather-dk); background: rgba(139,115,85,0.06); }
.btn-ghost {
  background: transparent;
  color: var(--slate-lt);
  padding: 8px 12px;
  font-size: 12px;
}
.btn-ghost:hover { color: var(--paper); }
.btn-paper {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-paper:hover { background: var(--paper-warm); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(139,32,32,0.3);
}
.btn-danger:hover { background: rgba(139,32,32,0.08); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ══════════════════════════════════════
   APP SHELL — split layout
   Left: dark ink   Right: warm paper
══════════════════════════════════════ */
#screen-app {
  flex-direction: row;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--ink-soft);
  border-right: 1px solid #1E1E1E;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px 22px;
  border-bottom: 1px solid #1E1E1E;
}
.sidebar-logo .mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: 0.02em;
}
.sidebar-logo .mark span { color: var(--leather); }
.sidebar-logo .org {
  font-size: 10px;
  color: #444;
  margin-top: 5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-group-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #333;
  padding: 10px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 20px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}
.nav-item:hover { color: var(--paper); background: rgba(255,255,255,0.03); }
.nav-item.active { color: var(--paper); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--leather);
}
.nav-item .ico { font-size: 14px; width: 16px; text-align: center; opacity: 0.7; }
.nav-item.active .ico { opacity: 1; }
.nav-pill {
  margin-left: auto;
  background: var(--leather-dk);
  color: var(--paper-warm);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}
.sidebar-foot {
  border-top: 1px solid #1E1E1E;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px; height: 28px;
  background: var(--leather-dk);
  color: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}
.user-name { font-size: 12px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: #444; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── MAIN ── */
.main {
  margin-left: 200px;
  flex: 1;
  min-width: 0;  /* a wide table scrolls in its box, not the whole page */
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--rule);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.content { padding: 32px; flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* ── STATS ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule);
  margin-bottom: 28px;
}
.stat {
  padding: 22px 24px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: none; }
.stat-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-lt);
  margin-bottom: 6px;
}
.stat-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.stat-val.accent { color: var(--leather); }
.stat-val.amber { color: var(--amber); }
.stat-sub { font-size: 11px; color: var(--slate-lt); margin-top: 4px; }

/* ── TABLE ── */
.tbl-wrap {
  border: 1px solid var(--rule);
  background: white;
  margin-bottom: 24px;
  overflow-x: auto;
}
.tbl-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
}
.tbl-head h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
table { width: 100%; border-collapse: collapse; background: white; }
thead th {
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-lt);
  padding: 10px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
tbody tr {
  border-bottom: 1px solid #F5F0E8;
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--paper); }
tbody td { padding: 13px 20px; font-size: 13px; color: var(--ink); }
tbody td.muted { color: var(--slate-lt); font-size: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
}
.badge-sealed { color: var(--leather-dk); background: rgba(139,115,85,0.1); border: 1px solid rgba(139,115,85,0.2); }
.badge-pending { color: var(--amber); background: rgba(122,92,30,0.08); border: 1px solid rgba(122,92,30,0.2); }
.badge-active { color: var(--green); background: rgba(30,92,58,0.08); border: 1px solid rgba(30,92,58,0.2); }
.badge-draft { color: var(--slate); background: rgba(74,74,74,0.08); border: 1px solid rgba(74,74,74,0.15); }
.badge-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  color: var(--leather-dk);
  background: rgba(139,115,85,0.1);
  border: 1px solid rgba(139,115,85,0.2);
}

/* ── VAULT DETAIL ── */
.vd-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.vd-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-lt);
  margin-bottom: 8px;
}
.vd-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
}
.vd-meta {
  margin-top: 10px;
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--slate-lt);
}
.vd-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

/* ── PANELS ── */
.panel { border: 1px solid var(--rule); background: white; margin-bottom: 20px; }
.panel:last-child { margin-bottom: 0; }
.panel-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-lt);
}
.panel-body { padding: 18px; }

/* ── WAX SEAL — the signature element ── */
.seal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
}
.wax-seal {
  width: 120px; height: 120px;
  position: relative;
  margin-bottom: 14px;
}
.wax-base {
  width: 120px; height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, #6B4F30 0%, #3D2810 45%, #2A1A08 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.5),
    0 4px 8px rgba(0,0,0,0.4),
    inset 0 1px 2px rgba(255,255,255,0.08),
    inset 0 -2px 6px rgba(0,0,0,0.6);
}
/* Radial engraving lines */
.wax-base::before {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
  top: 10px; left: 10px;
}
.wax-base::after {
  content: '';
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
  top: 20px; left: 20px;
}
.wax-inner {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 26px;
  position: relative;
  z-index: 1;
}
.seal-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leather);
  text-align: center;
}
.seal-sub {
  font-size: 11px;
  color: var(--slate-lt);
  text-align: center;
  margin-top: 4px;
  line-height: 1.5;
}
.fingerprint-box {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  width: 100%;
}
.fp-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-lt);
  margin-bottom: 4px;
}
.fp-hash {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--slate);
  word-break: break-all;
  line-height: 1.5;
}
.fp-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--green);
  font-weight: 500;
}

/* ── DOCUMENT ROW ── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--paper-warm);
}
.doc-row:last-child { border-bottom: none; }
.doc-icon {
  width: 34px; height: 40px;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.doc-name { font-size: 13px; color: var(--ink); }
.doc-meta { font-size: 11px; color: var(--slate-lt); margin-top: 2px; }
.doc-seal { font-size: 13px; color: var(--leather); }

/* ── KEYHOLDER ROW ── */
.kh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--paper-warm);
}
.kh-row:last-child { border-bottom: none; }
.kh-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  flex-shrink: 0;
}
.kh-av.ok { background: rgba(30,92,58,0.1); color: var(--green); border: 1px solid rgba(30,92,58,0.2); }
.kh-av.wait { background: rgba(122,92,30,0.08); color: var(--amber); border: 1px solid rgba(122,92,30,0.2); }
.kh-name { font-size: 13px; color: var(--ink); }
.kh-email { font-size: 11px; color: var(--slate-lt); }
.kh-st { font-size: 11px; font-weight: 500; }
.kh-st.ok { color: var(--green); }
.kh-st.wait { color: var(--amber); }

/* ── AUDIT ROW ── */
.audit-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--paper-warm);
  font-size: 12px;
}
.audit-row:last-child { border-bottom: none; }
.audit-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--leather); margin-top: 6px; flex-shrink: 0; }
.audit-dot.dim { background: var(--rule); }
.audit-txt { flex: 1; color: var(--slate); }
.audit-txt strong { color: var(--ink); }
.audit-time { color: var(--slate-lt); font-size: 11px; white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }

/* ── STEP FLOW ── */
.steps {
  display: flex;
  margin-bottom: 28px;
  border: 1px solid var(--rule);
}
.step {
  flex: 1;
  padding: 12px 16px;
  background: white;
  border-right: 1px solid var(--rule);
  position: relative;
}
.step:last-child { border-right: none; }
.step.active { background: var(--paper); }
.step.done { background: rgba(30,92,58,0.04); }
.step-n { font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-lt); }
.step.active .step-n { color: var(--leather); }
.step.done .step-n { color: var(--green); }
.step-l { font-size: 12px; font-weight: 500; color: var(--ink); margin-top: 2px; }

/* ── QUORUM NODES ── */
.quorum-wrap { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.q-node {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1.5px solid;
}
.q-node.ok { border-color: var(--green); background: rgba(30,92,58,0.06); color: var(--green); }
.q-node.wait { border-color: var(--rule); background: white; color: var(--slate-lt); }

/* ── MODAL ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.overlay.on { display: flex; }
.modal {
  background: white;
  width: 500px;
  max-width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
  color: var(--ink);
}
.modal-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
}
.modal-head .x {
  background: none; border: none; cursor: pointer;
  color: var(--slate-lt); font-size: 18px; line-height: 1;
}
.modal-head .x:hover { color: var(--ink); }
.modal-body { padding: 22px 28px; }
.modal-body .field input,
.modal-body .field select,
.modal-body .field textarea,
.panel-body .field input,
.panel-body .field select,
.panel-body .field textarea {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom: 1px solid #C8C3B8;
  color: var(--ink);
}
.modal-body .field input:focus,
.modal-body .field select:focus,
.modal-body .field textarea:focus,
.panel-body .field input:focus,
.panel-body .field select:focus,
.panel-body .field textarea:focus {
  border-color: var(--leather);
}
.modal-body .field label, .panel-body .field label { color: var(--slate); }
.modal-body .field select option, .panel-body .field select option { background: white; }
.modal-foot {
  padding: 14px 28px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 1px dashed #C8C3B8;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--paper);
}
.upload-zone:hover { border-color: var(--leather); background: rgba(139,115,85,0.04); }
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: var(--slate-lt); }
.upload-zone strong { color: var(--leather); }

/* ── INFO BOX ── */
.info-box {
  padding: 12px 16px;
  border-left: 3px solid var(--leather);
  background: rgba(139,115,85,0.06);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 18px;
}
.info-box strong { color: var(--ink); display: block; margin-bottom: 3px; font-size: 13px; }
.warn-box {
  padding: 12px 16px;
  border-left: 3px solid var(--amber);
  background: rgba(122,92,30,0.06);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 18px;
}
.warn-box strong { color: var(--ink); display: block; margin-bottom: 3px; }
.ok-box {
  padding: 12px 16px;
  border-left: 3px solid var(--green);
  background: rgba(30,92,58,0.05);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 18px;
}
.ok-box strong { color: var(--ink); display: block; margin-bottom: 3px; }

/* ── DIVIDER ── */
.rule { height: 1px; background: var(--rule); margin: 20px 0; }

/* ── DELIVERY ── */
.delivery-wrap {
  border: 1px solid rgba(30,92,58,0.3);
  background: rgba(30,92,58,0.04);
  padding: 28px;
  text-align: center;
}
.delivery-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 6px;
}
.countdown {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 40px;
  font-weight: 500;
  color: var(--leather);
  margin: 10px 0;
}
.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: white;
  border: 1px solid var(--rule);
  margin-bottom: 8px;
}
.dl-row:last-child { margin-bottom: 0; }

/* ── KEYHOLDER ACCEPT SCREEN ── */
#screen-accept {
  background: var(--paper);
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.accept-wrap {
  width: 500px;
  max-width: 96vw;
}
.accept-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 32px;
}
.accept-logo span { color: var(--leather); }
.accept-card {
  background: white;
  border: 1px solid var(--rule);
  padding: 36px;
}
.accept-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 6px;
}
.accept-card .sub { font-size: 13px; color: var(--slate-lt); margin-bottom: 24px; }
.accept-card .field input {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom: 1px solid #C8C3B8;
  color: var(--ink);
}
.accept-card .field label { color: var(--slate); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--paper);
  border-left: 3px solid var(--leather);
  padding: 13px 18px;
  font-size: 13px;
  z-index: 9999;
  display: none;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.toast.on { display: block; animation: tIn 0.2s ease; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes tIn { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── POLICY VIEW ── */
.policy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--paper-warm);
}
.policy-row:last-child { border-bottom: none; }
.policy-label { font-size: 13px; color: var(--ink); }
.policy-sub { font-size: 11px; color: var(--slate-lt); margin-top: 2px; }
.policy-val { font-size: 13px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.dot-warn { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* ── VERSION HISTORY ── */
.ver-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--paper-warm);
}
.ver-row:last-child { border-bottom: none; }
.ver-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--slate);
  flex-shrink: 0;
}
.ver-badge.current { background: var(--leather); color: white; border-color: var(--leather); }
.ver-name { font-size: 13px; color: var(--ink); flex: 1; }
.ver-meta { font-size: 11px; color: var(--slate-lt); }
.ver-hash {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--slate-lt);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── MISC ── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.between { justify-content: space-between; align-items: center; }
.center { align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }
.muted { color: var(--slate-lt); }
.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Cormorant Garamond', serif; }
/* A radio button or checkbox with its explanation (the credential pages) */
.choice, .field label.choice {
  display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; cursor: pointer;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); line-height: 1.5;
}
.choice input { width: auto; margin-top: 3px; accent-color: var(--leather); flex: none; }
/* A secret's value, shown once */
.secret-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all;
  background: var(--paper); border: 1px solid var(--rule); padding: 14px; margin: 10px 0; max-height: 260px; overflow: auto;
}
