/* ==========================================================================
   THE VAULT — design system
   Ported verbatim from legacy-vault-poc.html, plus rules for the pieces the
   POC did not have: the account field, save status, and passphrase meter.
   ========================================================================== */

:root{
  --ink:#14181C;
  --panel:#1B2127;
  --panel-2:#20272E;
  --line: rgba(237,231,218,0.10);
  --line-strong: rgba(237,231,218,0.20);
  --brass:#B08D57;
  --brass-bright:#CBA46B;
  --ivory:#EDE7DA;
  --ivory-dim: rgba(237,231,218,0.58);
  --ivory-faint: rgba(237,231,218,0.34);
  --teal:#4A7C6D;
  --rust:#A6483C;
  --radius: 3px;
  --btn-primary-bg: var(--brass);
  --btn-primary-bg-hover: var(--brass-bright);
  --btn-primary-text: #181205;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px;
}
html[data-theme="light"]{
  --ink:#EDEAE1;
  --panel:#FFFFFF;
  --panel-2:#F7F5EF;
  --line: rgba(20,24,28,0.10);
  --line-strong: rgba(20,24,28,0.18);
  --brass:#8C6A3D;
  --brass-bright:#6E5330;
  --ivory:#1B1F24;
  --ivory-dim: rgba(27,31,36,0.62);
  --ivory-faint: rgba(27,31,36,0.40);
  --teal:#2F5347;
  --rust:#8C3226;
  --btn-primary-bg: #1B1F24;
  --btn-primary-bg-hover: #33383F;
  --btn-primary-text: #F2EFE6;
}
html, body{ transition: background-color .2s ease; }
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--ink);
  color:var(--ivory);
  font-family:'IBM Plex Sans', 'Noto Sans Devanagari', sans-serif;
  min-height:100vh;
  position:relative;
  overflow-x:hidden;
}
body::before{
  content:"";
  position:fixed; inset:0;
  background:
    radial-gradient(ellipse 1200px 800px at 50% -10%, rgba(176,141,87,0.08), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
  pointer-events:none;
  z-index:0;
}
h1,h2,h3,.serif{ font-family:'Newsreader', 'Noto Serif Devanagari', serif; font-weight:500; letter-spacing:0.2px;}
.mono{ font-family:'IBM Plex Mono', monospace; }
button{ font-family:inherit; cursor:pointer; }
input, textarea{ font-family:inherit; }

/* ---------- LOCK SCREEN ---------- */
#lockScreen{
  min-height:100vh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  position:relative; z-index:1;
  padding:40px 20px;
}
.brand-mark{
  display:flex; align-items:center; gap:10px;
  color:var(--ivory-dim);
  font-size:12px; letter-spacing:3px; text-transform:uppercase;
  margin-bottom:36px;
}
.brand-mark .rule{ width:28px; height:1px; background:var(--brass); }

.dial-wrap{ position:relative; width:220px; height:220px; margin-bottom:38px; }
svg#dial{ width:100%; height:100%; transition: transform 1.1s cubic-bezier(.2,.9,.2,1.1); transform-origin:50% 50%; }
svg#dial.spin{ transform: rotate(320deg); }
.dial-center-label{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  flex-direction:column;
  pointer-events:none;
}
.dial-center-label .status{ font-size:10px; letter-spacing:2px; color:var(--ivory-faint); text-transform:uppercase; margin-top:4px;}
.dial-center-label .icon{ color:var(--brass); }

.lock-title{ font-size:28px; margin:0 0 10px; text-align:center; max-width:400px; line-height:1.25; }
.lock-eyebrow{ font-size:12px; letter-spacing:1.6px; text-transform:uppercase; color:var(--brass-bright); text-align:center; margin:0 0 8px; }
.lock-sub{ color:var(--ivory-dim); font-size:14.5px; text-align:center; max-width:380px; line-height:1.55; margin-bottom:30px;}

.trust-chip-row{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:22px; max-width:420px; }
.trust-chip{
  display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ivory-dim);
  border:1px solid var(--line-strong); border-radius:20px; padding:6px 12px; background:var(--panel);
}
.trust-chip svg{ color:var(--teal); flex-shrink:0; }

