:root,
[data-theme="light"] {
    /* Light mode (default) */
    --bg-black:#faf7f0;
    --panel-black:#ffffff;
    --card-black:#fffdf9;
    --input-black:#f4efe2;
    --gold:#a8791f;
    --gold-bright:#8f6816;
    --gold-soft:rgba(168,121,31,0.28);
    --text-white:#221b0e;
    --text-muted:#6b6055;
    --text-faint:#948a7c;
    --border-subtle:rgba(168,121,31,0.22);
    --overlay-scrim-top:rgba(250,247,240,0.55);
    --overlay-scrim-mid:rgba(250,247,240,0.30);
    --overlay-scrim-bot:rgba(250,247,240,0.88);
    --session-end-panel-bg:rgba(255,255,255,0.88);
    --shadow-overlay:0 40px 100px rgba(80,60,20,0.16);
    --font-display:'Cormorant Garamond', serif;
    --font-body:'Inter', sans-serif;
  }

  [data-theme="dark"] {
    /* Dark mode */
    --bg-black:#0a0a0a;
    --panel-black:#111111;
    --card-black:#151515;
    --input-black:#1c1c1c;
    --gold:#d4a94a;
    --gold-bright:#f0c264;
    --gold-soft:rgba(212,169,74,0.35);
    --text-white:#f5f3ee;
    --text-muted:#a8a49c;
    --text-faint:#6f6b64;
    --border-subtle:rgba(212,169,74,0.18);
    --overlay-scrim-top:rgba(10,10,10,0.55);
    --overlay-scrim-mid:rgba(10,10,10,0.25);
    --overlay-scrim-bot:rgba(10,10,10,0.85);
    --session-end-panel-bg:rgba(17,17,17,0.82);
    --shadow-overlay:0 40px 100px rgba(0,0,0,0.6);
  }

  html, body { transition: background-color .35s ease, color .35s ease; }

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

  body{
    font-family:var(--font-body);
    background:var(--bg-black);
    color:var(--text-white);
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
  }

    .connect-overlay {
    width: 100%;
    max-width: 1500px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background: var(--panel-black);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-overlay);
    min-height: 640px;
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    z-index: 1000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    }

    .connect-overlay.hidden {
    display: none;
    }
  /* ---------- LEFT: hero panel ---------- */
  .hero-panel{
    position:relative;
    padding:48px 56px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    background:
      linear-gradient(180deg, var(--overlay-scrim-top) 0%, var(--overlay-scrim-mid) 40%, var(--overlay-scrim-bot) 100%),
      url('https://images.unsplash.com/photo-1605100804763-247f67b3557e?q=80&w=1400&auto=format&fit=crop') center/cover no-repeat;
  }
  .hero-brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-align:center;
  width:100%;
}
.hero-brand svg{ width:36px; height:36px; color:var(--gold); }
  .brand-text .brand-name{
    font-family:var(--font-display);
    font-size:20px;
    letter-spacing:3px;
    font-weight:600;
    color:var(--text-white);
  }
  .brand-text .brand-sub{
    font-size:25px;
    font-weight: 1000;
    letter-spacing:3px;
    color:rgb(247, 243, 6);
    margin-top:2px;
  }

  .hero-mid{ max-width:480px; }
  .hero-mid h1{
    font-family:var(--font-display);
    font-weight:500;
    font-size:56px;
    line-height:1.08;
    color:var(--text-white);
  }
  .hero-mid h1 span{ color:var(--text-white); }
  .hero-rule{
    width:150px; height:3px; background:var(--gold-bright);
    margin:22px 0 18px;
  }
  .hero-mid p{
    font-size:15px;
    line-height:1;
    color:var(--text-white);
    max-width:360px;
    opacity:0.85;
  }

    .hero-features{
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 28px;
        padding-top: 24px;
        border-top: 1px solid var(--border-subtle);

        width: fit-content;
        margin: 0 auto;
    }
  .feature{ display:flex; align-items:flex-start; gap:10px; }
  .feature svg{ width:20px; height:20px; color:var(--gold); flex-shrink:0; margin-top:2px; }
  .feature .f-title{ font-size:13px; font-weight:600; color:var(--text-white); }
  .feature .f-sub{ font-size:12px; color:var(--text-muted); }

  .hero-footer{
        display: flex;
        justify-content: center;
        align-items: center;

        font-size: 11px;
        color: var(--text-faint);
        padding-top: 24px;
    }
   .hero-logo {
        width: 50%;
        height: auto;
        display: block;
        object-fit: contain;
        margin-left: auto;  /* Centers the block element */
        margin-right: auto; /* Centers the block element */
    }
    /* ---------- RIGHT: sign-in card ---------- */
  .connect-content{
    background:var(--card-black);
    padding:56px 64px;
    display:flex;
    flex-direction:column;
    justify-content:center;
  }


  .connect-title{
    font-family:var(--font-display);
    font-weight:600;
    font-size:42px;
    text-align:center;
    color:var(--text-white);
  }
  .connect-subtitle{
    text-align:center;
    font-size:14px;
    color:var(--text-muted);
    margin-top:8px;
  }

  .divider-mark{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    margin:26px 0 30px;
  }
  .divider-mark::before,
  .divider-mark::after{
    content:'';
    height:1px;
    width:80px;
    background:linear-gradient(90deg, transparent, var(--gold-soft));
  }
  .divider-mark::after{ background:linear-gradient(90deg, var(--gold-soft), transparent); }
  .divider-mark svg{ width:12px; height:12px; color:var(--gold); }

  .login-form{ display:flex; flex-direction:column; gap:16px; }

  .login-input-group{
    position:relative;
    display:flex;
    align-items:center;
  }
  .login-input-group svg.icon-left{
    position:absolute;
    left:18px;
    width:18px; height:18px;
    color:var(--gold);
    pointer-events:none;
  }
  .login-input{
    width:100%;
    background:var(--input-black);
    border:1px solid var(--border-subtle);
    border-radius:10px;
    padding:16px 18px 16px 50px;
    font-family:var(--font-body);
    font-size:14px;
    color:var(--text-white);
    outline:none;
    transition:border-color .2s ease, box-shadow .2s ease;
  }
  .login-input::placeholder{ color:var(--text-faint); }
  .login-input:focus{
    border-color:var(--gold);
    box-shadow:0 0 0 3px rgba(212,169,74,0.12);
  }
  .toggle-pass{
    position:absolute;
    right:18px;
    background:none;
    border:none;
    cursor:pointer;
    color:var(--text-muted);
    display:flex;
  }
  .toggle-pass svg{ width:18px; height:18px; }

  .login-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:13px;
    margin-top:2px;
  }
  .remember{ display:flex; align-items:center; gap:8px; color:var(--text-muted); cursor:pointer; user-select:none; }
  .remember input{
    appearance:none;
    width:16px; height:16px;
    border-radius:4px;
    border:1px solid var(--gold-soft);
    background:var(--input-black);
    display:grid;
    place-content:center;
    cursor:pointer;
  }
  .remember input:checked{ background:var(--gold); border-color:var(--gold); }
  .remember input:checked::after{
    content:'✓';
    font-size:11px;
    font-weight:700;
    color:#1a1400;
  }
  .forgot{ color:var(--gold); text-decoration:none; font-weight:500; }
  .forgot:hover{ color:var(--gold-bright); }

  .login-error{
    font-size:12.5px;
    color:#e07a7a;
    background:rgba(224,122,122,0.08);
    border:1px solid rgba(224,122,122,0.25);
    border-radius:8px;
    padding:10px 14px;
  }
  .hidden{ display:none; }

  .connect-btn{
    margin-top:6px;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:16px;
    border:none;
    border-radius:10px;
    background:linear-gradient(180deg, var(--gold-bright), var(--gold));
    color:#1a1400;
    font-family:var(--font-body);
    font-weight:700;
    font-size:15px;
    cursor:pointer;
    transition:transform .15s ease, box-shadow .15s ease;
  }
  .connect-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 10px 24px rgba(212,169,74,0.28);
  }
  .connect-btn svg{ width:18px; height:18px; }

  .or-divider{
    display:flex;
    align-items:center;
    gap:14px;
    margin:26px 0;
    color:var(--text-faint);
    font-size:12px;
    letter-spacing:1px;
  }
  .or-divider::before,
  .or-divider::after{
    content:'';
    flex:1;
    height:1px;
    background:var(--border-subtle);
  }

  .oauth-btn{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:14px;
    background:transparent;
    border:1px solid rgba(212,169,74,0.3);
    border-radius:10px;
    color:var(--text-white);
    font-family:var(--font-body);
    font-size:14px;
    font-weight:500;
    cursor:pointer;
    margin-bottom:12px;
    transition:background .2s ease, border-color .2s ease;
  }
  .oauth-btn:hover{ background:rgba(212,169,74,0.06); border-color:var(--gold); }
  .oauth-btn svg{ width:18px; height:18px; }

  .connect-status{
    text-align:center;
    font-size:13.5px;
    color:var(--text-muted);
    margin-top:18px;
  }
  .connect-status a{
    color:var(--gold);
    font-weight:600;
    text-decoration:none;
  }
  .connect-status a:hover{ color:var(--gold-bright); }

  @media (max-width: 900px){
    .connect-overlay{ grid-template-columns:1fr; }
    .hero-panel{ display:none; }
    .connect-content{ padding:48px 28px; }
  }
  
