
:root {
  --bg: #fbfbfc;
  --ink: #111318;
  --muted: #8a8f9c;
  --line: #e8e9ee;
  --blue: #4154f1;
  --blue-deep: #0e1b67;
  --green: #29492f;
  --gold: #cfb35f;
  --shadow: 0 22px 70px rgba(26, 31, 52, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f5f6f8;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select {
  font: inherit;
}

svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.app-shell {
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 4;
}

.icon-button,
.bar-icon,
.send-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #242834;
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  padding: 0;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  width: 42px;
}

.icon-button:hover,
.bar-icon:hover,
.send-button:hover {
  border-color: rgba(65, 84, 241, .36);
  box-shadow: 0 10px 28px rgba(65, 84, 241, .12);
  transform: translateY(-1px);
}

.locked {
  color: #6f7480;
}

.session-panel {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(26, 31, 52, .08);
  left: 24px;
  max-height: calc(100vh - 190px);
  overflow: hidden;
  padding: 14px;
  position: fixed;
  top: 92px;
  width: 220px;
  z-index: 3;
}

.session-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.session-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.session-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #242834;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  min-height: 38px;
  overflow: hidden;
  padding: 8px 10px;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.session-item.active {
  border-color: rgba(65, 84, 241, .58);
  box-shadow: 0 8px 20px rgba(65, 84, 241, .1);
  color: var(--blue);
}

.translator-stage {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 88px 24px 150px;
  text-align: center;
}

.stage-copy {
  min-height: 118px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: 0;
  line-height: 1.06;
  margin: 0;
}

#status {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

.voice-zone {
  align-items: center;
  display: flex;
  height: 224px;
  justify-content: center;
  margin-top: 24px;
}

.wave-ring {
  align-items: center;
  border-radius: 999px;
  display: flex;
  height: 168px;
  justify-content: center;
  position: relative;
  width: 168px;
}

.wave-ring::before,
.wave-ring::after {
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
}

.wave-ring::before {
  background:
    repeating-conic-gradient(from 0deg, rgba(65,84,241,.88) 0 2deg, transparent 2deg 5deg);
  mask: radial-gradient(circle, transparent 0 58px, #000 59px 70px, transparent 71px);
  opacity: .9;
}

.wave-ring::after {
  border: 1px solid rgba(65, 84, 241, .12);
  box-shadow: 0 0 0 28px rgba(65, 84, 241, .035);
  inset: 34px;
}

.wave-ring.listening::before {
  animation: spin 1.8s linear infinite;
}

.wave-ring.listening .mic-button {
  transform: scale(1.06);
}

.mic-button {
  align-items: center;
  background: radial-gradient(circle at 35% 25%, #6674ff, var(--blue) 48%, var(--blue-deep));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 38px rgba(25, 40, 139, .24);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 76px;
  justify-content: center;
  position: relative;
  transition: transform .2s ease;
  width: 76px;
  z-index: 1;
}

.mic-button svg {
  height: 32px;
  width: 32px;
}

.lesson-line {
  color: #a2a6b0;
  font-size: 14px;
  margin: 20px 0 0;
  max-width: min(680px, 90vw);
}

.lesson-line strong {
  color: #15171d;
}

.lesson-line span {
  margin-left: 4px;
}

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-top: 32px;
  max-width: min(720px, 92vw);
  padding: 22px 26px;
  text-align: left;
  width: 100%;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-height: 260px;
  max-width: min(720px, 92vw);
  overflow-y: auto;
  padding: 2px;
  width: 100%;
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.45;
  max-width: 86%;
  padding: 10px 12px;
  text-align: left;
  white-space: pre-wrap;
}

.chat-message.user {
  align-self: flex-end;
  background: #f2f4ff;
}

.chat-message.assistant {
  align-self: flex-start;
  background: #fff;
  border-left: 4px solid var(--gold);
}

.result-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.result-text {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.2;
}

.command-dock {
  bottom: 24px;
  left: 50%;
  max-width: min(820px, calc(100vw - 48px));
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 5;
}

.language-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.language-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  appearance: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #1a1e2a;
  font-size: 12px;
  font-weight: 700;
  max-width: 180px;
  min-height: 34px;
  padding: 0 18px;
  text-align: center;
}

.command-bar {
  align-items: center;
  background: #fff;
  border: 1.5px solid rgba(65, 84, 241, .76);
  border-radius: 7px;
  box-shadow: 0 16px 45px rgba(28, 40, 110, .1);
  display: grid;
  gap: 8px;
  grid-template-columns: 42px 42px minmax(0, 1fr) 42px;
  min-height: 48px;
  padding: 3px 5px;
}

.bar-icon,
.send-button {
  border: 0;
  height: 38px;
  width: 38px;
}

.send-button {
  background: var(--blue);
  color: #fff;
}

.command-bar input {
  border: 0;
  color: #1c2130;
  min-width: 0;
  outline: none;
  text-align: center;
}

.command-bar input::placeholder {
  color: #b5b9c3;
}

.toast {
  background: #161922;
  border-radius: 999px;
  bottom: 92px;
  color: #fff;
  font-size: 13px;
  left: 50%;
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .top-actions {
    padding: 16px;
  }

  .translator-stage {
    padding-bottom: 170px;
  }

  .command-dock {
    bottom: 14px;
    max-width: calc(100vw - 24px);
  }

  .session-panel {
    display: none;
  }

  .command-bar {
    grid-template-columns: 38px 38px minmax(0, 1fr) 38px;
  }

  .lesson-line {
    font-size: 13px;
  }
}
