/*
 * PASSPORT — Sovereign Identity System
 * passport.css
 *
 * All visual styling for the Passport PWA.
 * Tokens → Reset → Layout → Screens → Components → Utilities
 *
 * No external fonts. No external calls. Sovereign by design.
 * System fonts only.
 */

    /* ── TOKENS ─────────────────────────────────────────────────── */
    :root {
      --ink:       #ece7dc;
      --ink-dim:   #8a8578;
      --ink-faint: rgba(201,169,97,0.30);   /* gold-tinted borders (Portail look) */
      --bg:        #0a0a0b;                 /* near-black, neutral */
      --bg-card:   rgba(17,17,19,0.80);     /* ~20% transparent — photo shows through */
      --bg-lift:   rgba(23,23,26,0.80);
      --gold:      #c9a961;                 /* matches the Portail */
      --gold-bright: #e8c877;               /* Portail hover/active gold */
      --gold-dim:  #6b5420;
      --gold-glow: rgba(201,169,97,0.15);
      --red:       #c94961;
      --green:     #6fbf73;
      --radius:    12px;
      --ease:      cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* ── RESET ──────────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body {
      height: 100%; overflow: hidden;
      background: var(--bg);
      color: var(--ink);
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 14px;
      -webkit-font-smoothing: antialiased;
    }

    /* ── APP SHELL ──────────────────────────────────────────────── */
    #app {
      position: fixed; inset: 0;
      display: flex; flex-direction: column;
      overflow: hidden;
    }

    /* ── SCREEN SYSTEM ──────────────────────────────────────────── */
    .screen {
      position: absolute; inset: 0;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      padding: 32px 24px;
      opacity: 0; pointer-events: none;
      transform: translateY(24px);
      transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      height: 100%;
      box-sizing: border-box;
    }
    .screen.active {
      opacity: 1; pointer-events: all;
      transform: translateY(0);
    }
    .screen.exit {
      opacity: 0; transform: translateY(-24px);
      transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    }

    /* Scrollable screens that start from top (home, nodes, vault files etc.) */
    .screen-top {
      justify-content: flex-start;
      padding-top: 48px;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
    }

    /* Screen header — back button + title row */
    .screen-header {
      width: 100%; max-width: 380px;
      display: flex; align-items: center;
      gap: 12px; margin-bottom: 24px;
    }
    .screen-header .logotype { margin: 0; }

    /* Back orb — consistent across all screens */
    .btn-back {
      width: 32px; height: 32px; border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--ink-faint);
      color: var(--ink-dim);
      font-size: 16px; line-height: 1;
      cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      transition: border-color 0.2s, color 0.2s;
    }
    .btn-back:hover { border-color: var(--gold-dim); color: var(--gold); }

    /* Tab bar — Private / Shared */
    .tab-bar {
      width: 100%; max-width: 380px;
      display: flex; margin-bottom: 16px;
    }
    .tab-btn {
      flex: 1; padding: 8px;
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 11px; cursor: pointer;
      letter-spacing: 0.05em;
      border: 1px solid var(--ink-faint);
      background: var(--bg-card); color: var(--ink-dim);
      transition: all 0.2s;
    }
    .tab-btn:first-child { border-radius: 8px 0 0 8px; }
    .tab-btn:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
    .tab-btn.active {
      border-color: var(--gold);
      background: var(--gold-glow);
      color: var(--gold);
    }

    /* File list container */
    .file-list {
      width: 100%; max-width: 380px;
    }

    /* Pad overlay — full screen file viewer */
    .pad-overlay {
      display: none;
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.9);
      z-index: 999;
      flex-direction: column;
    }
    .pad-overlay.open { display: flex; }
    .pad-header {
      display: flex; align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--ink-faint);
      flex-shrink: 0;
    }
    .pad-filename {
      font-size: 11px; color: var(--ink-dim);
      font-family: Georgia, 'Times New Roman', serif;
    }
    .pad-content {
      flex: 1; overflow-y: auto;
      padding: 20px;
      font-size: 12px; line-height: 1.8;
      color: var(--ink);
      white-space: pre-wrap; word-break: break-word;
      font-family: Georgia, 'Times New Roman', serif;
    }

    /* Danger zone label and items */
    .section-label-danger { color: var(--red); }
    .menu-item-danger { border-color: rgba(192,57,43,0.3); }
    .menu-item-danger strong { color: var(--red); }
    .menu-item-danger .menu-arrow { color: var(--red); }

    /* Static (non-clickable) menu items */
    .menu-item-static { cursor: default; }

    /* ── BACKGROUND TEXTURE ─────────────────────────────────────── */
    body::before {
      content: '';
      position: fixed; inset: 0;
      /* Portail-like backdrop: the SAME photo, darkened, with a gold top glow
         and the Portail's bottom-weighted dark gradient. */
      background:
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(201,169,97,0.09) 0%, transparent 55%),
        linear-gradient(180deg,
          rgba(10, 12, 15, 0.50) 0%,
          rgba(10, 12, 15, 0.62) 55%,
          rgba(10, 12, 15, 0.80) 100%),
        url("passport-bg.jpg") center 30% / cover no-repeat;
      pointer-events: none; z-index: 0;
    }
    .screen { z-index: 1; }

    /* ── GRAIN OVERLAY ──────────────────────────────────────────── */
    body::after {
      content: '';
      position: fixed; inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
      pointer-events: none; z-index: 0; opacity: 0.4;
    }

    /* ── LOGOTYPE ───────────────────────────────────────────────── */
    .logotype {
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 13px;
      letter-spacing: 0.25em;
      text-transform: uppercase;
      color: var(--gold);
      opacity: 0.8;
      margin-bottom: 8px;
    }

    /* ── DISPLAY HEADING ────────────────────────────────────────── */
    .display {
      font-family: Georgia, 'Times New Roman', serif;
      font-size: clamp(32px, 8vw, 48px);
      line-height: 1.1;
      color: var(--ink);
      text-align: center;
      margin-bottom: 16px;
    }
    .display em {
      font-style: italic;
      color: var(--gold);
    }

    /* ── BODY TEXT ──────────────────────────────────────────────── */
    .body-text {
      font-size: 13px;
      line-height: 1.7;
      color: var(--ink-dim);
      text-align: center;
      max-width: 320px;
      margin-bottom: 40px;
    }

    /* ── CARD ───────────────────────────────────────────────────── */
    .card {
      width: 100%; max-width: 380px;
      background: var(--bg-card);
      border: 1px solid var(--ink-faint);
      border-radius: var(--radius);
      padding: 28px;
      position: relative;
    }
    .card::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    }

    /* ── FIELD ──────────────────────────────────────────────────── */
    .field {
      margin-bottom: 20px;
    }
    .field label {
      display: block;
      font-size: 10px;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--ink-dim);
      margin-bottom: 8px;
    }
    .field input {
      width: 100%;
      background: var(--bg-lift);
      border: 1px solid var(--ink-faint);
      border-radius: 8px;
      padding: 12px 14px;
      color: var(--ink);
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 14px;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .field input:focus {
      border-color: var(--gold-dim);
      box-shadow: 0 0 0 3px var(--gold-glow);
    }
    .field input::placeholder { color: var(--ink-dim); opacity: 0.5; }

    /* ── PASSWORD STRENGTH ──────────────────────────────────────── */
    .strength-bar {
      height: 2px;
      background: var(--ink-faint);
      border-radius: 2px;
      margin-top: 8px;
      overflow: hidden;
    }
    .strength-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.3s var(--ease), background 0.3s;
      width: 0%;
    }
    .strength-label {
      font-size: 10px;
      color: var(--ink-dim);
      margin-top: 4px;
      height: 14px;
      transition: color 0.3s;
    }

    /* ── BUTTONS ────────────────────────────────────────────────── */
    .btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 14px 24px;
      border: none; border-radius: 8px;
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 13px; font-weight: 500;
      letter-spacing: 0.05em;
      cursor: pointer;
      transition: all 0.2s var(--ease);
      position: relative; overflow: hidden;
    }
    .btn-primary {
      background: var(--gold);
      color: #080b12;
    }
    .btn-primary:hover { background: var(--gold-bright); transform: translateY(-1px); }
    .btn-primary:active { transform: translateY(0); }
    .btn-primary:disabled {
      opacity: 0.4; cursor: not-allowed; transform: none;
    }
    .btn-ghost {
      background: rgba(17,17,19,0.70);
      color: var(--ink-dim);
      border: 1px solid var(--ink-faint);
    }
    .btn-ghost:hover { border-color: var(--ink-dim); color: var(--ink); }

    /* ── NOTICE ─────────────────────────────────────────────────── */
    .notice {
      display: flex; gap: 10px;
      background: rgba(201,168,76,0.06);
      border: 1px solid var(--gold-dim);
      border-radius: 8px;
      padding: 12px 14px;
      margin-bottom: 20px;
    }
    .notice-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
    .notice-text { font-size: 12px; line-height: 1.6; color: var(--ink-dim); }

    /* ── PROGRESS DOTS ──────────────────────────────────────────── */
    .progress-dots {
      display: flex; gap: 6px;
      margin-bottom: 32px;
    }
    .dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--ink-faint);
      transition: all 0.3s var(--ease);
    }
    .dot.active { background: var(--gold); width: 20px; border-radius: 3px; }
    .dot.done { background: var(--gold-dim); }

    /* ── DID DISPLAY ────────────────────────────────────────────── */
    .did-display {
      background: var(--bg-lift);
      border: 1px solid var(--ink-faint);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 16px;
      font-size: 11px;
      color: var(--ink-dim);
      word-break: break-all;
      line-height: 1.5;
      position: relative;
    }
    .did-display .did-label {
      font-size: 10px;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 6px;
      display: block;
    }
    .did-value {
      color: var(--ink);
      font-family: Georgia, 'Times New Roman', serif;
    }

    /* ── CREDENTIAL CARD ────────────────────────────────────────── */
    .cred-card {
      background: linear-gradient(135deg, #0d1a2e 0%, #0a1520 100%);
      border: 1px solid rgba(201,168,76,0.2);
      border-radius: var(--radius);
      padding: 20px;
      margin-bottom: 16px;
      position: relative;
      overflow: hidden;
    }
    .cred-card::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-dim));
    }
    .cred-type {
      font-size: 9px; letter-spacing: 0.2em;
      text-transform: uppercase; color: var(--gold);
      margin-bottom: 12px;
    }
    .cred-title {
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 20px; color: var(--ink);
      margin-bottom: 4px;
    }
    .cred-sub {
      font-size: 11px; color: var(--ink-dim);
      margin-bottom: 16px;
    }
    .cred-meta {
      display: flex; gap: 16px; flex-wrap: wrap;
    }
    .cred-meta-item { font-size: 10px; color: var(--ink-dim); }
    .cred-meta-item span { display: block; color: var(--ink); font-size: 11px; margin-top: 2px; }

    /* Personal markers — compact, private, non-actionable */
    .personal-markers {
      display: flex; align-items: center; gap: 6px; margin-top: 4px;
    }
    .personal-marker {
      display: inline-flex; align-items: center; justify-content: center;
      width: 30px; height: 30px; padding: 0;
      border: none; background: none; cursor: pointer;
      font-size: 18px; line-height: 1;
      color: var(--gold);
    }
    .personal-marker[data-color="green"]  { color: var(--green); }
    .personal-marker[data-color="red"]    { color: var(--red); }
    .personal-marker[data-color="yellow"] { color: var(--gold); }
    .personal-marker-help {
      display: inline-flex; align-items: center; justify-content: center;
      width: 22px; height: 22px; padding: 0;
      border: none; background: none; cursor: pointer;
      font-size: 11px; line-height: 1; color: var(--ink-dim); opacity: 0.7;
    }

    /* ── SHIELD ICON ────────────────────────────────────────────── */
    .shield {
      width: 56px; height: 56px;
      margin: 0 auto 24px;
      position: relative;
    }
    .shield svg { width: 100%; height: 100%; }

    /* Assistant badge — FIXED top-right of the screen (same on desktop + cell).
       Styled here only; the markup carries no inline CSS/JS. */
    .assist-badge {
      position: fixed;
      top: max(14px, env(safe-area-inset-top));
      /* nudged left so it no longer sits above the corner badge */
      right: max(81px, calc(env(safe-area-inset-right) + 67px));
      z-index: 90;
      width: 46px; height: 46px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      background: rgba(10,10,11,0.85);
      border: 1px solid var(--gold-dim);
      color: var(--gold);
      text-decoration: none;
      box-shadow: 0 0 0 3px var(--gold-glow);
      transition: transform 0.15s var(--ease), border-color 0.15s, color 0.15s;
      animation: assistGlow 2.8s ease-in-out infinite;
    }
    .assist-badge:hover,
    .assist-badge:active { transform: translateY(-1px); border-color: var(--gold); color: var(--gold-bright); }
    .assist-badge svg { width: 24px; height: 24px; display: block; }
    .assist-badge.has-messages {
      border-color: var(--green);
      color: var(--green);
      animation: assistMessageGlow 2.2s ease-in-out infinite;
    }
    .assist-badge-count {
      position: absolute; top: -4px; right: -4px; z-index: 1;
      min-width: 17px; height: 17px; padding: 0 4px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 9px; background: var(--green); color: #08110b;
      font-family: system-ui, -apple-system, sans-serif;
      font-size: 9px; font-weight: 700; line-height: 1; text-align: center;
      box-shadow: 0 0 0 2px var(--bg);
    }
    .assist-badge-count[hidden] { display: none; }
    @keyframes assistGlow {
      0%, 100% { box-shadow: 0 0 0 3px var(--gold-glow), 0 0 10px rgba(201,169,97,0.28); }
      50% { box-shadow: 0 0 0 5px rgba(201,169,97,0.10), 0 0 24px rgba(201,169,97,0.68); }
    }
    @keyframes assistMessageGlow {
      0%, 100% { box-shadow: 0 0 0 3px rgba(111,191,115,0.16), 0 0 10px rgba(111,191,115,0.35); }
      50% { box-shadow: 0 0 0 5px rgba(111,191,115,0.10), 0 0 26px rgba(111,191,115,0.82); }
    }
    @media (prefers-reduced-motion: reduce) {
      .assist-badge, .assist-badge.has-messages { animation: none; }
    }

    /* Language switch — round flag buttons, fixed top-left of the screen. */
    .lang-bar {
      position: fixed;
      top: max(14px, env(safe-area-inset-top));
      left: max(14px, env(safe-area-inset-left));
      z-index: 90; display: flex; gap: 6px;
    }
    .lang-btn {
      width: 26px; height: 26px; padding: 0; line-height: 0; cursor: pointer;
      border-radius: 50%; overflow: hidden; background: none;
      border: 1px solid var(--gold-dim);
      transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    }
    .lang-btn svg { width: 100%; height: 100%; display: block; }
    .lang-btn:hover { transform: translateY(-1px); }
    .lang-btn[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 2px rgba(111,191,115,0.35), 0 0 12px rgba(111,191,115,0.55); }

    /* ── GENERATING ANIMATION ───────────────────────────────────── */
    .generating {
      display: flex; flex-direction: column;
      align-items: center; gap: 16px;
      padding: 32px;
    }
    .gen-ring {
      width: 64px; height: 64px;
      border-radius: 50%;
      border: 2px solid var(--ink-faint);
      border-top-color: var(--gold);
      animation: spin 1s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .gen-steps { width: 100%; max-width: 260px; }
    .gen-step {
      display: flex; align-items: center; gap: 10px;
      padding: 6px 0;
      font-size: 12px; color: var(--ink-dim);
      opacity: 0.3;
      transition: opacity 0.4s, color 0.4s;
    }
    .gen-step.active { opacity: 1; color: var(--ink); }
    .gen-step.done { opacity: 0.7; color: var(--gold); }
    .gen-step-dot {
      width: 6px; height: 6px; border-radius: 50%;
      background: currentColor; flex-shrink: 0;
    }

    /* ── DIVIDER ────────────────────────────────────────────────── */
    .divider {
      display: flex; align-items: center; gap: 12px;
      margin: 20px 0; color: var(--ink-dim); font-size: 11px;
    }
    .divider::before, .divider::after {
      content: ''; flex: 1;
      height: 1px; background: var(--ink-faint);
    }

    /* ── HOME SCREEN ────────────────────────────────────────────── */
    .home-header {
      width: 100%; max-width: 380px;
      display: flex; align-items: center; justify-content: space-between;
      padding-bottom: 20px;
      margin-bottom: 8px;
      border-bottom: 1px solid var(--ink-faint);
    }
    .home-handle {
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 22px;
    }
    .home-header > div { min-width: 0; flex: 1; }
    .home-did-row {
      display: flex; align-items: center; gap: 6px;
      margin-top: 5px; min-width: 0;
      padding: 6px 8px;
      background: rgba(236,231,220,0.72);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 9px;
    }
    .home-did {
      font-family: 'SFMono-Regular', Consolas, monospace;
      font-size: 10.5px; color: #111;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      min-width: 0;
    }
    .did-copy {
      flex: 0 0 auto; width: 26px; height: 26px; padding: 0;
      display: inline-flex; align-items: center; justify-content: center;
      border-radius: 50%; border: 1px solid rgba(0,0,0,0.14);
      background: rgba(255,255,255,0.92); color: #111; cursor: pointer;
    }
    .did-copy:hover, .did-copy:active { border-color: var(--gold-dim); color: #000; }
    .did-copy svg { width: 13px; height: 13px; display: block; }
    .home-quick {
      width: 100%; max-width: 380px;
      display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
      margin: 2px 0 4px;
    }
    .home-quick-btn {
      display: flex; align-items: center; gap: 10px;
      padding: 12px; text-align: left;
      background: rgba(236,231,220,0.72);
      border: 1px solid rgba(255,255,255,0.18); border-radius: 12px;
      color: #111; cursor: pointer;
    }
    .home-quick-btn:hover, .home-quick-btn:active {
      background: rgba(236,231,220,0.88); border-color: var(--gold-dim);
    }
    .home-quick-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }
    .home-quick-text { display: flex; flex-direction: column; min-width: 0; }
    .home-quick-text strong { font-size: 13px; font-weight: 500; color: #111; }
    .home-quick-text small {
      font-size: 10.5px; color: rgba(17,17,19,0.62);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .avatar {
      width: 40px; height: 40px; border-radius: 50%;
      background: var(--bg-lift);
      border: 1px solid var(--gold-dim);
      display: flex; align-items: center; justify-content: center;
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 18px; color: var(--gold);
    }
    .section-label {
      width: 100%; max-width: 380px;
      font-size: 10px; letter-spacing: 0.15em;
      text-transform: uppercase; color: var(--ink-dim);
      margin: 20px 0 10px;
    }

    /* ── MENU ITEMS ─────────────────────────────────────────────── */
    .menu-item {
      width: 100%; max-width: 380px;
      display: flex; align-items: center; gap: 14px;
      padding: 14px 16px;
      background: var(--bg-card);
      border: 1px solid var(--ink-faint);
      border-radius: 10px;
      margin-bottom: 8px;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s;
      text-decoration: none; color: inherit;
    }
    .menu-item:hover {
      border-color: var(--gold-dim);
      background: var(--bg-lift);
    }
    .menu-icon {
      width: 36px; height: 36px; border-radius: 8px;
      background: var(--bg-lift);
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; flex-shrink: 0;
    }
    .menu-text { flex: 1; }
    .menu-text strong { display: block; font-size: 13px; font-weight: 500; margin-bottom: 2px; }
    .menu-text small { font-size: 11px; color: var(--ink-dim); }
    .menu-arrow { color: var(--ink-dim); font-size: 16px; }
    .passport-message-link.has-messages {
      color: var(--green);
      border-color: rgba(111,191,115,0.5);
    }

    /* ── STATUS BADGE ───────────────────────────────────────────── */
    .badge {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 3px 8px; border-radius: 4px;
      font-size: 10px; font-weight: 500; letter-spacing: 0.05em;
    }
    .badge-gold { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--gold-dim); }
    .badge-green { background: rgba(39,174,96,0.1); color: var(--green); border: 1px solid rgba(39,174,96,0.3); }

    /* ── TOAST ──────────────────────────────────────────────────── */
    #toast {
      position: fixed; bottom: 32px; left: 50%;
      transform: translateX(-50%) translateY(80px);
      background: var(--bg-lift);
      border: 1px solid var(--gold-dim);
      border-radius: 8px;
      padding: 10px 18px;
      font-size: 12px; color: var(--ink);
      z-index: 100;
      transition: transform 0.4s var(--ease);
      white-space: nowrap;
    }
    #toast.show { transform: translateX(-50%) translateY(0); }

    /* ── INSTALL BANNER (iOS) ───────────────────────────────────── */
    #install-banner {
      position: fixed; bottom: 0; left: 0; right: 0;
      background: var(--bg-card);
      border-top: 1px solid var(--gold-dim);
      padding: 16px 20px;
      z-index: 200;
      display: none;
    }
    #install-banner.show { display: block; }
    .install-text { font-size: 12px; color: var(--ink-dim); line-height: 1.6; }
    .install-text strong { color: var(--ink); }
    .install-close {
      position: absolute; top: 12px; right: 16px;
      background: none; border: none;
      color: var(--ink-dim); font-size: 18px; cursor: pointer;
    }

    /* ── ANIMATIONS ─────────────────────────────────────────────── */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(16px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .fade-up { animation: fadeUp 0.5s var(--ease) both; }
    .fade-up-1 { animation-delay: 0.05s; }
    .fade-up-2 { animation-delay: 0.12s; }
    .fade-up-3 { animation-delay: 0.19s; }
    .fade-up-4 { animation-delay: 0.26s; }
    .fade-up-5 { animation-delay: 0.33s; }

    /* ── ABOUT ORB ──────────────────────────────────────────────── */
    #about-orb {
      position: fixed; top: 16px; right: 16px;
      width: 43px; height: 43px; border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--gold-dim);
      display: none; align-items: center; justify-content: center;
      cursor: pointer; z-index: 50;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    #about-orb.visible { display: flex; }
    #about-orb::before {
      content: '';
      position: absolute; inset: -5px;
      border-radius: 50%;
      border: 1px solid var(--gold-dim);
      animation: orbPulse 3s ease-in-out infinite;
      pointer-events: none;
    }
    #about-orb:hover { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow); }
    #about-orb svg { width: 22px; height: 22px; }
    @keyframes orbPulse {
      0%, 100% { transform: scale(1);   opacity: 0.25; }
      50%       { transform: scale(1.3); opacity: 0.6;  }
    }

    /* ── ABOUT OVERLAY ──────────────────────────────────────────── */
    #about-overlay {
      display: none;
      position: fixed; inset: 0;
      background: rgba(8,11,18,0.96);
      z-index: 200;
      flex-direction: column;
      align-items: center;
      overflow-y: auto;
      padding: 48px 24px 64px;
    }
    #about-overlay.open { display: flex; }
    #about-close {
      position: fixed; top: 16px; right: 16px;
      width: 36px; height: 36px; border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--ink-faint);
      color: var(--ink-dim); font-size: 16px;
      cursor: pointer; z-index: 201;
      display: flex; align-items: center; justify-content: center;
      transition: border-color 0.2s, color 0.2s;
    }
    #about-close:hover { border-color: var(--gold-dim); color: var(--gold); }
    .about-logo {
      width: 72px; height: 72px; margin: 0 auto 20px;
    }
    .about-logo svg { width: 100%; height: 100%; }
    .about-logotype {
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 11px; letter-spacing: 0.3em;
      text-transform: uppercase;
      color: var(--gold); opacity: 0.8;
      margin-bottom: 32px; text-align: center;
    }
    .about-body {
      width: 100%; max-width: 380px;
      font-size: 13px; line-height: 1.9;
      color: var(--ink-dim);
      white-space: pre-wrap; word-break: break-word;
    }
    .about-body h1, .about-body h2, .about-body h3 {
      font-family: Georgia, 'Times New Roman', serif;
      color: var(--ink); margin: 28px 0 8px;
      font-size: 16px; font-weight: normal;
    }
    .about-body h1 { font-size: 20px; margin-top: 0; }
    .about-body hr {
      border: none; border-top: 1px solid var(--ink-faint);
      margin: 20px 0;
    }
    .about-body strong { color: var(--ink); }
    .about-body em { color: var(--gold); font-style: italic; }
    /* Vault file rows */
    .vf-file-row {
      display: flex; align-items: stretch;
      margin-bottom: 8px;
      border: 1px solid var(--ink-faint);
      border-radius: 8px;
      background: var(--bg-card);
      overflow: hidden;
    }
    .vf-file-main {
      display: flex; align-items: center;
      flex: 1; padding: 12px; cursor: pointer;
      gap: 12px; min-width: 0;
    }
    .vf-file-main:hover { background: var(--bg-lift); }
    .vf-file-actions {
      display: flex; flex-shrink: 0;
      border-left: 1px solid var(--ink-faint);
    }
    .vf-action-btn {
      background: none; border: none;
      border-left: 1px solid var(--ink-faint);
      padding: 0 14px; min-height: 48px;
      cursor: pointer; font-size: 14px;
      color: var(--ink-dim);
      transition: background 0.15s, color 0.15s;
    }
    .vf-action-btn:first-child { border-left: none; }
    .vf-action-btn:hover { background: var(--bg-lift); color: var(--gold); }
    .vf-action-delete:hover { color: var(--red) !important; }

    ::-webkit-scrollbar { width: 4px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 2px; }

    /* ── UTILITY CLASSES ────────────────────────────────────────── */
    /* Replaces repeated inline styles throughout passport.html     */

    /* Layout */
    .w-card   { width: 100%; max-width: 380px; }
    .w-full   { width: 100%; }

    /* Margin bottom scale */
    .mb-2     { margin-bottom: 2px; }
    .mb-8     { margin-bottom: 8px; }
    .mb-10    { margin-bottom: 10px; }
    .mb-12    { margin-bottom: 12px; }
    .mb-16    { margin-bottom: 16px; }
    .mb-20    { margin-bottom: 20px; }
    .mb-24    { margin-bottom: 24px; }
    .mb-28    { margin-bottom: 28px; }
    .mb-32    { margin-bottom: 32px; }
    .mb-40    { margin-bottom: 40px; }

    /* Margin top scale */
    .mt-8     { margin-top: 8px; }
    .mt-12    { margin-top: 12px; }
    .mt-20    { margin-top: 20px; }

    /* Typography */
    .text-xs  { font-size: 11px; }
    .text-sm  { font-size: 12px; }
    .text-13  { font-size: 13px; }
    .text-red { color: var(--red); }
    .text-dim { color: var(--ink-dim); }
    .text-ink { color: var(--ink); }
    .text-gold { color: var(--gold); }
    .text-dim-sm { font-size: 11px; color: var(--ink-dim); }
    .text-dim-13 { color: var(--ink-dim); font-size: 13px; line-height: 1.7; }
    .text-wrap   { word-break: break-all; }
    .text-pre    { white-space: pre-wrap; }

    /* Error notice state — used on .notice elements */
    .notice-error {
      border-color: var(--red);
      background: rgba(192,57,43,0.05);
    }

    /* Flex helpers */
    .row-8  { display: flex; gap: 8px; }
    .row-12 { display: flex; gap: 12px; }
    .row-item { display: flex; gap: 12px; align-items: flex-start; }
    .flex-1 { flex: 1; }

    /* QR container */
    .qr-container {
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
    border-radius: 8px;
    }

    /* Credential item icon */
    .cred-icon { font-size: 20px; flex-shrink: 0; }
    .cred-label { font-size: 13px; display: block; margin-bottom: 2px; }

    /* Empty state */
    .empty-state { display: none; text-align: center; padding: 40px 0; }

    /* Serif display (about screen) */
    .serif-display { font-family: Georgia,'Times New Roman',serif; font-size: 24px; }
    .mt-4       { margin-top: 4px; }
    .text-gold-dim { color: var(--gold-dim); }