/* ============================================================
   SESSION END OVERLAY
   ============================================================ */

#session-end-overlay.connect-overlay {
  display: flex;
  flex-direction: column;
  padding: 40px 20px;
  grid-template-columns: none;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: none;
  overflow-y: auto;
  background:
    linear-gradient(180deg, var(--overlay-scrim-top) 0%, var(--overlay-scrim-mid) 60%, var(--overlay-scrim-bot) 100%),
    url('/static/session_end_bg.jpg') center/cover no-repeat;
}

#session-end-overlay.connect-overlay.hidden {
  display: none;
}

/* ---------- Card ---------- */
.session-end-content {
  width: 100%;
  max-width: 500px;
  margin: auto;
  padding: 48px 52px;
  background: var(--session-end-panel-bg);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  box-shadow: var(--shadow-overlay), 0 0 0 1px rgba(168,121,31,0.06) inset;
  text-align: center;
}

/* ---------- Logo ---------- */
#session-end-overlay .connect-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.session-end-content .brand-mark {
  width: 30px;
  height: 30px;
  color: var(--gold);
  margin-bottom: 10px;
}

.session-end-content .brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--text-white);
}

.session-end-content .brand-sub {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Title ---------- */
.session-end-content .connect-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  background: linear-gradient(180deg, var(--text-white), var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0;
}

/* ---------- Diamond dividers ---------- */
.title-rule,
.footer-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 26px;
  max-width: 200px;
}