.lock-form{ width:100%; max-width:360px; display:flex; flex-direction:column; gap:14px; }

.consent-row{ display:flex; align-items:flex-start; gap:9px; font-size:12.5px; line-height:1.5; color:var(--ivory-dim); cursor:pointer; margin-top:-2px; }
.consent-row input{ accent-color:var(--brass); margin:2px 0 0; cursor:pointer; flex-shrink:0; }
.terms-inline-link{ color:var(--brass-bright); text-decoration:underline; }
.field-label{ font-size:11px; letter-spacing:1.6px; text-transform:uppercase; color:var(--ivory-faint); margin-bottom:7px; display:block;}
.field-hint{ font-size:11.5px; color:var(--ivory-faint); line-height:1.5; margin-top:6px; }
.field{ margin-bottom:2px; }
input[type=password], input[type=text], input[type=date], input[type=email]{
  width:100%; background:var(--panel); border:1px solid var(--line-strong); color:var(--ivory);
  padding:13px 14px; border-radius:var(--radius); font-size:14.5px; outline:none;
  transition:border-color .15s;
}
input[type=password]:focus, input[type=text]:focus, input[type=date]:focus, input[type=email]:focus{ border-color:var(--brass); }
input[type=date]{ color-scheme:dark; }
select{
  width:100%; background:var(--panel); border:1px solid var(--line-strong); color:var(--ivory);
  padding:13px 14px; border-radius:var(--radius); font-size:14.5px; outline:none;
  transition:border-color .15s; font-family:inherit;
}
select:focus{ border-color:var(--brass); }
.btn-primary{
  background:var(--btn-primary-bg); color:var(--btn-primary-text); border:none; padding:13px 18px; border-radius:var(--radius);
  font-size:14px; font-weight:600; letter-spacing:0.4px; margin-top:6px;
  transition: background .15s, transform .1s;
}
.btn-primary:hover{ background:var(--btn-primary-bg-hover); }
.btn-primary:active{ transform: scale(0.98); }
.btn-primary:disabled{ opacity:0.5; cursor:not-allowed; }
.btn-ghost{
  background:transparent; border:1px solid var(--line-strong); color:var(--ivory-dim);
  padding:11px 16px; border-radius:var(--radius); font-size:13.5px;
}
.btn-ghost:hover{ border-color:var(--brass); color:var(--ivory); }
.btn-ghost:disabled{ opacity:0.45; cursor:not-allowed; }
.btn-danger{ color:var(--rust); border-color:rgba(166,72,60,0.4); }
.btn-danger:hover{ border-color:var(--rust); color:var(--rust); background:rgba(166,72,60,0.08); }
button.btn-danger.btn-primary{
  background:var(--rust); color:#F2EFE6; border:none;
}
button.btn-danger.btn-primary:hover{ background:#8C3226; }
.tab-btn{
  background:transparent; border:1px solid var(--line-strong); color:var(--ivory-dim);
  padding:9px 16px; border-radius:var(--radius); font-size:13.5px; cursor:pointer;
}
.tab-btn:hover{ border-color:var(--brass); color:var(--ivory); }
.tab-btn.active{ border-color:var(--brass); color:var(--brass-bright); background:rgba(176,141,87,0.10); }
.tab-badge{
  display:inline-block; margin-left:7px; min-width:16px; padding:0 5px; border-radius:8px;
  background:var(--btn-primary-bg); color:var(--btn-primary-text); font-size:10.5px; line-height:16px; text-align:center; font-weight:600;
}
.toggle-mode{ text-align:center; margin-top:22px; font-size:13px; color:var(--ivory-faint); }
.toggle-mode a{ color:var(--brass); text-decoration:none; cursor:pointer; border-bottom:1px solid rgba(176,141,87,0.4); }
.lock-error{ color:var(--rust); font-size:13px; text-align:center; min-height:18px; }
.lock-note{ display:flex; gap:9px; align-items:flex-start; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; font-size:12.5px; color:var(--ivory-dim); line-height:1.5; margin-top:8px;}
.lock-note svg{ flex-shrink:0; margin-top:2px; }

.lock-banner{
  margin:0 auto 4px; padding:11px 16px; border-radius:var(--radius); font-size:13px; line-height:1.5; text-align:center;
}
.lock-banner.is-success{ background:rgba(74,124,109,0.12); border:1px solid rgba(74,124,109,0.35); color:var(--teal); }
.lock-banner.is-error{ background:rgba(166,72,60,0.10); border:1px solid rgba(166,72,60,0.35); color:var(--rust); }

/* ---------- APP SHELL ---------- */
#app{ display:none; position:relative; z-index:1; min-height:100vh; }
.app-shell{ max-width:1040px; margin:0 auto; padding:var(--sp-6) var(--sp-6) 60px; }

.topbar{ display:flex; align-items:center; justify-content:space-between; gap:var(--sp-4); padding-bottom:var(--sp-4); border-bottom:1px solid var(--line); margin-bottom:var(--sp-4); }
.topbar-brand{ font-size:19px; display:flex; align-items:center; gap:9px; }
.topbar-right{ display:flex; align-items:center; gap:10px; flex-shrink:0; }

.util-row{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:var(--sp-6); }
.util-chip{
  display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ivory-dim);
  background:var(--panel); border:1px solid var(--line-strong); border-radius:20px;
  padding:8px 14px 8px 12px; cursor:pointer; transition:border-color .15s, color .15s, background-color .15s;
  font-family:inherit;
}
.util-chip svg{ color:var(--brass-bright); flex-shrink:0; }
.util-chip:hover, .util-chip:focus-visible{ border-color:var(--brass); color:var(--ivory); }
.util-chip.danger{ color:var(--rust); }
.util-chip.danger svg{ color:var(--rust); }
.util-chip.danger:hover{ border-color:var(--rust); background:rgba(166,72,60,0.08); }
.util-chip .who{ font-family:'IBM Plex Mono',monospace; color:var(--brass-bright); max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.records-sub{ font-size:11.5px; color:var(--ivory-faint); margin:0 0 var(--sp-5); letter-spacing:0.3px; }

.cat-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:var(--sp-3); }
.cat-card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); cursor:pointer;
  padding:var(--sp-4) var(--sp-3); display:flex; flex-direction:column; gap:var(--sp-2); align-items:flex-start;
  transition:border-color .15s, transform .1s; text-align:left; font-family:inherit; color:inherit;
}
.cat-card:hover, .cat-card:focus-visible{ border-color:var(--brass); }
.cat-card:active{ transform:scale(0.98); }
.cat-card svg{ color:var(--brass-bright); }
.cat-name{ font-size:13px; font-weight:600; line-height:1.3; }
.cat-count{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ivory-faint); font-variant-numeric:tabular-nums; }

