:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(ellipse 1200px 500px at 80% -15%, rgba(124, 58, 237, .18), transparent 65%),
    radial-gradient(ellipse 800px 600px at -5% 110%, rgba(201, 162, 39, .12), transparent 60%),
    #0D0A1A;
  background-size: 160% 160%, 160% 160%, auto;
  animation: auroraShift 24s ease-in-out infinite;
  color: #EDE8FF;
  font-family: Inter, Vazirmatn, system-ui, sans-serif;
}

@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%, 100% 50%; }
  50% { background-position: 100% 50%, 0% 50%; }
}

.watermark {
  position: fixed; inset: 0;
  background: url("/logo-mark.png") center / 340px no-repeat;
  opacity: .05; pointer-events: none; z-index: 0;
}

@keyframes logoBreath {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(201, 162, 39, .45)) drop-shadow(0 0 24px rgba(124, 58, 237, .25)); }
  50% { filter: drop-shadow(0 0 18px rgba(232, 197, 71, .65)) drop-shadow(0 0 36px rgba(124, 58, 237, .4)); }
}
.logo-breath { animation: logoBreath 3.6s ease-in-out infinite; border-radius: 22%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

::selection { background: rgba(201, 162, 39, .35); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3a335c; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid #E8C547; outline-offset: 2px; }

.lang {
  position: fixed; top: 1rem; inset-inline-end: 1.25rem; z-index: 50;
}
#langBtn {
  display: flex; align-items: center; gap: 6px;
  border-radius: 12px; padding: 6px 10px; cursor: pointer;
  background: rgba(19, 15, 38, .9);
  border: 1px solid rgba(201, 162, 39, .25);
  color: #C9A227; font: inherit; font-size: 12px; font-weight: 700;
}
#langCode { letter-spacing: .06em; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  width: 160px; overflow: hidden; border-radius: 12px; padding: 4px;
  background: linear-gradient(135deg, rgba(19, 15, 38, .98), rgba(28, 23, 54, .98));
  border: 1px solid rgba(201, 162, 39, .3);
}
.lang-menu button {
  display: block; width: 100%; text-align: start;
  background: none; border: none; color: #B8B2D8;
  font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.lang-menu button[aria-current="true"],
.lang-menu button:hover { background: rgba(201, 162, 39, .12); color: #E8C547; }

.shell { position: relative; z-index: 1; display: flex; min-height: 100%; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: 280px; flex: none;
  display: flex; flex-direction: column; padding: 24px 16px 16px;
  background: #130F26;
  border-inline-end: 1px solid rgba(201, 162, 39, .15);
}
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.brand img { width: 64px; height: 64px; object-fit: cover; border-radius: 18px; }
.brand-name {
  font-weight: 800; font-size: 20px; letter-spacing: .04em;
  background: linear-gradient(135deg, #C9A227, #E8C547);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub {
  font-size: 12px; letter-spacing: 0;
  color: #C4B8E8;
}
.side-rule {
  height: 1px; margin: 22px 0 16px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, .4), transparent);
}
.side-nav { display: flex; flex-direction: column; gap: 6px; flex: none; }
.voice-dock {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  margin-top: 14px; padding: 4px 4px 8px;
}
.voice-dock [data-voice-list] { overflow: auto; min-height: 0; }
.voice-dock h2 {
  margin: 4px 8px 8px; font-size: 15px; font-weight: 700; color: #EDE8FF;
}
.voice-lang {
  margin: 12px 8px 6px; font-size: 12px; font-weight: 700;
  letter-spacing: 0; color: #C9A227;
}
.voice-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; margin: 0 0 4px; padding: 6px 8px;
  border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: #EDE8FF; font: inherit;
  text-align: start; cursor: pointer;
}
.voice-row:hover { background: rgba(28, 23, 54, .9); }
.voice-row.selected {
  background: rgba(201, 162, 39, .12);
  border-color: rgba(201, 162, 39, .45);
}
.voice-name { font-weight: 600; font-size: 14px; }
.voice-meta { margin-inline-start: auto; color: #8A7FBD; font-size: 12px; }
.voice-play {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(201, 162, 39, .45);
  background: #0D0A1A; color: #E8C547; cursor: pointer;
}
.voice-play[aria-busy="true"] { opacity: .55; }
.voice-play[data-playing="1"] { background: #C9A227; color: #0D0A1A; }
.voice-dock-mobile { display: none; width: 100%; padding: 14px; flex: none; overflow: visible; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: start;
  border-radius: 12px; padding: 10px 12px;
  background: transparent; border: 1px solid transparent;
  color: #8A7FBD; font: inherit; font-size: 14px; cursor: pointer;
}
.nav-item.active {
  color: #E8C547; font-weight: 600;
  background: linear-gradient(135deg, rgba(201, 162, 39, .15), rgba(124, 58, 237, .15));
  border-inline-end: 2px solid #C9A227;
}
.nav-item:hover { background: rgba(28, 23, 54, .8); color: #EDE8FF; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: #C9A227; }
.side-foot {
  margin-top: 12px; flex: none; padding: 14px;
  border-radius: 14px; background: #211B40;
  border: 1px solid rgba(201, 162, 39, .15);
  display: flex; flex-direction: column; gap: 6px;
}
.who-label { font-size: 11px; color: #8A7FBD; margin-bottom: 4px; }
.side-foot a { color: #E8C547; font-size: 13px; font-weight: 650; text-decoration: none; }
.side-foot a:hover { color: #fff; }

.workspace {
  flex: 1; min-width: 0;
  max-width: 920px; margin: 0 auto;
  padding: 88px 28px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.session-bar {
  width: min(440px, 100%);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 14px;
  box-shadow: 0 18px 50px -28px rgba(124, 58, 237, .9), inset 0 1px 0 rgba(232, 197, 71, .2);
}
.session-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-label {
  font-size: 13px; letter-spacing: 0; font-weight: 700;
  color: #E8C547; white-space: nowrap;
}
.handoff-hint {
  margin: 0; text-align: center; color: #8A7FBD; font-size: 12px; line-height: 1.6;
}
.mobile-brand { display: none; align-items: center; gap: 12px; align-self: stretch; }
.mobile-brand img { width: 42px; height: 42px; border-radius: 12px; }
.mobile-brand strong { display: block; color: #E8C547; }
.mobile-brand span { color: #8A7FBD; font-size: 12px; }

.mic-btn {
  width: 92px; height: 92px; border-radius: 28px; border: none; cursor: pointer;
  display: grid; place-items: center; color: #0D0A1A;
  background: linear-gradient(135deg, #C9A227, #E8C547);
  box-shadow: 0 4px 24px -4px rgba(201, 162, 39, .55);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mic-btn:hover { transform: translateY(-2px); }
.mic-btn.listening {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(124, 58, 237, .18);
}
.mic-btn.speaking {
  background: linear-gradient(135deg, #E8C547, #C9A227);
  box-shadow: 0 0 0 8px rgba(201, 162, 39, .2);
}
.mic-btn.live {
  background: linear-gradient(135deg, #7C3AED, #C9A227);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(124, 58, 237, .18);
}

.status {
  min-height: 1.4em; color: #8A7FBD; font-size: 14px; text-align: center;
}
.live {
  min-height: 1.3em; max-width: min(680px, 100%);
  color: #E8C547; font-size: 15px; text-align: center;
}

.card {
  background: linear-gradient(135deg, rgba(19, 15, 38, .92), rgba(28, 23, 54, .88));
  border: 1px solid rgba(201, 162, 39, .22);
  border-radius: 16px;
}
.segmented { display: flex; background: #0D0A1A; border-radius: 12px; padding: 3px; border: 1px solid rgba(201, 162, 39, .2); }
.seg {
  border: none; background: transparent; color: #8A7FBD;
  font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 10px; cursor: pointer;
}
.seg.active { background: linear-gradient(135deg, #C9A227, #E8C547); color: #0D0A1A; }

.transcript { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.col { padding: 14px 14px 10px; min-height: 280px; display: flex; flex-direction: column; }
.col h2 {
  margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #E8C547;
}
.empty {
  margin: auto; color: #8A7FBD; font-size: 14px; text-align: center; line-height: 1.6;
}
.more {
  align-self: center; margin: 0 0 8px; border: 1px solid rgba(201, 162, 39, .45);
  background: transparent; color: #E8C547; font: inherit; font-weight: 700;
  letter-spacing: .06em; padding: 6px 18px; border-radius: 999px; cursor: pointer;
}
.more:hover { background: rgba(201, 162, 39, .14); }
.box {
  flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px;
  min-height: 220px; max-height: 420px;
}
.line {
  background: rgba(13, 10, 26, .55);
  border: 1px solid rgba(201, 162, 39, .12);
  border-radius: 12px; padding: 10px 12px; line-height: 1.7;
}
.line.translation { border-color: rgba(124, 58, 237, .35); }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .mobile-brand { display: flex; }
  .voice-dock-mobile {
    display: flex; max-height: 320px; overflow: hidden; flex: none;
  }
  .workspace { padding: 76px 16px 32px; }
  .transcript { grid-template-columns: 1fr; }
}