.title-rule span,
.footer-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.title-rule span:last-child,
.footer-rule span:last-child {
  background: linear-gradient(90deg, var(--gold-soft), transparent);
}
.title-rule svg,
.footer-rule svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ---------- Subtitle text ---------- */
.session-end-content .connect-subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.session-end-content .connect-subtitle strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-bright);
}

/* ---------- Center diamond icon (glowing) ---------- */
.session-end-icon {
  width: 62px;
  height: 62px;
  margin: 26px auto;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  box-shadow: 0 0 24px rgba(212,169,74,0.18), inset 0 0 12px rgba(212,169,74,0.08);
}

.session-end-icon svg {
  width: 26px;
  height: 26px;
}

.session-end-tagline {
  margin-bottom: 30px;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.session-end-content .connect-btn {
  padding: 17px;
  font-size: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(212,169,74,0.2);
}

.session-end-content .connect-btn:hover {
  box-shadow: 0 12px 30px rgba(212,169,74,0.32);
}

.connect-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 17px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: background .2s ease, border-color .2s ease;
}

.connect-btn-outline:hover {
  background: rgba(212,169,74,0.06);
  border-color: var(--gold);
}

.connect-btn-outline svg {
  width: 17px;
  height: 17px;
}

/* ---------- Feature row ---------- */
.session-end-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--border-subtle);
}

.se-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.se-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.se-feature:hover .se-feature-icon {
  border-color: var(--gold-soft);
  box-shadow: 0 0 14px rgba(212,169,74,0.15);
}

.se-feature-icon svg {
  width: 19px;
  height: 19px;
}

.se-feature span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 560px) {
  .session-end-content {
    padding: 36px 26px;
  }
  .session-end-content .connect-title {
    font-size: 34px;
  }
  .session-end-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 14px;
  }
}


/* ============================================================
   MAIN APPLICATION — Black & Gold Advisor Theme
   ============================================================ */