.activation-banner{
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  margin:0 0 var(--sp-4); background:rgba(176,141,87,0.12); border:1px solid rgba(176,141,87,0.35);
  border-radius:var(--radius); padding:12px 16px; font-size:13px; color:var(--brass-bright); line-height:1.5;
}
.activation-banner button{ flex-shrink:0; }

.feedback-toast{
  position:fixed; right:20px; bottom:20px; z-index:40; width:264px;
  background:var(--panel); border:1px solid var(--line-strong); border-radius:6px;
  padding:16px 18px 18px; box-shadow:0 8px 28px rgba(0,0,0,0.28);
  animation:feedback-toast-in 0.28s ease-out;
}
@media (prefers-reduced-motion: reduce){ .feedback-toast{ animation:none; } }
@keyframes feedback-toast-in{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }
.feedback-toast-dismiss{
  position:absolute; top:8px; right:8px; width:22px; height:22px; line-height:20px; text-align:center;
  background:none; border:none; color:var(--ivory-faint); font-size:16px; cursor:pointer; border-radius:4px;
}
.feedback-toast-dismiss:hover{ color:var(--ivory); background:var(--panel-2); }
.feedback-toast-title{ font-size:13.5px; font-weight:600; color:var(--ivory); padding-right:20px; }
.feedback-toast-subtitle{ font-size:11.5px; color:var(--ivory-dim); margin-top:3px; margin-bottom:14px; }
.feedback-toast-faces{ display:flex; justify-content:space-between; gap:8px; }
.feedback-face{
  flex:1; display:flex; align-items:center; justify-content:center; padding:8px 0;
  background:var(--panel-2); border:1px solid var(--line); border-radius:5px; color:var(--ivory-dim); cursor:pointer;
  transition:transform 0.12s, color 0.12s, border-color 0.12s;
}
.feedback-face:hover{ transform:translateY(-2px); border-color:var(--line-strong); }
.feedback-face[data-rating="happy"]:hover{ color:var(--teal); }
.feedback-face[data-rating="neutral"]:hover{ color:var(--brass-bright); }
.feedback-face[data-rating="unhappy"]:hover{ color:var(--rust); }
.feedback-toast-thanks{ font-size:13px; color:var(--ivory-dim); text-align:center; padding:6px 0 2px; }
@media (max-width:520px){ .feedback-toast{ left:16px; right:16px; width:auto; bottom:16px; } }

