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

    :root {
      --bg:         #080808;
      --card:       #0e0e0e;
      --gold:       #c4a05a;
      --gold-dim:   rgba(196,160,90,.35);
      --gold-glow:  rgba(196,160,90,.07);
      --cream:      #f0e8d5;
      --text:       #d8cfc0;
      --muted:      #7a7468;
      --border:     rgba(196,160,90,.18);
      --cinzel:     'Cinzel', 'Palatino Linotype', Palatino, serif;
      --serif:      Georgia, 'Times New Roman', serif;
    }

    html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--cinzel); overflow-x: hidden; }

    /* ── Hide all scrollbars while preserving scroll functionality ── */
    * { scrollbar-width: none; }
    *::-webkit-scrollbar { display: none; }

    #starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

    /* ── Screens ── */
    .screen { display: none; position: relative; z-index: 1; }
    .screen.active { display: flex; }
    .hidden { display: none !important; }

    /* ── Gate ── */
    #screen-gate {
      min-height: 100vh;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1.6rem;
      padding: 2rem;
    }
    .gate-logo { width: 200px; height: auto; opacity: .88; display: block; }
    .gate-eyebrow { font-size: .58rem; letter-spacing: .45em; color: var(--gold); text-transform: uppercase; text-align: center; }
    .gate-welcome { font-size: .72rem; letter-spacing: .2em; color: var(--text); text-transform: uppercase; text-align: center; }
    .gate-not-me { font-size: .52rem; letter-spacing: .15em; color: var(--muted); text-align: center; }
    .gate-not-me a { color: var(--gold); text-decoration: none; cursor: pointer; }
    .gate-not-me a:hover { text-decoration: underline; }
    #gate-fields-full { display: flex; flex-direction: column; gap: 1.1rem; width: 100%; max-width: 340px; }

    /* ── Onboard ── */
    #screen-onboard {
      min-height: 100vh;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 1.5rem;
      padding: 3rem 2rem 4rem;
      overflow-y: auto;
    }
    #onboard-form {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.5rem;
      width: 100%;
    }
    .onboard-logo { width: 175px; height: auto; opacity: .8; display: block; }
    .onboard-title { font-size: 1.1rem; font-weight: 400; letter-spacing: .12em; color: var(--cream); text-align: center; max-width: 420px; line-height: 1.6; }
    .onboard-invited-by { font-size: .52rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; text-align: center; }
    .onboard-invalid { text-align: center; color: var(--muted); font-size: .75rem; letter-spacing: .12em; }
    #color-grid { display: grid; grid-template-columns: repeat(7, 36px); gap: .65rem; justify-content: center; }
    .color-swatch {
      width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
      transition: transform .15s, box-shadow .15s;
    }
    .color-swatch:hover { transform: scale(1.15); }
    .color-swatch.selected { transform: scale(1.1); }
    .onboard-label { font-size: .48rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; text-align: center; }

    /* ── Temple ── */
    #screen-temple { height: 100vh; width: 100%; }
    .temple-layout { display: flex; height: 100vh; width: 100%; }

    .sidebar {
      width: 230px;
      flex-shrink: 0;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .sidebar-logo-wrap {
      padding: 1.5rem 1.25rem 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .sidebar-logo { width: 80px; height: auto; opacity: .75; }

    .sidebar-section { padding: .9rem 1.25rem .4rem; flex-shrink: 0; }
    .sidebar-section-label { font-size: .44rem; letter-spacing: .4em; color: var(--gold); text-transform: uppercase; }

    .sidebar-members { overflow-y: auto; flex-shrink: 0; max-height: 220px; padding: .5rem 1.25rem .75rem; }
    .sidebar-member { display: flex; align-items: center; gap: .65rem; padding: .35rem 0; }
    .member-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .member-name { font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; }

    .sidebar-divider { height: 1px; background: var(--border); margin: .5rem 1.25rem; flex-shrink: 0; }

    .sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
    .sidebar-rooms { flex-shrink: 0; padding: .25rem 1.25rem .5rem; }
    .sidebar-room {
      font-size: .56rem; letter-spacing: .18em; text-transform: uppercase;
      color: var(--muted); padding: .45rem .6rem;
      border-left: 2px solid transparent;
      transition: color .2s, border-color .2s;
      display: flex; align-items: center; gap: .4rem;
    }
    .sidebar-room:hover { color: var(--text); }
    .sidebar-room.active { color: var(--gold); border-left-color: var(--gold); }
    .sidebar-room-label { flex: 1; cursor: pointer; }
    .room-delete {
      opacity: 0; font-size: .5rem; color: var(--muted); cursor: pointer;
      flex-shrink: 0; line-height: 1; padding: 0 .1rem;
      transition: opacity .15s, color .15s;
    }
    .sidebar-room:hover .room-delete { opacity: 1; }
    .room-delete:hover { color: #ff4d6d; }
    .sidebar-room-add {
      font-size: .5rem; letter-spacing: .25em; text-transform: uppercase;
      color: var(--muted); padding: .45rem .6rem; cursor: pointer;
      margin-top: .5rem; opacity: .6;
      transition: opacity .2s;
    }
    .sidebar-room-add:hover { opacity: 1; color: var(--gold); }

    .temple-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; position: relative; }

    .room-header {
      padding: 1.1rem 1.75rem;
      border-bottom: 1px solid var(--border);
      font-size: .52rem;
      letter-spacing: .45em;
      color: var(--gold);
      text-transform: uppercase;
      flex-shrink: 0;
    }

    .messages-area {
      flex: 1;
      overflow-y: auto;
      padding: 1.75rem 2rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      user-select: none;
      transition: filter .3s ease;
    }
    .temple-watermark {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 110%; max-width: 760px;
      opacity: .05;
      pointer-events: none;
      z-index: 0;
      user-select: none;
    }
    /* ── Decrypt bar ── */
    #decrypt-bar {
      display: flex; flex-direction: column; align-items: center; gap: .55rem;
      padding: .85rem 1.75rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--bg);
    }
    #decrypt-btn {
      font-family: var(--cinzel);
      font-size: .6rem; letter-spacing: .5em; text-transform: uppercase;
      color: var(--gold); background: transparent;
      border: 1px solid rgba(196,160,90,.35);
      padding: .6rem 2.5rem; cursor: pointer;
      transition: border-color .25s, box-shadow .25s;
    }
    #decrypt-btn:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 14px rgba(196,160,90,.3); }
    #decrypt-btn:disabled { cursor: default; }
    #decrypt-btn.pulsing {
      animation: decryptPulse 1.4s ease-in-out infinite;
      border-color: var(--gold);
    }
    @keyframes decryptPulse {
      0%, 100% { box-shadow: 0 0 4px rgba(196,160,90,.15); }
      50%       { box-shadow: 0 0 24px rgba(196,160,90,.55), 0 0 48px rgba(196,160,90,.18); }
    }
    #decrypt-status {
      font-family: var(--cinzel); font-style: italic;
      font-size: .42rem; letter-spacing: .28em;
      color: rgba(196,160,90,.45); min-height: .8em;
    }
    .msg-glitching {
      font-family: 'Courier New', monospace !important;
      font-size: .65rem !important; color: var(--gold) !important;
      white-space: nowrap; overflow: hidden; letter-spacing: .04em;
    }

    .msg { display: flex; flex-direction: column; gap: .28rem; position: relative; z-index: 1; }
    .msg--consecutive { margin-top: -1rem; }
    .msg-meta { display: flex; align-items: baseline; gap: .75rem; }
    .msg-name { font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; }
    .msg-time { font-size: .46rem; letter-spacing: .08em; color: var(--muted); }
    .msg-body { font-family: var(--serif); font-size: 1rem; color: var(--text); line-height: 1.78; white-space: pre-wrap; word-break: break-word; user-select: none; }
    .msg-cipher { font-family: 'Courier New', monospace; font-size: .6rem; color: var(--gold-dim); word-break: break-all; line-height: 1.5; }

    .compose-area {
      border-top: 1px solid var(--border);
      padding: 1rem 1.75rem;
      display: flex;
      gap: .9rem;
      align-items: center;
      flex-shrink: 0;
      background: var(--bg);
    }
    #compose-input {
      flex: 1;
      background: transparent;
      border: 1px solid var(--border);
      color: var(--cream);
      font-family: var(--serif);
      font-size: 1rem;
      padding: .75rem 1rem;
      outline: none;
      resize: none;
      transition: border-color .25s;
      min-height: 52px;
      max-height: 160px;
    }
    #compose-input:focus { border-color: var(--gold-dim); }
    #compose-input::placeholder { color: var(--muted); font-style: italic; }

    /* ── Modal ── */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(0,0,0,.75);
      display: flex; align-items: center; justify-content: center;
      padding: 2rem;
    }
    .modal-card {
      background: #0e0e0e;
      border: 1px solid var(--border);
      padding: 2rem 2.25rem;
      width: 100%; max-width: 440px;
      display: flex; flex-direction: column; gap: 1.25rem;
    }
    .modal-title { font-size: .62rem; letter-spacing: .4em; color: var(--gold); text-transform: uppercase; }
    .modal-member-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
    .modal-member-item {
      display: flex; align-items: center; gap: .7rem;
      padding: .5rem .1rem;
      border-bottom: 1px solid rgba(255,255,255,.04);
      cursor: pointer;
    }
    .modal-member-item:last-child { border-bottom: none; }
    .modal-member-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .modal-member-name {
      flex: 1;
      font-family: 'Cinzel', serif;
      font-size: .52rem; letter-spacing: .2em; text-transform: uppercase;
    }
    .modal-member-item input[type="checkbox"] {
      appearance: none; -webkit-appearance: none;
      width: 13px; height: 13px; flex-shrink: 0;
      border: 1px solid var(--gold); background: transparent;
      cursor: pointer; position: relative;
    }
    .modal-member-item input[type="checkbox"]:checked { background: var(--gold); }
    .modal-member-item input[type="checkbox"]:checked::after {
      content: ''; position: absolute;
      left: 3px; top: 0px; width: 4px; height: 7px;
      border: 1.5px solid #080808; border-top: none; border-left: none;
      transform: rotate(45deg);
    }
    .modal-actions { display: flex; gap: .75rem; }
    .member-chips-grid {
      display: flex; flex-wrap: wrap; gap: .5rem;
      max-height: 220px; overflow-y: auto; padding: .25rem 0;
    }
    .member-chip {
      display: flex; align-items: center; gap: .45rem;
      padding: 6px 14px; border-radius: 20px;
      background: #1a1a1a; border: 1.5px solid transparent;
      opacity: 0.6; cursor: pointer;
      transition: opacity .15s, border-color .15s, box-shadow .15s;
    }
    .member-chip.selected {
      border-color: #C9A84C; opacity: 1;
      box-shadow: 0 0 8px rgba(201,168,76,.25);
    }
    .member-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .member-chip-name {
      font-family: 'Cinzel', serif;
      font-size: .5rem; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
    }

    /* ── Shared inputs / buttons ── */
    .field-wrap { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: .4rem; }
    .field-label { font-size: .46rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
    .field-input {
      width: 100%;
      background: transparent;
      border: 1px solid var(--gold);
      color: var(--cream);
      font-family: var(--cinzel);
      font-size: .78rem;
      letter-spacing: .15em;
      padding: .9rem 1.25rem;
      outline: none;
      transition: border-color .25s;
      text-align: center;
    }
    .field-input:focus { border-color: #e8d08a; }

    .btn-primary {
      font-family: var(--cinzel);
      font-size: .68rem;
      letter-spacing: .35em;
      text-transform: uppercase;
      color: #08090c;
      background: var(--gold);
      border: none;
      padding: 1.1rem 3rem;
      cursor: pointer;
      transition: background .25s, transform .15s;
    }
    .btn-primary:hover { background: #e8d08a; transform: translateY(-1px); }
    .btn-primary:disabled { opacity: .55; cursor: default; transform: none; }

    .btn-secondary {
      font-family: var(--cinzel);
      font-size: .58rem;
      letter-spacing: .25em;
      text-transform: uppercase;
      color: var(--muted);
      background: transparent;
      border: 1px solid var(--border);
      padding: .75rem 1.5rem;
      cursor: pointer;
      transition: color .2s, border-color .2s;
    }
    .btn-secondary:hover { color: var(--text); border-color: var(--gold-dim); }

    .btn-transmit {
      font-family: var(--cinzel);
      font-size: .58rem;
      letter-spacing: .28em;
      text-transform: uppercase;
      color: #08090c;
      background: var(--gold);
      border: none;
      padding: .82rem 1.5rem;
      cursor: pointer;
      transition: background .2s;
      flex-shrink: 0;
      white-space: nowrap;
      align-self: center;
    }
    .btn-transmit:hover { background: #e8d08a; }
    .btn-transmit:disabled { opacity: .5; cursor: default; }

    .status-note { font-size: .5rem; letter-spacing: .18em; color: var(--muted); text-align: center; min-height: 1em; }

    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%, 60%  { transform: translateX(-7px); }
      40%, 80%  { transform: translateX(7px); }
    }
    .shake { animation: shake .38s ease; }

    /* ── DM sidebar ── */
    .sidebar-dm { overflow-y: auto; flex-shrink: 0; max-height: 180px; padding: .5rem 1.25rem .75rem; }
    .sidebar-dm-item {
      display: flex; align-items: center; gap: .65rem; padding: .35rem 0;
      cursor: pointer; border-left: 2px solid transparent;
      transition: border-color .2s;
    }
    .sidebar-dm-item.active { border-left-color: var(--gold); padding-left: .4rem; }
    .sidebar-dm-item:hover .member-name { opacity: 1; }
    .dm-badge {
      font-size: .38rem; letter-spacing: .04em;
      background: var(--gold); color: #08090c;
      border-radius: 8px; padding: 1px 5px;
      font-weight: 700; flex-shrink: 0; min-width: 16px; text-align: center;
    }

    /* ── DM action bar ── */
    #dm-action-bar {
      border-bottom: 1px solid var(--border);
      padding: .55rem 1.75rem;
      display: flex; gap: .75rem; align-items: center;
      flex-shrink: 0; background: var(--bg);
    }
    .dm-action-btn {
      font-family: var(--cinzel);
      font-size: .48rem; letter-spacing: .3em; text-transform: uppercase;
      color: var(--gold); background: transparent;
      border: 1px solid rgba(196,160,90,.3);
      padding: .4rem .9rem; cursor: pointer;
      transition: border-color .2s, box-shadow .2s;
    }
    .dm-action-btn:hover { border-color: var(--gold); box-shadow: 0 0 8px rgba(196,160,90,.2); }

    /* ── Oracle ── */
    .oracle-match-card {
      border: 1px solid var(--border); padding: 1.1rem 1.25rem;
      display: flex; flex-direction: column; gap: .5rem;
      transition: border-color .2s;
    }
    .oracle-match-card:hover { border-color: var(--gold-dim); }
    .oracle-match-name { font-size: .7rem; letter-spacing: .12em; }
    .oracle-match-score { font-size: .38rem; letter-spacing: .25em; color: var(--gold); text-transform: uppercase; }
    .oracle-match-reason { font-family: var(--serif); font-size: .78rem; color: var(--muted); line-height: 1.7; font-style: italic; }
    .oracle-link-btn {
      font-family: var(--cinzel); font-size: .4rem; letter-spacing: .2em;
      text-transform: uppercase; color: var(--gold); background: transparent;
      border: 1px solid rgba(196,160,90,.3); padding: .3rem .65rem;
      cursor: pointer; align-self: flex-start; transition: border-color .2s;
    }
    .oracle-link-btn:hover { border-color: var(--gold); }

    /* ── Initiation ── */
    #initiation-indicator {
      padding: .5rem 1.25rem .75rem; flex-shrink: 0; cursor: pointer;
      display: flex; align-items: center; gap: .6rem; opacity: .65;
      transition: opacity .2s;
    }
    #initiation-indicator:hover { opacity: 1; }
    .init-icon { font-size: .75rem; color: var(--gold); }
    .init-progress-text { font-size: .4rem; letter-spacing: .25em; color: var(--muted); text-transform: uppercase; }
    #link-requests-indicator {
      padding: .5rem 1.25rem .75rem; flex-shrink: 0; cursor: pointer;
      display: flex; align-items: center; gap: .6rem; opacity: .8;
      transition: opacity .2s;
    }
    #link-requests-indicator:hover { opacity: 1; }

    /* ── Eye of Horus notification system ── */
    .horus-btn-img {
      width: 24px; height: 24px; cursor: pointer; object-fit: contain;
      opacity: .8; transition: opacity .2s; display: block;
    }
    .horus-btn-img:hover { opacity: 1; }
    .horus-badge {
      position: absolute; top: -4px; right: -4px;
      min-width: 14px; height: 14px; border-radius: 7px;
      background: #08090c; border: 1px solid var(--gold);
      color: var(--gold); font-family: var(--cinzel);
      font-size: .32rem; letter-spacing: .04em;
      display: flex; align-items: center; justify-content: center;
      padding: 0 3px; pointer-events: none;
    }
    .horus-badge.hidden { display: none; }
    .horus-panel {
      position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
      background: #0e0e0e; border: 1px solid var(--border);
      width: 260px; max-height: 480px; overflow-y: auto;
      padding: .75rem 0; box-shadow: 0 4px 24px rgba(0,0,0,.7);
    }
    .horus-panel.hidden { display: none; }
    .horus-section-label {
      font-family: var(--cinzel); font-size: .38rem; letter-spacing: .3em;
      color: var(--gold); text-transform: uppercase; padding: .5rem .9rem .3rem;
    }
    .horus-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: .35rem .9rem; gap: .5rem;
    }
    .horus-item-name {
      font-family: var(--cinzel); font-size: .44rem; letter-spacing: .06em;
      flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .horus-item-actions { display: flex; gap: .4rem; flex-shrink: 0; }
    .horus-action-btn {
      font-family: var(--cinzel); font-size: .34rem; letter-spacing: .16em;
      text-transform: uppercase; background: transparent;
      border: 1px solid var(--gold-dim); color: var(--gold);
      padding: .25rem .55rem; cursor: pointer; transition: background .15s;
    }
    .horus-action-btn:hover { background: rgba(196,160,90,.12); }
    .horus-action-btn.decline { border-color: rgba(160,100,80,.5); color: #c47a5a; }
    .horus-action-btn.decline:hover { background: rgba(160,100,80,.1); }
    .horus-empty-note {
      font-family: var(--serif); font-size: .6rem; color: var(--muted);
      padding: .2rem .9rem; font-style: italic;
    }
    .horus-divider { border-top: 1px solid var(--border); margin: .5rem 0; }
    @media (max-width: 600px) { .horus-btn-img { width: 20px; height: 20px; } }

    .profile-link-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: .4rem 0; border-bottom: 1px solid var(--border); gap: .5rem;
    }
    .profile-link-item-name {
      font-size: .62rem; letter-spacing: .06em; color: var(--cream); flex: 1;
    }
    .profile-link-item-actions { display: flex; gap: .4rem; }
    .profile-link-action-btn {
      font-size: .36rem; letter-spacing: .15em; padding: .3rem .7rem;
      background: transparent; border: 1px solid var(--gold);
      color: var(--gold); cursor: pointer; text-transform: uppercase;
      transition: background .2s, color .2s;
    }
    .profile-link-action-btn:hover { background: var(--gold); color: #000; }
    .profile-link-action-btn.decline { border-color: var(--muted); color: var(--muted); }
    .profile-link-action-btn.decline:hover { background: var(--muted); color: #000; }

    #initiation-panel {
      position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
      background: var(--card); border-left: 1px solid var(--border);
      z-index: 50; display: flex; flex-direction: column;
      transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
      overflow-y: auto;
    }
    #initiation-panel.open { transform: translateX(0); }
    .init-task {
      display: flex; align-items: flex-start; gap: .75rem;
      padding: .85rem 0; border-bottom: 1px solid var(--border);
    }
    .init-task:last-child { border-bottom: none; }
    .init-check { font-size: .9rem; flex-shrink: 0; line-height: 1.3; }
    .init-task-label { font-size: .58rem; letter-spacing: .1em; color: var(--text); line-height: 1.6; }
    .init-task-label.done { color: var(--gold); }
    .init-task-label.pending { color: var(--muted); }

    /* ── Starmap ── */
    #starmap-view {
      flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative;
    }
    #starmap-svg { flex: 1; width: 100%; height: 100%; cursor: grab; }
    #starmap-svg:active { cursor: grabbing; }
    #starmap-toolbar {
      position: absolute; top: 1rem; right: 1.25rem; display: flex; gap: .5rem; z-index: 2;
    }
    .starmap-tool-btn {
      font-family: var(--cinzel); font-size: .42rem; letter-spacing: .25em;
      text-transform: uppercase; color: var(--gold); background: var(--bg);
      border: 1px solid var(--gold-dim); padding: .35rem .75rem; cursor: pointer;
      transition: border-color .2s;
    }
    .starmap-tool-btn:hover { border-color: var(--gold); }
    #spark-panel {
      position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
      background: var(--card); border: 1px solid var(--border);
      padding: 1.25rem 1.75rem; text-align: center; z-index: 3;
      display: flex; flex-direction: column; gap: .75rem; min-width: 240px;
    }
    .spark-code {
      font-size: 2rem; letter-spacing: .4em; color: var(--gold);
      font-family: var(--cinzel); text-align: center;
    }
    .spark-timer { font-size: .44rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }

    /* ── Spark announcement message ── */
    .msg-spark {
      text-align: center; padding: .55rem 0; margin: .25rem 0;
      font-family: var(--cinzel); font-size: .58rem; letter-spacing: .35em;
      color: rgba(180,150,60,.9); text-transform: uppercase;
      animation: sparkMsgFade .9s ease both;
    }
    @keyframes sparkMsgFade {
      from { opacity: 0; transform: scaleX(.92); }
      to   { opacity: 1; transform: scaleX(1); }
    }

    /* ── Starmap link flow animation (both-online pair) ── */
    @keyframes smLinkFlow {
      0%   { stroke-dashoffset: 24; }
      100% { stroke-dashoffset: 0; }
    }
    .sm-link-live {
      stroke-dasharray: 6 4;
      animation: smLinkFlow 1.2s linear infinite;
    }

    /* ── Mini constellation in profile ── */
    #profile-constellation { width: 100%; aspect-ratio: 1; max-height: 200px; }
    #profile-constellation-section {
      cursor: pointer; position: relative; border-radius: 4px;
      transition: background .18s;
    }
    #profile-constellation-section:hover { background: rgba(212,175,55,.05); }
    #profile-constellation-section .const-expand {
      position: absolute; top: 0; right: 0; font-size: .7rem; color: var(--gold);
      opacity: 0; transition: opacity .18s; pointer-events: none;
    }
    #profile-constellation-section:hover .const-expand { opacity: .55; }

    /* ── Events sidebar ── */
    .sidebar-event-item {
      font-size: .52rem; letter-spacing: .12em; text-transform: uppercase;
      color: var(--muted); padding: .4rem .6rem;
      border-left: 2px solid transparent;
      transition: color .2s, border-color .2s; cursor: pointer;
    }
    .sidebar-event-item:hover { color: var(--text); }
    .sidebar-event-item.active { color: var(--gold); border-left-color: var(--gold); }
    .sidebar-event-date { font-size: .38rem; letter-spacing: .15em; color: var(--muted); margin-top: .15rem; }
    .sidebar-event-past { opacity: .45; }

    /* ── Events views ── */
    #events-view {
      flex: 1; overflow-y: auto; padding: 2.5rem 3rem; max-width: 860px;
      width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem;
    }
    .events-section-title { font-size: .52rem; letter-spacing: .4em; color: var(--gold); text-transform: uppercase; }
    .event-card {
      border: 1px solid var(--border); padding: 1.5rem 1.75rem; cursor: pointer;
      transition: border-color .2s, background .2s;
    }
    .event-card:hover { border-color: var(--gold-dim); background: rgba(196,160,90,.03); }
    .event-card-title { font-size: .92rem; letter-spacing: .06em; color: var(--cream); margin-bottom: .4rem; }
    .event-card-meta { font-size: .44rem; letter-spacing: .25em; color: var(--gold); text-transform: uppercase; }
    .event-card-past { opacity: .5; }

    #event-detail-view {
      flex: 1; overflow-y: auto; padding: 2.5rem 3rem; max-width: 860px;
      width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.75rem;
    }
    .event-detail-title { font-size: 1.4rem; font-weight: 400; letter-spacing: .06em; color: var(--cream); }
    .event-detail-meta { font-size: .46rem; letter-spacing: .28em; color: var(--gold); text-transform: uppercase; line-height: 1.8; }
    .event-detail-desc { font-family: var(--serif); font-size: .95rem; color: var(--text); line-height: 1.85; }
    .event-members-list { display: flex; flex-wrap: wrap; gap: .5rem; }
    .event-member-chip {
      font-size: .44rem; letter-spacing: .2em; text-transform: uppercase;
      padding: .25rem .65rem; border: 1px solid var(--border); color: var(--muted);
    }
    .event-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
    .event-gallery-img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); }
    .event-gallery-caption { font-size: .42rem; letter-spacing: .15em; color: var(--muted); text-align: center; margin-top: .3rem; }

    #event-create-modal .modal-card { max-width: 520px; }
    #event-create-modal input, #event-create-modal textarea {
      width: 100%; background: transparent; border: 1px solid var(--border);
      color: var(--cream); font-family: var(--serif); font-size: .88rem;
      padding: .65rem .85rem; outline: none; transition: border-color .2s;
    }
    #event-create-modal input:focus, #event-create-modal textarea:focus { border-color: var(--gold-dim); }

    /* ── Library ── */
    #library-view {
      flex: 1; overflow-y: auto; display: flex; flex-direction: column;
      padding: 2.5rem 3rem; gap: 2rem; max-width: 860px; width: 100%;
      margin: 0 auto;
    }
    .library-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
    .library-search {
      flex: 1; min-width: 180px;
      background: transparent; border: 1px solid var(--border);
      color: var(--cream); font-family: var(--serif); font-size: .9rem;
      padding: .6rem 1rem; outline: none; transition: border-color .2s;
    }
    .library-search:focus { border-color: var(--gold-dim); }
    .library-tab {
      font-family: var(--cinzel); font-size: .46rem; letter-spacing: .35em;
      text-transform: uppercase; color: var(--muted); cursor: pointer;
      padding: .5rem .8rem; border-bottom: 2px solid transparent;
      transition: color .2s, border-color .2s;
    }
    .library-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
    .library-grid { display: flex; flex-direction: column; gap: 1.25rem; }
    .library-card {
      border: 1px solid var(--border); padding: 1.5rem 1.75rem;
      cursor: pointer; transition: border-color .2s, background .2s;
    }
    .library-card:hover { border-color: var(--gold-dim); background: rgba(196,160,90,.03); }
    .library-card-title { font-size: .92rem; letter-spacing: .06em; color: var(--cream); margin-bottom: .5rem; }
    .library-card-meta { font-size: .46rem; letter-spacing: .25em; color: var(--gold); text-transform: uppercase; margin-bottom: .75rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
    .library-card-preview { font-family: var(--serif); font-size: .88rem; color: var(--muted); line-height: 1.7; }
    .author-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
    .library-private-badge {
      font-size: .38rem; letter-spacing: .15em; color: var(--muted);
      border: 1px solid var(--border); padding: 1px 6px; margin-left: .5rem;
    }

    #article-view {
      flex: 1; overflow-y: auto; padding: 3rem 4rem; max-width: 760px;
      width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem;
    }
    .article-back { font-size: .46rem; letter-spacing: .35em; color: var(--gold); text-transform: uppercase; cursor: pointer; opacity: .7; transition: opacity .2s; }
    .article-back:hover { opacity: 1; }
    .article-title { font-size: 1.6rem; font-weight: 400; letter-spacing: .06em; color: var(--cream); line-height: 1.3; }
    .article-byline { font-size: .46rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
    .article-body { font-family: var(--serif); font-size: 1.05rem; color: var(--text); line-height: 1.85; white-space: pre-wrap; max-width: 680px; user-select: none; }
    .editor-draft-indicator {
      font-size: .38rem; letter-spacing: .22em; text-transform: uppercase;
      color: var(--gold); opacity: .65; display: flex; align-items: center; gap: .35rem;
    }
    .editor-draft-dot {
      width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
      flex-shrink: 0; animation: draftPulse 2s ease-in-out infinite;
    }
    @keyframes draftPulse {
      0%, 100% { opacity: .55; } 50% { opacity: 1; }
    }

    .article-edit-btn {
      display: inline-flex; align-items: center; gap: .4rem;
      background: none; border: 1px solid var(--border); border-radius: 2px;
      color: var(--muted); font-family: var(--cinzel); font-size: .42rem;
      letter-spacing: .2em; text-transform: uppercase;
      padding: .4rem 1.1rem; cursor: pointer; align-self: flex-start;
      transition: color .2s, border-color .2s;
    }
    .article-edit-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

    /* ── Collaborative article blocks ── */
    .collab-block { position: relative; padding-left: 1.25rem; margin-bottom: 1.75rem; }
    .collab-dot-wrap {
      position: absolute; left: 0; top: .45rem;
    }
    .collab-block-dot {
      width: 7px; height: 7px; border-radius: 50%; display: block; cursor: default;
      position: relative;
    }
    .collab-block-dot::after {
      content: attr(data-name);
      position: absolute; left: 14px; top: -3px;
      background: var(--card); border: 1px solid var(--border);
      color: var(--text); font-family: var(--cinzel);
      font-size: .38rem; letter-spacing: .15em;
      padding: 2px 7px; white-space: nowrap;
      pointer-events: none; z-index: 20;
      opacity: 0; transition: opacity .15s;
    }
    .collab-block-dot:hover::after { opacity: 1; }
    .collab-block-content { font-family: var(--serif); font-size: 1.05rem; color: var(--text); line-height: 1.85; white-space: pre-wrap; user-select: none; }
    .collab-edit-btn {
      font-size: .52rem; color: var(--muted); cursor: pointer;
      opacity: 0; transition: opacity .15s, color .15s;
      margin-left: .5rem; vertical-align: middle;
    }
    .collab-block:hover .collab-edit-btn { opacity: 1; }
    .collab-edit-btn:hover { color: var(--gold); }
    .collab-block-editor {
      font-family: var(--serif); font-size: 1.05rem; color: var(--cream);
      line-height: 1.85; outline: none; caret-color: var(--gold);
      word-break: break-word; white-space: pre-wrap; min-height: 3em;
      border-bottom: 1px solid var(--gold-dim);
    }
    /* Contribution compose area */
    .contrib-compose {
      margin-top: 2.5rem; padding-top: 1.5rem;
      border-top: 1px solid var(--border);
      display: flex; flex-direction: column; gap: 1rem;
    }
    .contrib-compose-label { font-size: .44rem; letter-spacing: .35em; color: var(--gold); text-transform: uppercase; }
    .contrib-body {
      min-height: 100px; background: transparent;
      color: var(--cream); font-family: var(--serif); font-size: 1.05rem;
      line-height: 1.85; outline: none; caret-color: var(--gold);
      word-break: break-word; white-space: pre-wrap;
      border-bottom: 1px solid var(--border); padding-bottom: .5rem;
      transition: border-color .2s;
    }
    .contrib-body:focus { border-bottom-color: var(--gold-dim); }
    .contrib-body:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
    /* Collab badge on article cards */
    .collab-badge {
      font-size: .36rem; letter-spacing: .12em; color: var(--gold-dim);
      border: 1px solid var(--gold-dim); padding: 1px 5px; margin-left: .4rem; vertical-align: middle;
    }

    #article-editor {
      flex: 1; overflow: hidden; max-width: 760px;
      width: 100%; margin: 0 auto; display: flex; flex-direction: column;
    }
    #editor-scroll-area {
      flex: 1; overflow-y: auto; padding: 3rem 4rem;
      display: flex; flex-direction: column; gap: 1.75rem;
    }
    #editor-footer {
      flex-shrink: 0; padding: .75rem 4rem 1.25rem;
      display: flex; justify-content: flex-end; align-items: center;
      gap: 1rem; border-top: 1px solid var(--border);
    }
    #editor-save-btn.pulsing {
      animation: publishPulse 1.4s ease-in-out infinite;
    }
    @keyframes publishPulse {
      0%, 100% { box-shadow: 0 0 6px rgba(196,160,90,.4); }
      50%       { box-shadow: 0 0 28px rgba(196,160,90,.85), 0 0 56px rgba(196,160,90,.3); }
    }
    #editor-title-input {
      background: transparent; border: none; border-bottom: 1px solid var(--border);
      color: var(--cream); font-family: var(--cinzel); font-size: 1.4rem;
      letter-spacing: .06em; padding: .5rem 0; outline: none; width: 100%;
      transition: border-color .2s;
    }
    #editor-title-input:focus { border-bottom-color: var(--gold-dim); }
    #editor-title-input::placeholder { color: var(--muted); }
    #editor-body {
      flex: 1; min-height: 320px; background: transparent;
      color: var(--cream); font-family: var(--serif); font-size: 1.05rem;
      line-height: 1.85; outline: none; caret-color: var(--gold);
      word-break: break-word; white-space: pre-wrap;
    }
    #editor-body:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
    .editor-toolbar { display: flex; gap: .65rem; align-items: center; }
    .editor-btn {
      font-family: var(--cinzel); font-size: .42rem; letter-spacing: .25em;
      text-transform: uppercase; color: var(--muted); background: transparent;
      border: 1px solid var(--border); padding: .3rem .65rem; cursor: pointer;
      transition: color .2s, border-color .2s;
    }
    .editor-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
    .editor-visibility { display: flex; align-items: center; gap: .65rem; }
    .editor-vis-label { font-size: .44rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
    .editor-dest { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
    .editor-dest-label { font-size: .44rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
    .editor-dest-btn {
      font-family: var(--cinzel); font-size: .42rem; letter-spacing: .25em;
      text-transform: uppercase; color: var(--muted); background: transparent;
      border: 1px solid var(--border); padding: .3rem .75rem; cursor: pointer;
      transition: color .2s, border-color .2s;
    }
    .editor-dest-btn.active { color: var(--gold); border-color: var(--gold-dim); }
    .editor-dest-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
    .library-card-actions { margin-top: .6rem; display: flex; align-items: center; gap: .75rem; }
    .library-card-save {
      font-family: var(--cinzel); font-size: .36rem; letter-spacing: .12em;
      color: var(--muted); border: 1px solid var(--border); padding: 2px 7px;
      cursor: pointer; transition: color .15s, border-color .15s; text-transform: uppercase;
      background: transparent;
    }
    .library-card-save:hover { color: var(--gold); border-color: var(--gold-dim); }
    .library-card-save.saved { color: var(--gold); border-color: var(--gold-dim); }
    .profile-section-sublabel {
      font-size: .38rem; letter-spacing: .3em; color: var(--muted);
      text-transform: uppercase; margin-bottom: .5rem; margin-top: .85rem;
    }
    #journal-view {
      flex: 1; overflow-y: auto; display: flex; flex-direction: column;
      padding: 2.5rem 3rem; gap: 2rem; max-width: 860px; width: 100%;
      margin: 0 auto;
    }

    /* ── Mobile defaults (hidden on desktop) ── */
    #mobile-hamburger, #sidebar-backdrop, #mobile-bottom-nav { display: none; }

    @media (max-width: 768px) {
      /* Sidebar: slide-in overlay from left */
      .sidebar {
        position: fixed; top: 0; left: 0; height: 100svh; z-index: 60;
        width: min(85vw, 310px);
        transform: translateX(-100%);
        transition: transform .35s cubic-bezier(.4,0,.2,1);
      }
      .sidebar.open { transform: translateX(0); }

      /* Backdrop behind open sidebar */
      #sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 59;
        background: rgba(0,0,0,.55); opacity: 0; pointer-events: none;
        transition: opacity .3s;
      }
      #sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

      /* Reserve bottom of layout for fixed nav bar */
      .temple-layout { padding-bottom: 56px; }

      /* Hamburger menu button */
      #mobile-hamburger {
        display: flex; position: fixed; top: .65rem; left: .65rem; z-index: 65;
        width: 40px; height: 40px;
        align-items: center; justify-content: center;
        background: rgba(14,14,14,.92); border: 1px solid var(--border);
        color: var(--gold); font-size: 1.1rem; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }

      /* Room header: indent to clear hamburger */
      .room-header { padding-left: 3.75rem; }

      /* Bottom navigation bar */
      #mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        height: 56px; z-index: 40;
        background: var(--card); border-top: 1px solid var(--border);
      }
      .mobile-nav-btn {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 3px;
        color: var(--muted); background: none; border: none;
        font-family: var(--cinzel); cursor: pointer;
        -webkit-tap-highlight-color: transparent; transition: color .2s; padding: 0;
      }
      .mobile-nav-btn.active { color: var(--gold); }
      .mobile-nav-btn i { font-size: 1.25rem; }
      .mobile-nav-btn span { font-size: .26rem; letter-spacing: .15em; text-transform: uppercase; }

      /* Profile panel: full screen on mobile */
      #profile-panel { width: 100vw; border-left: none; }

      /* Padding reductions */
      .compose-area { padding: .65rem .9rem; }
      .messages-area { padding: 1.25rem 1rem; }
      #library-view, #journal-view { padding: 1.5rem 1rem; }
      #article-view { padding: 2rem 1.25rem; }
      #editor-scroll-area { padding: 2rem 1.25rem; }
      #editor-footer { padding: .75rem 1.25rem 1.25rem; }
      #events-view, #event-detail-view { padding: 1.5rem 1rem; }
      #marketplace-view { padding: 1rem; }
      #listing-detail-view, #listing-editor-view { padding: 1rem; }

      /* Minimum tap targets (44px) */
      .sidebar-room { min-height: 44px; display: flex; align-items: center; }
      .sidebar-member, .sidebar-dm-item, .sidebar-event-item { min-height: 44px; }
      .btn-primary { min-height: 48px; }
      .btn-secondary, .btn-transmit { min-height: 44px; }
      #compose-input { min-height: 44px; }
      .starmap-tool-btn { min-height: 44px; padding: .5rem 1rem; }
      .mkt-cat { min-height: 40px; display: inline-flex; align-items: center; }
      .library-tab { min-height: 40px; display: inline-flex; align-items: center; }

      /* Prevent iOS auto-zoom on input focus (font must be >= 16px) */
      .field-input, #compose-input, .mkt-field, .library-search,
      #editor-title-input, #bio-textarea { font-size: 16px; }

      /* Marketplace: single column */
      .mkt-grid { grid-template-columns: 1fr; }
    }

    /* ── Profile panel ── */
    #profile-backdrop {
      position: fixed; inset: 0; z-index: 49;
      display: none;
      pointer-events: none;
    }
    #profile-backdrop.open { display: block; }

    #profile-panel {
      position: fixed;
      top: 0; right: 0;
      width: 360px; height: 100vh;
      background: var(--card);
      border-left: 1px solid var(--border);
      z-index: 50;
      display: flex; flex-direction: column;
      transform: translateX(100%);
      transition: transform .35s cubic-bezier(.4,0,.2,1);
      overflow-y: auto;
    }
    #profile-panel.open { transform: translateX(0); }

    #profile-edge-trigger {
      position: fixed; top: 0; right: 0;
      width: 20px; height: 100vh;
      z-index: 48; pointer-events: auto;
    }
    @media (pointer: coarse) { #profile-edge-trigger { display: none; } }

    .profile-header {
      padding: 1.5rem 1.5rem 1rem;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: flex-start; justify-content: space-between;
      flex-shrink: 0;
    }
    .profile-close {
      font-size: .62rem; color: var(--muted); cursor: pointer;
      padding: .2rem .4rem; transition: color .15s; flex-shrink: 0; line-height: 1;
    }
    .profile-close:hover { color: var(--text); }
    .profile-name-display {
      font-family: var(--cinzel);
      font-size: 1.05rem; font-weight: 400;
      letter-spacing: .1em; color: var(--cream);
    }
    .profile-dot-row { display: flex; align-items: center; gap: .6rem; margin-top: .55rem; }
    .profile-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
    .profile-inducted {
      font-size: .48rem; letter-spacing: .25em;
      text-transform: uppercase; color: var(--muted);
    }
    .profile-body {
      padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; flex: 1; user-select: none;
    }
    .profile-section-label {
      font-size: .44rem; letter-spacing: .4em;
      color: var(--gold); text-transform: uppercase; margin-bottom: .7rem;
    }
    .bio-text {
      font-family: var(--serif); font-size: .82rem; color: var(--text);
      line-height: 1.85; white-space: pre-wrap; word-break: break-word;
    }
    .bio-placeholder {
      font-family: var(--serif); font-size: .78rem; color: var(--muted);
      font-style: italic; line-height: 1.7;
    }
    .bio-divider {
      height: 1px; background: var(--border); margin-top: .25rem;
    }
    #bio-textarea {
      width: 100%; box-sizing: border-box;
      background: rgba(196,160,90,.06); border: 1px solid var(--border);
      color: var(--text); font-family: var(--serif); font-size: .8rem;
      line-height: 1.8; padding: .6rem .7rem; resize: vertical;
      border-radius: 3px; outline: none; min-height: 80px;
    }
    #bio-textarea:focus { border-color: rgba(196,160,90,.4); }
    .bio-edit-btn {
      background: none; border: none; cursor: pointer; padding: 0;
      color: var(--gold); font-size: 14px; line-height: 1;
      opacity: .55; flex-shrink: 0; transition: opacity .15s; vertical-align: middle;
    }
    .bio-edit-btn:hover { opacity: 1; }
    .bio-action-btn {
      font-family: 'Cinzel', serif; font-size: .42rem; letter-spacing: .18em;
      text-transform: uppercase; background: none; border: 1px solid var(--border);
      color: var(--gold); cursor: pointer; padding: .3rem .7rem; border-radius: 2px;
    }
    .bio-action-btn:hover { background: rgba(196,160,90,.1); }
    .profile-field { display: flex; flex-direction: column; gap: .4rem; }
    .profile-field-label { font-size: .44rem; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
    .profile-field-input {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--cream); font-family: var(--serif);
      font-size: .88rem; padding: .65rem .85rem;
      outline: none; transition: border-color .2s; width: 100%;
    }
    .profile-field-input:focus { border-color: var(--gold-dim); }
    .profile-field-input[readonly] { color: var(--muted); cursor: default; }
    .profile-save-btn {
      font-family: var(--cinzel); font-size: .6rem;
      letter-spacing: .3em; text-transform: uppercase;
      color: #08090c; background: var(--gold); border: none;
      padding: .9rem 2rem; cursor: pointer;
      transition: background .2s; width: 100%; margin-top: .25rem;
    }
    .profile-save-btn:hover { background: #e8d08a; }
    .profile-save-btn:disabled { opacity: .5; cursor: default; }
    .profile-save-note {
      font-size: .46rem; letter-spacing: .2em;
      color: var(--muted); text-align: center; min-height: 1em; margin-top: .4rem;
    }
    .profile-chart-placeholder {
      border: 1px solid var(--border);
      display: flex; align-items: center; justify-content: center;
      height: 150px; color: var(--muted);
      font-size: .46rem; letter-spacing: .3em; text-transform: uppercase;
      font-family: var(--cinzel);
    }
    #profile-hd-area svg { display: block; width: 100%; max-width: 320px; margin: 0 auto; }
    .hd-headline { text-align: center; margin-bottom: 1rem; }
    .hd-type-label { font-family: var(--cinzel); font-size: .72rem; letter-spacing: .38em; color: var(--gold); text-transform: uppercase; }
    .hd-meta-label { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .22em; color: var(--muted); margin-top: .25rem; }
    .hd-interp-section { margin-top: .5rem; border-top: 1px solid var(--border); }
    .hd-interp-toggle { display: flex; align-items: center; justify-content: space-between; padding: .55rem 0; cursor: pointer; user-select: none; }
    .hd-interp-toggle-label { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
    .hd-interp-toggle-arrow { font-size: .65rem; color: var(--muted); transition: transform .2s; }
    .hd-interp-toggle-arrow.open { transform: rotate(180deg); }
    .hd-interp-body { font-family: var(--serif); font-size: .76rem; line-height: 1.7; color: var(--text); padding-bottom: .75rem; display: none; }
    .hd-interp-body.open { display: block; }
    .hd-overlay-btn { margin-top: 1rem; width: 100%; font-family: var(--cinzel); font-size: .42rem; letter-spacing: .22em; text-transform: uppercase; background: none; border: 1px solid var(--border); color: var(--gold); padding: .55rem 1rem; cursor: pointer; transition: border-color .2s, color .2s; }
    .hd-overlay-btn:hover { border-color: var(--gold); }
    .sidebar-member { cursor: pointer; }
    .sidebar-member:hover .member-name { text-decoration: underline; }
    /* Expand flyout */
    #chart-flyout { display: none; position: fixed; inset: 0; z-index: 200; background: transparent; align-items: center; justify-content: center; pointer-events: none; }
    #chart-flyout.open { display: flex; }
    #chart-flyout-inner { position: relative; background: var(--card); border: 1px solid var(--border); box-shadow: 0 0 60px rgba(0,0,0,.7); width: min(680px, 92vw); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; pointer-events: auto; }
    #chart-flyout-close { position: absolute; top: .75rem; right: 1rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; z-index: 1; }
    #chart-flyout-close:hover { color: var(--cream); }
    #chart-flyout-svg-wrap { flex: 1; overflow: hidden; cursor: grab; }
    #chart-flyout-svg-wrap:active { cursor: grabbing; }
    .chart-expand-btn { position: absolute; top: .35rem; right: .35rem; background: none; border: none; color: var(--muted); font-size: .72rem; cursor: pointer; padding: .2rem .3rem; opacity: .6; z-index: 2; }
    .chart-expand-btn:hover { opacity: 1; color: var(--gold); }
    .chart-section-wrap { position: relative; }
    /* Interpretation overlay */
    #interp-overlay { display: none; position: fixed; inset: 0; z-index: 150; background: transparent; align-items: flex-start; justify-content: center; overflow-y: auto; pointer-events: none; }
    #interp-overlay.open { display: flex; }
    #interp-overlay-inner { background: var(--card); border: 1px solid var(--border); box-shadow: 0 0 60px rgba(0,0,0,.7); width: min(680px, 95vw); margin: 2rem auto; padding: 2rem; position: relative; pointer-events: auto; }
    #interp-overlay-close { position: absolute; top: 1rem; right: 1.25rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
    #interp-overlay-close:hover { color: var(--cream); }
    .interp-section { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
    .interp-section:last-child { border-bottom: none; }
    .interp-section-title { font-family: var(--cinzel); font-size: .54rem; letter-spacing: .35em; color: var(--gold); text-transform: uppercase; margin-bottom: 1rem; }
    .interp-block { margin-bottom: .75rem; }
    .interp-block-label { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; margin-bottom: .35rem; }
    .interp-block-text { font-family: var(--serif); font-size: .8rem; line-height: 1.7; color: var(--text); }
    /* Composite HD overlay */
    #composite-overlay { display: none; position: fixed; inset: 0; z-index: 160; background: transparent; align-items: center; justify-content: center; pointer-events: none; }
    #composite-overlay.open { display: flex; }
    #composite-overlay-inner { background: var(--card); border: 1px solid var(--border); box-shadow: 0 0 60px rgba(0,0,0,.7); width: min(560px, 95vw); max-height: 90vh; overflow-y: auto; padding: 1.5rem; position: relative; pointer-events: auto; }
    #composite-overlay-close { position: absolute; top: .75rem; right: 1rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
    #composite-overlay-close:hover { color: var(--cream); }
    #hd-design-overlay { display: none; position: fixed; inset: 0; z-index: 150; background: transparent; align-items: flex-start; justify-content: center; overflow-y: auto; pointer-events: none; }
    #hd-design-overlay.open { display: flex; }
    #hd-design-overlay-inner { background: var(--card); border: 1px solid var(--border); box-shadow: 0 0 60px rgba(0,0,0,.7); width: min(680px, 95vw); margin: 2rem auto; padding: 2rem; position: relative; pointer-events: auto; }
    #hd-design-overlay-close { position: absolute; top: 1rem; right: 1.25rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
    #hd-design-overlay-close:hover { color: var(--cream); }
    /* Western/Vedic toggle */
    .chart-tradition-toggle { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
    .chart-tradition-toggle button { flex: 1; text-align: center; font-family: var(--cinzel); font-size: .38rem; letter-spacing: .18em; text-transform: uppercase; background: none; border: 1px solid var(--border); color: var(--muted); padding: .3rem .7rem; cursor: pointer; transition: all .2s; }
    .chart-tradition-toggle button.active { border-color: var(--gold); color: var(--gold); }
    .chart-explore-btn { display: block; margin-top: .6rem; width: 100%; text-align: center; font-family: var(--cinzel); font-size: .4rem; letter-spacing: .22em; text-transform: uppercase; background: none; border: 1px solid rgba(196,160,90,.35); color: var(--muted); padding: .45rem; cursor: pointer; transition: all .2s; }
    .chart-explore-btn:hover { border-color: var(--gold); color: var(--gold); }

    /* ── Tarot ── */
    #profile-tarot-section { border-top: 1px solid var(--border); margin-top: .25rem; }
    #tarot-section-head {
      display: flex; align-items: center; justify-content: space-between;
      cursor: pointer; padding: .5rem 0; user-select: none;
    }
    #tarot-section-head:hover .tarot-head-label { color: var(--cream); }
    .tarot-head-label { font-family: var(--cinzel); font-size: .44rem; letter-spacing: .45em; color: var(--gold); text-transform: uppercase; transition: color .2s; }
    .tarot-chevron { font-size: .6rem; color: var(--muted); transition: transform .25s; line-height: 1; }
    #profile-tarot-section.expanded .tarot-chevron { transform: rotate(180deg); }
    #tarot-body { display: none; padding-bottom: .75rem; }
    #profile-tarot-section.expanded #tarot-body { display: flex; flex-direction: column; align-items: center; gap: .85rem; }
    .tarot-card-scene { perspective: 800px; width: 140px; height: 245px; cursor: pointer; }
    .tarot-card-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.4,0,.2,1); }
    .tarot-card-inner.flipped { transform: rotateY(180deg); }
    .tarot-card-face, .tarot-card-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 4px; overflow: hidden; }
    .tarot-card-face { transform: rotateY(180deg); }
    .tarot-card-face img, .tarot-card-back img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .tarot-card-name { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .25em; color: var(--gold); text-transform: uppercase; text-align: center; }
    .tarot-pull-btn {
      font-family: var(--cinzel); font-size: .44rem; letter-spacing: .28em; text-transform: uppercase;
      background: none; border: 1px solid var(--border); color: var(--muted);
      padding: .5rem 1.2rem; cursor: pointer; transition: color .2s, border-color .2s;
    }
    .tarot-pull-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
    .tarot-pull-btn:disabled { opacity: .4; cursor: default; }
    #tarot-pulled-label { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .25em; color: var(--gold); text-align: center; display: none; }
    /* Tarot card full overlay */
    #tarot-card-overlay { display: none; position: fixed; inset: 0; z-index: 250; background: transparent; align-items: flex-start; justify-content: center; overflow-y: auto; pointer-events: none; }
    #tarot-card-overlay.open { display: flex; }
    #tarot-card-overlay-inner { background: var(--card); border: 1px solid var(--border); box-shadow: 0 0 80px rgba(0,0,0,.85); width: min(480px, 94vw); margin: 2.5rem auto; padding: 2.5rem 2rem 2.5rem; position: relative; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
    #tarot-overlay-close { position: absolute; top: .9rem; right: 1.1rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; line-height: 1; }
    #tarot-overlay-close:hover { color: var(--cream); }
    #tarot-overlay-img { max-width: 260px; width: 100%; border-radius: 4px; display: block; }
    #tarot-overlay-name { font-family: var(--cinzel); font-size: .76rem; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; text-align: center; }
    #tarot-overlay-interp { font-family: var(--serif); font-size: .88rem; color: var(--text); line-height: 1.85; max-width: 400px; text-align: left; }
    #tarot-overlay-interp p { margin-bottom: 1em; }
    #tarot-overlay-interp p:last-child { margin-bottom: 0; }

    /* ── Marketplace ── */
    #marketplace-view { display: flex; flex-direction: column; gap: 1.5rem; padding-bottom: 2rem; }
    .mkt-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
    .mkt-title { font-family: var(--cinzel); font-size: .56rem; letter-spacing: .45em; color: var(--gold); text-transform: uppercase; }
    .mkt-ethos { background: rgba(196,160,90,.06); border: 1px solid rgba(196,160,90,.18); padding: 1rem 1.25rem; border-radius: 2px; }
    .mkt-ethos-title { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .35em; color: var(--gold); text-transform: uppercase; margin-bottom: .5rem; }
    .mkt-ethos-body { font-family: var(--cinzel); font-size: .48rem; letter-spacing: .07em; color: var(--muted); line-height: 1.75; }
    .mkt-cats { display: flex; gap: .4rem; flex-wrap: wrap; }
    .mkt-cat { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .28em; text-transform: uppercase; padding: .4rem 1rem; border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all .18s; background: none; }
    .mkt-cat.active, .mkt-cat:hover { border-color: var(--gold); color: var(--gold); }
    .mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
    .mkt-card { background: var(--card); border: 1px solid var(--border); padding: 1rem; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
    .mkt-card:hover { border-color: rgba(196,160,90,.5); box-shadow: 0 2px 16px rgba(0,0,0,.25); }
    .mkt-card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: .75rem; background: rgba(255,255,255,.04); }
    .mkt-card-cat { font-family: var(--cinzel); font-size: .34rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); opacity: .7; margin-bottom: .3rem; }
    .mkt-card-title { font-family: var(--cinzel); font-size: .54rem; letter-spacing: .08em; color: var(--cream); margin-bottom: .35rem; line-height: 1.4; }
    .mkt-card-seller { font-family: var(--cinzel); font-size: .4rem; letter-spacing: .14em; color: var(--muted); margin-bottom: .5rem; }
    .mkt-card-price { font-family: var(--cinzel); font-size: .54rem; letter-spacing: .1em; color: var(--gold); }
    .mkt-card-stars { font-size: .52rem; color: var(--gold); opacity: .85; }
    .mkt-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
    .trust-badge { font-family: var(--cinzel); font-size: .32rem; letter-spacing: .22em; text-transform: uppercase; padding: .15rem .5rem; border: 1px solid; }
    .trust-badge.newcomer { color: var(--muted); border-color: var(--border); }
    .trust-badge.adept { color: #a8c4a2; border-color: #a8c4a2; }
    .mkt-empty { font-family: var(--cinzel); font-size: .52rem; letter-spacing: .1em; color: var(--muted); padding: 2.5rem 0; text-align: center; }

    /* Listing detail */
    #listing-detail-view { display: flex; flex-direction: column; gap: 1.25rem; padding-bottom: 2rem; }
    .listing-detail-img { width: 100%; max-height: 320px; object-fit: cover; }
    .listing-detail-cat { font-family: var(--cinzel); font-size: .36rem; letter-spacing: .35em; text-transform: uppercase; color: var(--gold); opacity: .75; margin-bottom: .3rem; }
    .listing-detail-title { font-family: var(--cinzel); font-size: .72rem; letter-spacing: .1em; color: var(--cream); line-height: 1.35; }
    .listing-detail-seller { font-family: var(--cinzel); font-size: .44rem; letter-spacing: .12em; color: var(--muted); margin-top: .4rem; cursor: pointer; }
    .listing-detail-seller:hover { color: var(--cream); }
    .listing-detail-price { font-family: var(--cinzel); font-size: .72rem; letter-spacing: .12em; color: var(--gold); margin-top: .5rem; }
    .listing-detail-fee-note { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .1em; color: var(--muted); margin-top: .15rem; }
    .listing-detail-desc { font-family: var(--cinzel); font-size: .52rem; letter-spacing: .07em; color: var(--text); line-height: 1.8; white-space: pre-wrap; }
    .listing-detail-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
    .listing-tag { font-family: var(--cinzel); font-size: .34rem; letter-spacing: .2em; text-transform: uppercase; padding: .2rem .6rem; border: 1px solid var(--border); color: var(--muted); }
    .mkt-buy-btn { font-family: var(--cinzel); font-size: .46rem; letter-spacing: .22em; text-transform: uppercase; background: none; border: 1px solid var(--gold); color: var(--gold); padding: .75rem 2rem; cursor: pointer; transition: all .2s; }
    .mkt-buy-btn:hover { background: rgba(196,160,90,.12); }
    .mkt-buy-btn:disabled { opacity: .4; cursor: default; }
    .listing-reviews-title { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); padding-top: .5rem; border-top: 1px solid var(--border); }
    .review-item { padding: .75rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
    .review-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .3rem; }
    .review-author { font-family: var(--cinzel); font-size: .4rem; letter-spacing: .12em; color: var(--cream); }
    .review-stars { color: var(--gold); font-size: .52rem; }
    .review-body { font-family: var(--cinzel); font-size: .48rem; letter-spacing: .07em; color: var(--muted); line-height: 1.65; }
    .mkt-dispute-section { background: rgba(255,80,80,.04); border: 1px solid rgba(255,80,80,.15); padding: .9rem 1.1rem; }
    .mkt-dispute-title { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .25em; text-transform: uppercase; color: rgba(255,130,130,.7); margin-bottom: .5rem; }
    .mkt-dispute-textarea { width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(255,80,80,.25); color: var(--cream); font-family: var(--cinzel); font-size: .48rem; letter-spacing: .06em; padding: .6rem; resize: vertical; min-height: 80px; }
    .mkt-dispute-btn { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .22em; text-transform: uppercase; background: none; border: 1px solid rgba(255,80,80,.4); color: rgba(255,130,130,.8); padding: .5rem 1.25rem; cursor: pointer; margin-top: .6rem; transition: all .2s; }
    .mkt-dispute-btn:hover { background: rgba(255,80,80,.08); }

    /* Listing editor */
    #listing-editor-view { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 2rem; max-width: 640px; }
    .mkt-field-label { font-family: var(--cinzel); font-size: .38rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; display: block; }
    .mkt-field { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--cream); font-family: var(--cinzel); font-size: .52rem; letter-spacing: .07em; padding: .65rem .8rem; }
    .mkt-field:focus { outline: none; border-color: rgba(196,160,90,.45); }
    .mkt-field-note { font-family: var(--cinzel); font-size: .36rem; letter-spacing: .12em; color: var(--muted); margin-top: .2rem; }
    .mkt-cat-select { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
    .mkt-cat-opt { font-family: var(--cinzel); font-size: .36rem; letter-spacing: .2em; text-transform: uppercase; padding: .35rem .85rem; border: 1px solid var(--border); color: var(--muted); cursor: pointer; background: none; transition: all .18s; }
    .mkt-cat-opt.selected { border-color: var(--gold); color: var(--gold); }

    /* Stripe onboarding view */
    #stripe-onboard-view { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 3rem 0; text-align: center; }
    .stripe-onboard-icon { font-size: 2.5rem; opacity: .4; }
    .stripe-onboard-title { font-family: var(--cinzel); font-size: .62rem; letter-spacing: .35em; text-transform: uppercase; color: var(--gold); }
    .stripe-onboard-body { font-family: var(--cinzel); font-size: .52rem; letter-spacing: .08em; color: var(--muted); line-height: 1.85; max-width: 400px; }

    /* Payment modal */
    #payment-modal { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(8,9,12,.92); align-items: center; justify-content: center; }
    #payment-modal.open { display: flex; }
    #payment-modal-inner { background: var(--card); border: 1px solid var(--border); width: min(440px, 95vw); padding: 2rem; position: relative; }
    #payment-modal-close { position: absolute; top: .75rem; right: 1rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
    #payment-modal-close:hover { color: var(--cream); }
    #payment-modal-title { font-family: var(--cinzel); font-size: .52rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; }
    #payment-modal-amount { font-family: var(--cinzel); font-size: .64rem; letter-spacing: .12em; color: var(--cream); margin-bottom: 1.25rem; }
    #payment-element-mount { margin-bottom: 1.25rem; }
    #payment-modal-submit { width: 100%; font-family: var(--cinzel); font-size: .44rem; letter-spacing: .28em; text-transform: uppercase; background: none; border: 1px solid var(--gold); color: var(--gold); padding: .85rem; cursor: pointer; transition: all .2s; }
    #payment-modal-submit:hover { background: rgba(196,160,90,.12); }
    #payment-modal-submit:disabled { opacity: .4; cursor: default; }
    #payment-modal-status { font-family: var(--cinzel); font-size: .42rem; letter-spacing: .1em; color: var(--muted); margin-top: .6rem; min-height: 1em; text-align: center; }

    /* Review modal */
    #review-modal { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(8,9,12,.92); align-items: center; justify-content: center; }
    #review-modal.open { display: flex; }
    #review-modal-inner { background: var(--card); border: 1px solid var(--border); width: min(400px, 95vw); padding: 2rem; position: relative; }
    #review-modal-close { position: absolute; top: .75rem; right: 1rem; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
    #review-modal-close:hover { color: var(--cream); }
    .review-star-pick { display: flex; gap: .4rem; margin: .75rem 0; }
    .review-star-pick span { font-size: 1.3rem; cursor: pointer; color: var(--border); transition: color .15s; }
    .review-star-pick span.lit { color: var(--gold); }