/* --- Theme tokens for the main app --- */
:root,
[data-theme="light"] {
  /* Light mode (default) */
  --bg-primary: #faf7f0;
  --bg-secondary: #f2ede0;
  --bg-panel: #fffdf9;
  --bg-panel-alt: #f6f1e5;
  --bg-input: #f0ead9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;

  --gold-primary: #a8791f;
  --gold-light: #8f6816;
  --gold-lighter: #d9b559;
  --gold-dark: #6e5613;
  --gold-muted: #8a6f1c;
  --gold-dim: #cdb374;
  --gold-glow: rgba(168, 121, 31, 0.16);

  --live-green: #2f9e50;

  --text-primary: #241d10;
  --text-secondary: #6b551c;
  --text-muted: #7d7362;
  --text-dim: #a89e8c;
  --text-on-gold: #fffdf7;

  --border-gold: rgba(168, 121, 31, 0.22);
  --border-gold-strong: rgba(168, 121, 31, 0.5);
  --border-subtle: rgba(80, 60, 20, 0.10);

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-gold-sm: 0 2px 10px rgba(168, 121, 31, 0.10);
  --shadow-gold-md: 0 4px 20px rgba(168, 121, 31, 0.14);
  --shadow-gold-lg: 0 8px 40px rgba(168, 121, 31, 0.18);
  --shadow-deep: 0 8px 32px rgba(80, 60, 20, 0.18);
  --shadow-inset: inset 0 1px 0 rgba(168, 121, 31, 0.08);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s var(--ease-in-out);
  --transition: 0.3s var(--ease-in-out);
  --transition-slow: 0.5s var(--ease-out);
}

[data-theme="dark"] {
  /* Dark mode */
  --bg-primary: #0a0908;
  --bg-secondary: #121110;
  --bg-panel: #0d0c0b;
  --bg-panel-alt: #141210;
  --bg-input: #17140f;
  --bg-elevated: #1a1712;
  --bg-card: #131110;

  --gold-primary: #c9a227;
  --gold-light: #e8c565;
  --gold-lighter: #f5deA0;
  --gold-dark: #8a6f1c;
  --gold-muted: #6e5a1c;
  --gold-dim: #4a3d14;
  --gold-glow: rgba(201, 162, 39, 0.25);

  --live-green: #34c759;

  --text-primary: #f3ecd8;
  --text-secondary: #cbb87a;
  --text-muted: #948a72;
  --text-dim: #5c5442;
  --text-on-gold: #201804;

  --border-gold: rgba(201, 162, 39, 0.20);
  --border-gold-strong: rgba(201, 162, 39, 0.45);
  --border-subtle: rgba(255, 255, 255, 0.06);

  --shadow-gold-sm: 0 2px 10px rgba(201, 162, 39, 0.10);
  --shadow-gold-md: 0 4px 20px rgba(201, 162, 39, 0.16);
  --shadow-gold-lg: 0 8px 40px rgba(201, 162, 39, 0.22);
  --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-inset: inset 0 1px 0 rgba(201, 162, 39, 0.06);
}

/* --- Custom Scrollbars --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold-muted));
  border-radius: 3px;
  border: 1px solid transparent;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold-primary), var(--gold-dark));
}
* { scrollbar-width: thin; scrollbar-color: var(--gold-dark) var(--bg-primary); }
::selection { background: rgba(201, 162, 39, 0.3); color: var(--text-primary); }

/* --- Main App Layout --- */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-primary);
}
.app-layout.hidden { display: none; }

.col-divider {
  width: 1px;
  flex-shrink: 0;
  transition: opacity 0.8s;
  background: linear-gradient(180deg,
      transparent 0%, var(--gold-dim) 10%, var(--gold-dark) 30%,
      var(--gold-primary) 50%, var(--gold-dark) 70%, var(--gold-dim) 90%, transparent 100%);
  opacity: 0.5;
  position: relative;
}
.col-divider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(201, 162, 39, 0.08) 50%, transparent 100%);
  width: 12px;
  left: -5px;
  pointer-events: none;
}

/* ===== COLUMN 1: CHAT PANEL ===== */
.col-chat {
  width: 500px;
  flex-shrink: 0;
  margin-left: 0;
  transition: width 0.75s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-gold);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.04) 0%, transparent 100%), var(--bg-panel);
  flex-shrink: 0;
  position: relative;
}
.chat-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.3;
}
.chat-brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-spark { color: var(--gold-primary); font-size: 1.05rem; }
.brand-logo-img { width: 30px; height: 30px; object-fit: contain; }
.brand-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.2px;
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; }