.trust-strip{
  margin-top:var(--sp-5); display:flex; align-items:center; gap:9px; font-size:12.5px; color:#8DBBAA;
  background:rgba(74,124,109,0.10); border:1px solid rgba(74,124,109,0.30); border-radius:var(--radius);
  padding:12px 14px; line-height:1.5;
}
.trust-strip svg{ flex-shrink:0; }

.back-link{
  display:inline-flex; align-items:center; gap:6px; background:none; border:none; color:var(--ivory-dim);
  font-size:13px; font-family:inherit; cursor:pointer; padding:6px 2px; margin-bottom:var(--sp-4);
  transition:color .15s;
}
.back-link:hover{ color:var(--brass-bright); }

.main-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px; gap:20px;}
.main-head h1{ font-size:24px; margin:0 0 6px;}
.main-head .desc{ color:var(--ivory-dim); font-size:14px; max-width:560px; line-height:1.55; }
.add-btn{ white-space:nowrap; }

@media (max-width: 900px){ .cat-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width: 560px){ .cat-grid{ grid-template-columns:repeat(2,1fr); } .app-shell{ padding:var(--sp-4) var(--sp-4) 50px; } }

.entry-list{ margin-top:28px; display:flex; flex-direction:column; gap:12px; }
.entry-card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px;
}
.entry-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.entry-title{ font-size:16px; font-family:'Newsreader',serif; }
.entry-kv{ display:grid; grid-template-columns:150px 1fr; gap:6px 14px; margin-top:12px; }
.entry-kv .k{ font-size:11.5px; color:var(--ivory-faint); text-transform:uppercase; letter-spacing:0.7px; padding-top:1px;}
.entry-kv .v{ font-size:13.5px; color:var(--ivory); font-family:'IBM Plex Mono',monospace; word-break:break-word; }
.entry-notes{ margin-top:12px; font-size:13px; color:var(--ivory-dim); line-height:1.5; border-top:1px solid var(--line); padding-top:10px;}
.entry-actions{ display:flex; gap:8px; }
.icon-btn{
  background:transparent; border:1px solid var(--line-strong); color:var(--ivory-faint); width:30px; height:30px; border-radius:2px;
  display:flex; align-items:center; justify-content:center;
}
.icon-btn:hover{ border-color:var(--rust); color:var(--rust); }

.empty-state{
  margin-top:40px; padding:44px 30px; text-align:center; border:1px dashed var(--line-strong); border-radius:var(--radius);
}
.empty-state .serif{ font-size:18px; margin-bottom:8px; }
.empty-state p{ color:var(--ivory-dim); font-size:13.5px; max-width:380px; margin:0 auto 18px; line-height:1.55;}

/* modal */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,12,14,0.72); z-index:50; display:none;
  align-items:flex-start; justify-content:center; padding:60px 20px; overflow-y:auto;
}
.modal-overlay.show{ display:flex; }
.modal{
  background:var(--panel-2); border:1px solid var(--line-strong); border-radius:4px; width:100%; max-width:560px; padding:30px 32px 28px;
}
.modal h2{ font-size:20px; margin:0 0 4px; }
.modal .modal-sub{ font-size:13px; color:var(--ivory-faint); margin-bottom:22px; }
.dyn-field-row{ margin-bottom:10px; }
.dyn-field-inputs{ display:flex; gap:10px; align-items:center; }
.dyn-field-inputs input{ flex:1; }
.dyn-field-inputs input.label-in{ max-width:170px; }
.remove-row{ background:none; border:none; color:var(--ivory-faint); font-size:18px; cursor:pointer; flex-shrink:0; width:22px;}
.remove-row:hover{ color:var(--rust); }

