/* ==========================================================================
   PRESTIGE WORLD · SOVEREIGN REAL INTELLIGENCE CONCIERGE
   MAYFAIR · GENEVA · PLACE VENDÔME · MONACO DESIGN STANDARD
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #050507;
  --bg-secondary: #0a0b0f;
  --bg-card: rgba(14, 16, 22, 0.78);
  --bg-card-hover: rgba(22, 25, 36, 0.9);
  --gold: #c9a84c;
  --gold-light: #e2c97e;
  --gold-dark: #8a6520;
  --gold-glow: rgba(201, 168, 76, 0.22);
  --platinum: #f1f5f9;
  --text-muted: #94a3b8;
  --border-gold: rgba(201, 168, 76, 0.25);
  --border-gold-subtle: rgba(201, 168, 76, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --accent-green: #10b981;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--platinum);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
}

/* Golden top border bar */
.top-gold-bar {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #c9a84c 25%, #e2c97e 50%, #c9a84c 75%, transparent 100%);
  width: 100%;
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* Master Page Wrapper */
.terminal-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 24px;
}

/* Sovereign Top Global Nav */
.global-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-gold-subtle);
  margin-bottom: 18px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2208, #110e03);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 12px var(--gold-glow);
}

.brand-titles h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 3px;
  color: #ffffff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 1.5px;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
}

.global-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.global-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s ease;
  font-weight: 400;
}

.global-links a:hover,
.global-links a.active {
  color: var(--gold-light);
}

.global-cta {
  border: 1px solid var(--border-gold);
  padding: 7px 16px;
  border-radius: 20px;
  color: var(--gold-light) !important;
  background: rgba(201, 168, 76, 0.08);
  font-weight: 500;
}

.global-cta:hover {
  background: rgba(201, 168, 76, 0.2);
}

/* Secondary Executive Bar */
.executive-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.hud-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.godmode-badge {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(0, 0, 0, 0.4));
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 10px var(--gold-glow);
  transition: all 0.2s;
}

.godmode-badge:hover {
  background: var(--gold);
  color: #050507;
}

/* Main Grid */
.main-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 20px;
  flex: 1;
}

/* Sidebar: Pantheon Selection */
.pantheon-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-gold-subtle);
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.persona-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 290px);
}

.persona-card {
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.persona-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201, 168, 76, 0.35);
  transform: translateY(-1px);
}

.persona-card.active {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(10, 11, 15, 0.8));
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.12);
}

.persona-sigil {
  font-size: 22px;
  min-width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.persona-card.active .persona-sigil {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.15);
}

.persona-info {
  flex: 1;
}

.persona-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.persona-card.active .persona-name {
  color: var(--gold-light);
}

.persona-role {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.persona-location {
  font-size: 10.5px;
  color: var(--gold);
  margin-top: 5px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Chat Salon Area */
.chat-salon {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 165px);
}

.salon-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-gold-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
}

.active-concierge-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.concierge-avatar-frame {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #221c08, #0a0903);
  box-shadow: 0 0 16px var(--gold-glow);
}

.concierge-headings h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.concierge-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.live-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message-row {
  display: flex;
  gap: 14px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.assistant {
  align-self: flex-start;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message-row.user .message-avatar {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.message-row.assistant .message-bubble {
  background: rgba(18, 20, 28, 0.95);
  border: 1px solid var(--border-gold-subtle);
  color: #f1f5f9;
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.18), rgba(20, 22, 30, 0.95));
  border: 1px solid var(--border-gold);
  color: #ffffff;
}

.message-bubble p {
  margin-bottom: 10px;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Quick Action Chips Bar */
.quick-chips-bar {
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.quick-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quick-chip:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

/* Input Bar */
.chat-input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border-gold-subtle);
  display: flex;
  gap: 12px;
  background: rgba(10, 11, 16, 0.9);
}

.input-container {
  flex: 1;
}

.chat-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 12px var(--gold-glow);
}

.send-btn {
  background: linear-gradient(135deg, #c9a84c, #b8902a);
  border: none;
  color: #050507;
  padding: 0 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.send-btn:hover {
  background: linear-gradient(135deg, #e2c97e, #c9a84c);
  box-shadow: 0 0 16px var(--gold-glow);
  transform: translateY(-1px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #0b0d13;
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-glow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-gold-subtle);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 1px;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: #ffffff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13.5px;
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
}

/* Membership Tiers Grid */
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tier-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.tier-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

.tier-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 12px;
}

.tier-btn {
  margin-top: auto;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.tier-btn:hover {
  background: var(--gold);
  color: #050507;
}

/* Crypto Asset Pills */
.crypto-asset-pill {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.crypto-asset-pill:hover,
.crypto-asset-pill.active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

@media (max-width: 900px) {
  .global-nav { padding: 14px 0; }
  .global-links { display: none; }
  .main-layout { grid-template-columns: 1fr; }
  .pantheon-panel { max-height: 220px; }
  .chat-salon { height: calc(100vh - 200px); }
}

/* ── SOVEREIGN VOICE DISPATCH STYLES ── */
.voice-dispatch-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
}
.btn-voice-dispatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: #e2c97e;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-voice-dispatch:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: #c9a84c;
  color: #fff;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.25);
}
.btn-voice-dispatch.playing {
  background: rgba(201, 168, 76, 0.25);
  border-color: #c9a84c;
  color: #fff;
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.35);
}
.voice-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.voice-bars .bar {
  width: 2px;
  background: #c9a84c;
  border-radius: 1px;
  height: 4px;
  transition: height 0.2s ease;
}
.btn-voice-dispatch.playing .bar.b1 {
  animation: barBounce 0.8s infinite ease-in-out;
}
.btn-voice-dispatch.playing .bar.b2 {
  animation: barBounce 0.8s infinite ease-in-out 0.2s;
}
.btn-voice-dispatch.playing .bar.b3 {
  animation: barBounce 0.8s infinite ease-in-out 0.4s;
}
@keyframes barBounce {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

/* ── SOVEREIGN VOICE INPUT MICROPHONE BUTTON ── */
.mic-btn {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--gold-light, #e2c97e);
  width: 44px;
  height: 44px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.mic-btn:hover {
  background: rgba(201, 168, 76, 0.22);
  border-color: var(--gold, #c9a84c);
  color: #fff;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.35);
}
.mic-btn.listening {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
  animation: micPulse 1.2s infinite ease-in-out;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); transform: scale(1.05); }
}

/* ── SOVEREIGN MANDATE ACTIVE PILL (TELEGRAM CONTEXT HANDOFF) ── */
.mandate-active-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.18) 0%, rgba(18, 22, 32, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-left: 4px solid var(--gold, #d4af37);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 12px 24px 0 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.15);
  animation: slideDownMandate 0.35s ease-out;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10;
}
@keyframes slideDownMandate {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.mandate-pill-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mandate-pill-sigil {
  font-size: 20px;
  color: var(--gold, #d4af37);
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}
.mandate-pill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mandate-pill-tag {
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-light, #f3e5ab);
  font-weight: 700;
}
.mandate-pill-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}
.mandate-pill-ref {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}
.mandate-pill-ref code {
  color: var(--gold, #d4af37);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
}
.mandate-pill-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mandate-pill-btn {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light, #f3e5ab);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.mandate-pill-btn:hover {
  background: var(--gold, #d4af37);
  color: #07090c;
}
.mandate-pill-close {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.mandate-pill-close:hover {
  color: #fff;
}