/* Status Pill */
.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 14px;
  background: rgba(201, 162, 39, 0.06);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(52, 199, 89, 0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 3px rgba(52, 199, 89, 0.3); }
}
.status-pill.disconnected .status-dot { background: #c0392b; box-shadow: 0 0 6px rgba(192, 57, 43, 0.5); animation: none; }

/* --- Advisor Avatar Block --- */
.advisor-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6rem 1rem 1.3rem;
  border-bottom: 1px solid var(--border-gold);
  background: radial-gradient(ellipse at top, rgba(201, 162, 39, 0.05), transparent 70%);
}
.advisor-avatar {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--bg-elevated), var(--bg-panel) 75%);
  margin-bottom: 0.85rem;
}
.advisor-avatar-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border-gold-strong);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.18), inset 0 0 14px rgba(201, 162, 39, 0.08);
}
.advisor-avatar-ring::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  animation: spinSlow 18s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.advisor-avatar-spark {
  color: var(--gold-light);
  font-size: 1.7rem;
  text-shadow: 0 0 16px rgba(232, 197, 101, 0.55);
  animation: sparkPulse 2.6s ease-in-out infinite;
}
@keyframes sparkPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.12); opacity: 1; }
}
.advisor-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.3px;
}
.advisor-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-top: 2px;
  margin-bottom: 0.9rem;
}
.advisor-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 22px;
}
.advisor-waveform span {
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  /* Idle state: flat line, no motion */
  transform: scaleY(0.14);
  opacity: 0.4;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
/* Only animate while the AI is actually speaking */
.advisor-waveform.active span {
  animation: waveBounce 1.2s ease-in-out infinite;
}
@keyframes waveBounce {
  0%, 100% { transform: scaleY(0.3); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* AI Voice Panel */
.ai-voice-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem 1rem;
  gap: 1.4rem;
  min-height: 0;
  overflow: hidden;
}

.voice-canvas {
  width: 100%;
  max-width: 320px;
  height: 80px;
  display: block;
  border-radius: var(--radius-md);
}

.ai-transcript {
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: 0.1px;
  padding: 0 0.5rem;
  max-height: 260px;
  overflow-y: auto;
  transition: opacity 0.4s ease;
  min-height: 3.5em;
}
/* Placeholder when no conversation has started */
.ai-transcript:empty::before {
  content: 'Start speaking to begin your experience';
  display: block;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 300;
  letter-spacing: 0.3px;
  padding-top: 1rem;
  opacity: 0.7;
  animation: placeholderPulse 3s ease-in-out infinite;
}
@keyframes placeholderPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}
.ai-transcript.dimmed { opacity: 0.35; }

/* Each word is revealed in lockstep with the played audio (see transcriptSync
   in main.js) and fades up as it appears. */
.ai-transcript .word-token {
  display: inline;
  animation: wordFadeUp 0.18s ease-out both;
}
@keyframes wordFadeUp {
  from { opacity: 0; transform: translateY(0.18em); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Blinking gold cursor at the tail while the assistant is actively speaking. */
.ai-transcript.speaking::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--gold-primary, #c9a84c);
  animation: transcriptCursorBlink 1s step-end infinite;
}
@keyframes transcriptCursorBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}


/* --- Chat Input Bar --- */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-gold);
  background: linear-gradient(180deg, transparent 0%, rgba(201, 162, 39, 0.02) 100%), var(--bg-input);
  flex-shrink: 0;
}

.chat-text-input {
  flex: 1;
  padding: 0.75rem 1.15rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}
.chat-text-input::placeholder { color: var(--text-dim); }
.chat-text-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1), var(--shadow-gold-sm);
}

/* --- Icon Buttons --- */
.mic-prompt-anchor { position: relative; flex-shrink: 0; }
.mic-prompt {
  position: absolute;
  left: -5px; bottom: calc(100% + 14px);
  z-index: 20;
  width: max-content; max-width: 190px;
  padding: 9px 12px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: var(--text-on-gold);
  box-shadow: 0 8px 22px rgba(201, 162, 39, 0.35);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transform: translate(0, 6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.mic-prompt::after {
  content: '';
  position: absolute; left: 26px; top: 100%;
  width: 12px; height: 12px;
  border-right: 1px solid var(--gold-light);
  border-bottom: 1px solid var(--gold-light);
  background: var(--gold-primary);
  transform: translate(-50%, -6px) rotate(45deg);
}
.mic-prompt.visible {
  opacity: 1; visibility: visible;
  transform: translate(0, 0);
  animation: micPromptFloat 1.8s ease-in-out infinite;
}
@keyframes micPromptFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -7px); }
}

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: var(--bg-elevated);
  color: var(--gold-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}
.icon-btn svg { stroke: var(--gold-primary); transition: stroke var(--transition-fast); }
.icon-btn:hover {
  background: rgba(201, 162, 39, 0.12);
  border-color: var(--gold-primary);
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.15);
}
.icon-btn:active { transform: scale(0.95); box-shadow: none; }