.legacy-contact-row{ border:1px solid var(--line); border-radius:var(--radius); padding:12px; margin-bottom:10px; }
.legacy-contact-head{ display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.legacy-contact-head input.legacy-name-in{ flex:2; min-width:0; }
.legacy-contact-head select.legacy-relation-in{ flex:1; min-width:0; }
.legacy-contact-head .remove-row{ margin-left:auto; }
.legacy-contact-body{ display:flex; gap:8px; flex-wrap:wrap; }
.legacy-contact-body input{ flex:1; min-width:150px; }

.share-row{ border:1px solid var(--line); border-radius:var(--radius); padding:12px; margin-bottom:8px; }
.share-row .share-value{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--ivory-dim); word-break:break-all; margin-bottom:8px; }
.share-row .share-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.share-row .share-actions select{ flex:1; min-width:160px; }
.share-row .share-status{ font-size:12px; color:var(--ivory-faint); margin-top:6px; }
.share-row .share-status.is-ok{ color:#4A7C6D; }
.share-row .share-status.is-err{ color:var(--rust); }

.consent-tag{
  display:inline-block; font-size:10.5px; font-weight:600; letter-spacing:0.4px; text-transform:uppercase;
  padding:2px 7px; border-radius:3px; margin-left:6px; vertical-align:middle;
}
.consent-tag.is-pending{ background:rgba(176,141,87,0.15); color:var(--brass-bright); }
.consent-tag.is-confirmed{ background:rgba(74,124,109,0.15); color:#4A7C6D; }

.trusted-for-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  border:1px solid var(--line); border-radius:var(--radius); padding:11px 14px; margin-bottom:8px;
}
.trusted-for-row .owner-name{ font-size:13.5px; }
.trusted-for-row .opt-out-status{ font-size:12px; color:var(--ivory-faint); margin-top:4px; }
.trusted-for-row .opt-out-status.is-ok{ color:#4A7C6D; }
.trusted-for-row .opt-out-status.is-err{ color:var(--rust); }
.date-warning{ display:none; color:var(--rust); font-size:12px; margin-top:6px; padding-left:2px; }
.date-warning.show{ display:block; }
.add-field-actions{ display:flex; flex-wrap:wrap; gap:2px 6px; margin-top:2px; }
.add-field-link{
  display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:400;
  color:var(--brass); background:none; border:none; border-radius:5px;
  padding:10px 8px; margin:-10px -8px; cursor:pointer;
  transition:font-weight .1s, background-color .15s, color .15s;
}
.add-field-icon{ flex-shrink:0; }
.add-field-link:hover, .add-field-link:focus-visible, .add-field-link:active{
  font-weight:700; background:rgba(255,255,255,0.06);
}
.add-field-link:focus-visible{ outline:1px solid currentColor; outline-offset:1px; }
.add-field-link:disabled{ opacity:0.5; cursor:default; }

.attachments-wrap{ display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.attachment-row{
  display:flex; align-items:center; gap:10px; background:var(--panel);
  border:1px solid var(--line-strong); border-radius:var(--radius); padding:8px 10px; font-size:13px;
}
.attachment-row .attachment-name{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment-row .attachment-size{ color:var(--ivory-faint); font-size:11.5px; flex-shrink:0; }
.attachment-usage{ font-size:11.5px; color:var(--ivory-faint); margin-top:6px; padding-left:2px; }
.attachment-usage.is-full{ color:var(--rust); }

.entry-attachments{ display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.attachment-chip{
  display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--ivory-dim);
  background:var(--panel); border:1px solid var(--line-strong); border-radius:20px;
  padding:4px 10px 4px 8px; cursor:pointer;
}
.attachment-chip:hover, .attachment-chip:focus-visible{ border-color:var(--brass); color:var(--ivory); }

.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
textarea{ width:100%; background:var(--panel); border:1px solid var(--line-strong); color:var(--ivory); border-radius:var(--radius); padding:12px 14px; font-size:13.5px; min-height:70px; resize:vertical; outline:none;}
textarea:focus{ border-color:var(--brass); }

/* trustee */
.trustee-box{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:22px 24px; margin-top:18px;}
.trustee-box h3{ font-size:16px; margin:0 0 8px;}
.trustee-box p{ font-size:13px; color:var(--ivory-dim); line-height:1.6; margin:0 0 16px;}
.recovery-phrase{
  background:var(--ink); border:1px solid var(--brass); border-radius:var(--radius); padding:14px 16px; font-family:'IBM Plex Mono',monospace;
  font-size:14px; color:var(--brass-bright); letter-spacing:0.5px; margin-bottom:14px; word-break:break-all;
}
.tag{ display:inline-block; font-size:10.5px; letter-spacing:1px; text-transform:uppercase; padding:3px 8px; border-radius:2px; }
.tag-warn{ background:rgba(166,72,60,0.14); color:#D08579; border:1px solid rgba(166,72,60,0.35); }
.tag-ok{ background:rgba(74,124,109,0.14); color:#8DBBAA; border:1px solid rgba(74,124,109,0.35); }

.refer-strip{
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; margin-top:22px;
}
.refer-strip-title{ font-size:13.5px; color:var(--ivory); margin-bottom:3px; }
.refer-strip-body{ font-size:12px; color:var(--ivory-faint); line-height:1.5; }
.refer-strip .btn-ghost{ flex-shrink:0; }

/* help / how-this-works */
.help-modal{ max-width:600px; }

.help-simple-steps{ display:flex; flex-direction:column; gap:14px; margin-top:6px; }
.help-simple-step{ display:flex; align-items:center; gap:16px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; }
.help-simple-step .help-icon-circle{ margin-bottom:0; }
.help-simple-step p{ margin:0; font-size:15px; line-height:1.55; color:var(--ivory); }

.help-advanced{ margin-top:22px; border-top:1px solid var(--line); padding-top:16px; }
.help-advanced summary{ cursor:pointer; font-size:13px; color:var(--ivory-faint); list-style:none; }
.help-advanced summary::-webkit-details-marker{ display:none; }
.help-advanced summary::before{ content:"+ "; color:var(--brass); }
.help-advanced[open] summary::before{ content:"– "; }
.help-advanced summary:hover{ color:var(--ivory-dim); }

.help-dots{ display:flex; gap:8px; justify-content:center; margin:4px 0 26px; }
.help-dot{
  width:9px; height:9px; padding:0; border-radius:50%; border:1.5px solid var(--line-strong);
  background:transparent; cursor:pointer; transition:background-color .15s, border-color .15s, transform .15s;
}
.help-dot:hover{ border-color:var(--brass); }
.help-dot.done{ background:var(--brass); border-color:var(--brass); opacity:0.55; }
.help-dot.active{ background:var(--brass-bright); border-color:var(--brass-bright); transform:scale(1.3); }

.help-stage{ min-height:230px; display:flex; align-items:center; justify-content:center; }
.help-step{ display:none; flex-direction:column; align-items:center; text-align:center; animation:helpStepIn .25s ease; }
.help-step.active{ display:flex; }
@keyframes helpStepIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

.help-icon-circle{
  flex-shrink:0; width:56px; height:56px; border-radius:50%; margin-bottom:14px;
  background:var(--panel); border:1.5px solid var(--brass); color:var(--brass-bright);
  display:flex; align-items:center; justify-content:center;
}
.help-step-num{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:1.5px;
  color:var(--brass); text-transform:uppercase; margin-bottom:8px;
}
.help-step h3{ font-size:17px; margin:0 0 10px; font-family:'Newsreader',serif; font-weight:500; max-width:420px; }
.help-step p{ font-size:13.5px; color:var(--ivory-dim); line-height:1.7; margin:0; max-width:420px; }
.help-noise{ color:var(--brass-bright); }

.help-demo{
  width:100%; max-width:440px; margin-top:20px; text-align:left; background:var(--panel);
  border:1px solid var(--line-strong); border-radius:var(--radius); padding:16px 18px;
}
.help-demo .field-label{ display:block; margin-bottom:8px; }
.help-demo input[type="text"]{ width:100%; margin-bottom:10px; }
.help-demo input[type="range"]{ width:100%; accent-color:var(--brass); }
.help-demo-out{
  margin-top:10px; font-size:12.5px; color:var(--brass-bright); background:var(--ink);
  border:1px solid var(--line); border-radius:var(--radius); padding:10px 12px;
  word-break:break-all; min-height:16px; line-height:1.5;
}
#helpGuardianSentence{ color:var(--ivory-dim); font-family:inherit; }

.help-nav-actions{ justify-content:space-between; align-items:center; }
#helpPrevBtn:disabled{ opacity:0; pointer-events:none; }

@media (max-width:520px){
  .help-icon-circle{ width:46px; height:46px; }
  .help-step h3{ font-size:15.5px; }
  .help-stage{ min-height:290px; }
}

::-webkit-scrollbar{ width:8px; }
::-webkit-scrollbar-thumb{ background:var(--line-strong); border-radius:4px; }

.theme-toggle{
  display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:50%;
  background:transparent; border:1px solid var(--line-strong); color:var(--ivory-dim);
  flex-shrink:0; transition: border-color .15s, color .15s;
}
.theme-toggle:hover{ border-color:var(--brass); color:var(--brass-bright); }
.theme-toggle svg{ width:15px; height:15px; }

/* ---------- NOTIFICATION BELL ---------- */
.notif-dropdown-wrap{ position:relative; flex-shrink:0; }
.notif-bell{
  position:relative; display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:50%;
  background:transparent; border:1px solid var(--line-strong); color:var(--ivory-dim);
  cursor:pointer; font-family:inherit; transition:border-color .15s, color .15s;
  transform-origin:50% 20%;
}
.notif-bell:hover, .notif-bell.is-open{ border-color:var(--brass); color:var(--brass-bright); }
.notif-bell svg{ width:15px; height:15px; }
.notif-badge{
  position:absolute; top:-2px; right:-2px; min-width:15px; height:15px; padding:0 3px;
  border-radius:8px; background:var(--rust); color:#fff; font-size:9.5px; font-weight:700;
  line-height:15px; text-align:center; border:1.5px solid var(--ink);
}
@keyframes bell-ring{
  0%, 100%{ transform:rotate(0); }
  15%{ transform:rotate(16deg); }
  30%{ transform:rotate(-14deg); }
  45%{ transform:rotate(10deg); }
  60%{ transform:rotate(-8deg); }
  75%{ transform:rotate(4deg); }
  90%{ transform:rotate(-2deg); }
}
.notif-bell.is-ringing{ animation:bell-ring 0.75s ease-in-out 2; border-color:var(--brass); color:var(--brass-bright); }
@media (prefers-reduced-motion: reduce){
  .notif-bell.is-ringing{ animation:none; }
}
.notif-dropdown{
  position:absolute; top:calc(100% + 10px); right:0; width:340px; max-height:420px; overflow-y:auto;
  background:var(--panel); border:1px solid var(--line-strong); border-radius:var(--radius);
  box-shadow:0 14px 34px rgba(0,0,0,0.30); z-index:40;
}
.notif-dropdown-header{ font-size:11px; letter-spacing:1.6px; text-transform:uppercase; color:var(--ivory-faint); padding:14px 16px 10px; }
.notif-item{
  display:block; width:100%; text-align:left; padding:11px 16px; border:none; border-top:1px solid var(--line);
  background:none; cursor:pointer; font-family:inherit;
}
.notif-item:first-child{ border-top:none; }
.notif-item:hover{ background:var(--panel-2); }
.notif-item.is-unread{ background:rgba(176,141,87,0.08); }
.notif-item .notif-text{ font-size:13px; color:var(--ivory); line-height:1.5; }
.notif-item .notif-time{ font-size:10.5px; color:var(--ivory-faint); margin-top:4px; }
.notif-empty{ padding:26px 16px; text-align:center; font-size:12.5px; color:var(--ivory-faint); }
@media (max-width:480px){
  .notif-dropdown{ position:fixed; top:70px; left:16px; right:16px; width:auto; }
}
.lock-theme-wrap{ position:absolute; top:24px; right:24px; display:flex; align-items:center; gap:10px; }
@media (max-width:480px){
  .lock-theme-wrap{ position:static; margin:0 auto 20px; justify-content:center; }
}

.lang-switch{ display:flex; gap:2px; border:1px solid var(--line-strong); border-radius:20px; padding:2px; }
.lang-btn{
  background:none; border:none; border-radius:16px; color:var(--ivory-faint);
  font-family:'IBM Plex Sans',sans-serif; font-size:11px; font-weight:500; padding:5px 10px;
  cursor:pointer; transition:background-color .15s, color .15s;
}
.lang-btn:hover{ color:var(--ivory-dim); }
.lang-btn.active{ background:var(--brass); color:var(--btn-primary-text); }
.sidebar-head .brand-row{ display:flex; align-items:center; justify-content:space-between; }

/* ==========================================================================
   ADDITIONS beyond the POC
   ========================================================================== */

/* Account probe: tells you whether this vault name is new or existing, before
   you commit a passphrase to it. */
.vault-probe{
  font-size:12.5px; line-height:1.5; min-height:17px;
  display:flex; align-items:center; gap:7px;
  color:var(--ivory-faint);
}
.vault-probe .dot{ width:6px; height:6px; border-radius:50%; background:var(--ivory-faint); flex-shrink:0; }
.vault-probe.is-new .dot{ background:var(--brass); }
.vault-probe.is-new{ color:var(--brass-bright); }
.vault-probe.is-existing .dot{ background:var(--teal); }
.vault-probe.is-existing{ color:var(--ivory-dim); }
.vault-probe.is-checking .dot{ animation: pulse 1s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{opacity:.3;} 50%{opacity:1;} }

/* Passphrase strength — a bar, not a score. There is no reset, so the cost of
   a weak passphrase is total and permanent. */
.pass-meter{ display:flex; gap:4px; margin-top:8px; }
.pass-meter .seg{ height:3px; flex:1; background:var(--line-strong); border-radius:2px; transition: background .2s; }
.pass-meter .seg.on-weak{ background:var(--rust); }
.pass-meter .seg.on-fair{ background:var(--brass); }
.pass-meter .seg.on-strong{ background:var(--teal); }
.pass-meter-label{ font-size:11.5px; color:var(--ivory-faint); margin-top:6px; min-height:16px; }

/* Save status — the vault now lives across a network hop, so "did that save?"
   has to be answerable at a glance. */
.save-status{
  font-size:11.5px; color:var(--ivory-faint); display:flex; align-items:center; gap:7px;
  padding:4px 2px 0; min-height:20px; line-height:1.4;
}
.save-status .dot{ width:6px; height:6px; border-radius:50%; background:var(--ivory-faint); flex-shrink:0; }
.save-status.is-saving .dot{ background:var(--brass); animation: pulse 1s ease-in-out infinite; }
.save-status.is-saved .dot{ background:var(--teal); }
.save-status.is-error{ color:var(--rust); }
.save-status.is-error .dot{ background:var(--rust); }
.save-status button{
  background:none; border:none; color:var(--brass); font-size:11.5px; padding:0; text-decoration:underline; cursor:pointer;
}

.profile-channels{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.profile-channel{
  display:flex; align-items:center; gap:7px; font-size:13px; color:var(--ivory-dim);
  background:var(--panel); border:1px solid var(--line-strong); border-radius:20px;
  padding:7px 14px 7px 12px; cursor:pointer; transition:border-color .15s, color .15s;
}
.profile-channel input{ accent-color:var(--brass); margin:0; cursor:pointer; }
.profile-channel:has(input:checked){ border-color:var(--brass); color:var(--ivory); }

.inline-hint{ font-size:12px; color:var(--ivory-faint); margin-top:8px; line-height:1.5; }

details.trustee-box summary{ font-size:15px; margin:0; font-weight:500; color:var(--ivory); list-style:none; }
details.trustee-box summary::-webkit-details-marker{ display:none; }
details.trustee-box summary::before{ content:"+ "; color:var(--brass); }
details.trustee-box[open] summary::before{ content:"– "; }
details.trustee-box textarea{ margin-top:10px; }

@media (max-width: 820px){
  .entry-kv{ grid-template-columns:1fr; gap:2px 0; }
  .entry-kv .k{ margin-top:8px; }
}