.icon-btn.icon-btn-send {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold-sm);
}
.icon-btn.icon-btn-send svg { stroke: var(--text-on-gold); }
.icon-btn.icon-btn-send:hover { box-shadow: var(--shadow-gold-md); }

.icon-btn.mic-active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  border-color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.35);
  animation: micPulse 2s ease-in-out infinite;
}
.icon-btn.mic-active svg { stroke: var(--text-on-gold); }
.icon-btn.mic-active .mic-off { display: none; }
.icon-btn.mic-active .mic-on { display: block; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 162, 39, 0.35); }
  50% { box-shadow: 0 0 30px rgba(201, 162, 39, 0.55), 0 0 60px rgba(201, 162, 39, 0.15); }
}

.icon-btn.mic-muted {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.12);
  animation: none;
}
.icon-btn.mic-muted svg { stroke: #d9534f; }
.icon-btn.mic-muted .mic-on { display: none; }
.icon-btn.mic-muted .mic-off { display: block; }
.icon-btn.mic-muted:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #d9534f;
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.2);
}

.icon-btn.mic-inactive {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.12);
  animation: none;
}
.icon-btn.mic-inactive svg { stroke: #d9534f; }
.icon-btn.mic-inactive .mic-on { display: none; }
.icon-btn.mic-inactive .mic-off { display: block; }
.icon-btn.mic-inactive:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #d9534f;
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.2);
}

.icon-btn-danger { width: 30px; height: 30px; border-color: rgba(192, 57, 43, 0.3); }
.icon-btn-danger svg { stroke: #d9534f; }
.icon-btn-danger:hover {
  background: rgba(192, 57, 43, 0.18);
  border-color: #d9534f;
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.2);
}

/* ===== COLUMN 2: VISUAL STAGE ===== */
.col-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  background: radial-gradient(ellipse at center, var(--bg-panel-alt) 0%, var(--bg-primary) 100%);
  height: 100vh;
  overflow: hidden;
  transition: flex 0.75s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
}

.stage-panel {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.stage-panel.stage-active { opacity: 1; visibility: visible; }

.stage-iframe { width: 100%; height: 100%; border: none; background: var(--bg-primary); }

/* Welcome State */
.welcome-content { text-align: center; padding: 2.5rem; }
.welcome-diamond { margin-bottom: 2rem; animation: floatLogo 5s ease-in-out infinite; }
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.welcome-logo-img { width: 160px; height: 160px; object-fit: contain; filter: drop-shadow(0 0 25px rgba(201, 162, 39, 0.2)); }
.welcome-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.welcome-text {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.7;
}

/* Recommendations State */
.recommendations-container {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  padding: 2.2rem 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.how-it-works-btn {
  position: absolute;
  top: 1.75rem; right: 2rem;
  display: flex; align-items: center; gap: 6px;
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.how-it-works-btn svg { width: 13px; height: 13px; }
.how-it-works-btn:hover { border-color: var(--gold-primary); color: var(--gold-light); }

.recommendations-title {
  font-family: var(--font-heading);
  flex-shrink: 0;
  font-size: 1.7rem;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  text-align: center;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.rec-title-spark { color: var(--gold-primary); font-size: 1.3rem; }

.recommendations-subtitle {
  flex-shrink: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 300;
}

.recommendations-stage-grid {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 1rem 2rem 1rem;
}

.rec-category-section {
  animation: recCardIn 0.5s var(--ease-out);
}
@keyframes recCardIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.rec-category-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.4px;
}
.rec-header-rule {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft, rgba(201,162,39,0.35)));
}
.rec-category-header .rec-header-rule:last-child { background: linear-gradient(90deg, var(--gold-soft, rgba(201,162,39,0.35)), transparent); }

.rec-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.1rem;
}

.rec-product-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.rec-product-item:hover {
  border-color: var(--border-gold-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold-md);
}
.rec-product-item.selected {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 1px var(--gold-primary), var(--shadow-gold-lg);
}

.rec-selected-badge {
  position: absolute;
  top: 12px; left: -34px;
  width: 130px;
  padding: 3px 0;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: var(--text-on-gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  z-index: 3;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}
.rec-product-item.selected .rec-selected-badge { opacity: 1; }

.rec-product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(ellipse at center, var(--bg-panel-alt) 0%, var(--bg-input) 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rec-product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.rec-product-item:hover .rec-product-img-wrap img { transform: scale(1.05); }

.rec-product-body { padding: 0.75rem 0.85rem 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; }

.rec-product-title {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-product-rating { display: flex; align-items: center; gap: 4px; }
.rec-product-rating svg { width: 11px; height: 11px; }
.rec-product-rating .star-filled { color: var(--gold-primary); }
.rec-product-rating .star-empty { color: var(--border-subtle); }
.rec-rating-count { font-size: 0.66rem; color: var(--text-dim); margin-left: 2px; }

.rec-product-price { font-size: 0.85rem; color: var(--gold-light); font-weight: 700; }

.rec-view-details-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 0.35rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.rec-view-details-btn svg { width: 13px; height: 13px; }
.rec-view-details-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(201, 162, 39, 0.06);
}

/* Empty state (e.g. no necklaces found) */
.rec-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2.2rem 1rem;
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-lg);
  background: rgba(201, 162, 39, 0.02);
}
.rec-empty-state svg { width: 34px; height: 34px; color: var(--text-dim); margin-bottom: 0.3rem; }
.rec-empty-msg { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.rec-empty-sub { font-size: 0.75rem; color: var(--text-dim); }

.recommendations-actions {
  flex-shrink: 0;
  margin-top: 1rem;
  padding: 1rem 0;
  text-align: center;
  width: 100%;
}

/* VTO Launch Button */
.vto-launch-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 2.4rem;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: var(--text-on-gold);
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  box-shadow: var(--shadow-gold-md);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}
.vto-launch-btn::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.5s ease;
}
.vto-launch-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold-lg); }
.vto-launch-btn:hover::before { left: 100%; }
.vto-launch-btn:active { transform: translateY(0); }
.vto-launch-btn svg { width: 18px; height: 18px; }
.vto-launch-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.vto-launch-btn:disabled:hover { box-shadow: none; }

.shimmer-bar {
  width: 55%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.5s ease infinite;
  display: inline-block;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Loading Spinner --- */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-gold);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utility --- */
.hidden { display: none !important; }
*:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; }
button:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; }

.mobile-only { display: none !important; }

@media (max-width: 1200px) {
  .col-chat { width: 420px; }
}

@media (max-width: 900px) {
  .app-layout { display: flex; flex-direction: column; height: 100dvh; }
  .mobile-only { display: flex !important; }
  .col-divider:last-of-type { display: none; }
  .col-stage { order: 1; height: 45dvh; min-height: 0; flex-shrink: 0; }
  .col-chat { order: 3; height: 55dvh; min-height: 0; flex-shrink: 0; width: 100%; }
  .col-divider {
    order: 2; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 10%, var(--gold-primary) 50%, var(--gold-dim) 90%, transparent 100%);
  }
  .advisor-block { padding: 1rem 1rem 0.9rem; }
  .advisor-avatar { width: 70px; height: 70px; }
  .advisor-name { font-size: 1.2rem; }
  .welcome-title { font-size: 1.5rem; }
  .welcome-logo-img { width: 120px; height: 120px; }
  .recommendations-title { font-size: 1.3rem; }
  .how-it-works-btn { top: 1rem; right: 1rem; }
  .rec-products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
}

/* --- Similar Options Tray --- */
.similar-tray {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(201, 162, 39, 0.04);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 15px rgba(201, 162, 39, 0.05);
  animation: traySlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
@keyframes traySlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.similar-tray-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  padding-bottom: 0.5rem;
}
.similar-tray-title { font-family: var(--font-heading); font-size: 0.95rem; color: var(--gold-light); font-weight: 600; letter-spacing: 0.3px; }
.close-tray-btn { width: 24px; height: 24px; font-size: 0.8rem; border-color: rgba(201, 162, 39, 0.3); }

.sim-loading { font-size: 0.85rem; color: var(--gold-light); text-align: center; padding: 1rem; font-style: italic; }
.sim-error { font-size: 0.85rem; color: #d9534f; text-align: center; padding: 1rem; }
.similar-grid { padding: 0; }
.sim-item { border-color: rgba(201, 162, 39, 0.4); }
.rec-product-label {
  padding: 0.4rem 0.55rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   THEME TOGGLE (Light / Dark)
   ============================================================ */

.theme-toggle-wrap {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 1002;
}

.theme-toggle {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  line-height: 0;
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px;
  height: 30px;
  border-radius: var(--radius-full, 9999px);
  padding: 0 7px;
  background: var(--input-black, #f4efe2);
  border: 1px solid var(--border-subtle, rgba(80,60,20,0.14));
  box-shadow: var(--shadow-inset, inset 0 1px 0 rgba(0,0,0,0.04));
  transition: background-color .3s ease, border-color .3s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-bright, #8f6816), var(--gold, #a8791f));
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform .32s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(28px);
}

.theme-icon {
  width: 15px;
  height: 15px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: color .3s ease, opacity .3s ease;
}
.theme-icon-sun { color: var(--gold, #a8791f); opacity: 1; }
.theme-icon-moon { color: var(--text-faint, #948a7c); opacity: 0.55; }

[data-theme="dark"] .theme-icon-sun { color: var(--text-faint, #6f6b64); opacity: 0.5; }
[data-theme="dark"] .theme-icon-moon { color: var(--gold-bright, #f0c264); opacity: 1; }

.theme-toggle:hover .theme-toggle-track {
  border-color: var(--gold, #a8791f);
}
.theme-toggle:focus-visible .theme-toggle-track {
  outline: 2px solid var(--gold, #a8791f);
  outline-offset: 2px;
}

/* Inline variant used inside the chat header (no absolute positioning) */
.theme-toggle-inline {
  margin: 0 2px;
}

@media (max-width: 560px) {
  .theme-toggle-wrap { top: 14px; right: 14px; }
}
/* ============================================================
   CHAT CENTERED STATE (Before Recommendations — Full Desktop Immersion)
   ============================================================ */
@media (min-width: 901px) {
  .app-layout.chat-centered {
    width: 100vw;
    height: 100vh;
  }

  /* Full screen luxury chat experience */
  .app-layout.chat-centered .col-chat {
    width: 100vw;
    flex: 1 1 100%;
    margin-left: 0;
    border-radius: 0;
    box-shadow: none;
    background: radial-gradient(ellipse at 50% 20%, rgba(201, 162, 39, 0.05) 0%, var(--bg-panel) 60%, var(--bg-primary) 100%);
  }

  /* Hide divider and stage smoothly while chat is centered */
  .app-layout.chat-centered .col-divider {
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  .app-layout.chat-centered .col-stage {
    flex: 0 0 0px;
    width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .app-layout.chat-centered .col-stage .stage-panel {
    opacity: 0;
    visibility: hidden;
  }

  /* Refined desktop header spanning across */
  .app-layout.chat-centered .chat-header {
    padding: 1.25rem 3.5rem;
    border-bottom: 1px solid rgba(201, 162, 39, 0.16);
  }

  /* Centered spacious luxury persona */
  .app-layout.chat-centered .advisor-block {
    padding: 2.8rem 2rem 1.8rem;
    background: transparent;
    border-bottom: 1px solid rgba(201, 162, 39, 0.12);
  }

  .app-layout.chat-centered .advisor-avatar {
    width: 110px;
    height: 110px;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 35px rgba(201, 162, 39, 0.16);
  }

  .app-layout.chat-centered .advisor-avatar-spark {
    font-size: 2rem;
  }

  .app-layout.chat-centered .advisor-name {
    font-size: 2.2rem;
    letter-spacing: 0.5px;
  }

  .app-layout.chat-centered .advisor-role {
    font-size: 0.88rem;
    letter-spacing: 0.8px;
    margin-top: 4px;
    margin-bottom: 1.2rem;
  }

  /* Center voice & transcript with comfortable desktop reading bounds */
  .app-layout.chat-centered .ai-voice-panel {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem 1.5rem;
    gap: 2rem;
  }

  .app-layout.chat-centered .voice-canvas {
    max-width: 480px;
    height: 85px;
  }

  .app-layout.chat-centered .ai-transcript {
    max-width: 820px;
    font-size: 1.22rem;
    line-height: 1.75;
    max-height: 300px;
  }

  /* Centered floating bottom input bar */
  .app-layout.chat-centered .chat-input-bar {
    padding: 1.5rem 2.5rem 2.2rem;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 9, 8, 0.6) 100%);
    border-top: 1px solid rgba(201, 162, 39, 0.12);
    justify-content: center;
    gap: 0.85rem;
  }

  .app-layout.chat-centered .chat-text-input {
    max-width: 760px;
    padding: 0.95rem 1.5rem;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  }

  .app-layout.chat-centered .icon-btn {
    width: 46px;
    height: 46px;
  }
}

/* Mobile: full height when chat is centered */
@media (max-width: 900px) {
  .app-layout.chat-centered .col-stage {
    display: none;
    height: 0;
  }
  .app-layout.chat-centered .col-chat {
    height: 100dvh;
  }
}
