
:root {
  --primary: #5b5ce2;
  --primary-dark: #4546c7;
  --background: #f6f7fb;
  --surface: #ffffff;
  --text: #20243a;
  --muted: #72778b;
  --border: #e6e8f0;
  --success: #16845b;
  --danger: #d94141;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  transition: 0.2s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-btn,
#login-form button,
#register-form button {
  background: var(--primary);
  color: white;
}

.primary-btn:hover,
#login-form button:hover,
#register-form button:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #ececff;
  color: var(--primary);
}

.danger-btn {
  background: #ffe9e9;
  color: var(--danger);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 6%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  color: var(--primary);
  font-size: 25px;
}

#user-email {
  color: var(--muted);
  margin-right: 12px;
  overflow-wrap: anywhere;
}

main {
  width: min(900px, 92%);
  margin: 36px auto;
  min-height: 65vh;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.active.auth-layout {
  display: grid;
}

.hidden {
  display: none !important;
}

.topbar {
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(158px, 18vw, 198px);
  height: auto;
  max-height: 40px;
  object-fit: contain;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.container {
  width: min(1080px, 92%);
  margin: 36px auto;
  min-height: 65vh;
}

.auth-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 48px;
}

.hero h1,
.page-heading h1 {
  margin: 10px 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
}

.hero h1 span,
.page-heading h1 span {
  color: var(--primary);
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.feature-list {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.feature {
  display: flex;
  gap: 14px;
}

.feature > span {
  color: var(--primary);
  font-weight: 700;
}

.feature p,
.feature strong {
  margin: 0;
}

.panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(30, 35, 80, 0.04);
}

.auth-panel {
  padding: 26px;
}

.auth-panel h2,
.practice-panel h2,
.info-panel h2 {
  margin-bottom: 6px;
}

.auth-panel > form > .muted {
  margin: 0 0 8px;
}

.btn {
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  transition: background-color 180ms ease, opacity 180ms ease;
}

.auth-submit.is-loading,
.auth-submit.is-loading:hover {
  background: var(--primary-dark);
}

.auth-submit:focus-visible {
  outline: 3px solid rgba(91, 92, 226, 0.3);
  outline-offset: 3px;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spinner-rotate 700ms linear infinite;
}

@keyframes auth-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.btn-outline {
  border-color: var(--border);
  background: white;
  color: var(--text);
}

.btn-danger {
  background: #ffe9e9;
  color: var(--danger);
}

.btn-full {
  width: 100%;
}

.dashboard-grid,
.call-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.practice-panel,
.info-panel {
  min-height: 290px;
}

.illustration,
.avatar {
  font-size: 36px;
}

.illustration {
  margin-bottom: 14px;
}

.session-icon {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
  place-items: center;
}

.session-icon::before {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(91, 92, 226, 0.16);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.92);
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0;
  place-items: center;
  line-height: 1;
}

.audio-wave {
  display: flex;
  height: 20px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0 auto 10px;
}

.audio-wave span {
  width: 3px;
  height: 6px;
  border-radius: 3px;
  background: var(--primary);
  transform: scaleY(0.7);
  transform-origin: center;
}

.audio-wave span:nth-child(2),
.audio-wave span:nth-child(6) {
  height: 10px;
}

.audio-wave span:nth-child(3),
.audio-wave span:nth-child(5) {
  height: 14px;
}

.audio-wave span:nth-child(4) {
  height: 17px;
}

.call-panel.is-connected .session-icon::before {
  animation: session-ring 3.2s ease-out infinite;
}

.call-panel.is-connected .audio-wave span {
  animation: audio-wave-idle 1.7s ease-in-out infinite alternate;
}

.call-panel.is-connected .audio-wave span:nth-child(2),
.call-panel.is-connected .audio-wave span:nth-child(6) {
  animation-delay: 0.25s;
}

.call-panel.is-connected .audio-wave span:nth-child(3),
.call-panel.is-connected .audio-wave span:nth-child(5) {
  animation-delay: 0.5s;
}

.call-panel.is-connected .audio-wave span:nth-child(4) {
  animation-delay: 0.75s;
}

@keyframes session-ring {
  0% {
    opacity: 0.2;
    transform: scale(0.94);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes audio-wave-idle {
  from {
    transform: scaleY(0.55);
  }
  to {
    transform: scaleY(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-panel.is-connected .session-icon::before,
  .call-panel.is-connected .audio-wave span,
  .auth-spinner {
    animation: none;
  }
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
}

.small {
  font-size: 13px;
}

.centered-panel {
  max-width: 620px;
  margin: 30px auto;
  text-align: center;
}

.loader {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.call-panel,
.transcript-panel {
  text-align: center;
}

.transcript-panel {
  text-align: left;
}

.call-controls,
.transcript-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.call-controls {
  flex-wrap: wrap;
  justify-content: center;
}

.transcript-list {
  min-height: 140px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafaff;
}

.transcript-entry {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.transcript-entry:last-child {
  margin-bottom: 0;
}

.transcript-interim {
  min-height: 1.6em;
  color: var(--muted);
  font-style: italic;
  overflow-wrap: anywhere;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 8px 30px rgba(30, 35, 80, 0.04);
}

.auth-card {
  max-width: 460px;
  margin: 30px auto;
}

h2 {
  margin-top: 0;
  line-height: 1.3;
}

.subtitle,
.muted {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.tabs button {
  flex: 1;
  background: #f0f1f8;
  color: var(--muted);
}

.tabs button.active {
  background: var(--primary);
  color: white;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d9dce8;
  border-radius: 10px;
  background: white;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.12);
}

#notice {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  background: #ececff;
  color: var(--primary-dark);
}

#notice.show {
  display: block;
}

#notice.error {
  background: #ffe9e9;
  color: var(--danger);
}

#notice.success {
  background: #e4f8ef;
  color: var(--success);
}

#matching-view,
#call-view {
  text-align: center;
}

.status-indicator {
  width: 64px;
  height: 64px;
  margin: 12px auto 22px;
  border-radius: 50%;
  background: #ececff;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 28px;
}

.call-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

#remote-audio {
  display: block;
  width: 100%;
  margin: 15px 0;
}

.transcript {
  margin-top: 28px;
  text-align: left;
  background: #fafaff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  min-height: 140px;
}

.transcript h3 {
  margin-top: 0;
}

#transcript-list {
  padding-left: 20px;
}

#transcript-list li {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

#transcript-empty {
  color: var(--muted);
}

footer {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  header {
    padding: 14px 4%;
    flex-wrap: wrap;
  }

  header h1 {
    font-size: 22px;
  }

  #user-email {
    font-size: 13px;
  }

  main,
  .container {
    margin: 22px auto;
  }

  .auth-layout,
  .dashboard-grid,
  .call-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .panel,
  .card {
    padding: 20px;
    border-radius: 14px;
  }

  .hero h1 {
    font-size: 34px;
  }
}

body.call-active {
  --call-bg: #10111b;
  --call-surface: rgba(25, 27, 42, 0.92);
  --call-border: rgba(196, 191, 231, 0.13);
  --call-text: #f4f3fb;
  --call-muted: #a3a2b8;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 3%, rgba(79, 67, 143, 0.19), transparent 38rem),
    radial-gradient(ellipse at 92% 58%, rgba(47, 72, 132, 0.11), transparent 30rem),
    var(--call-bg);
  color: var(--call-text);
}

body.call-active .topbar {
  background: rgba(16, 17, 27, 0.78);
  border-bottom-color: var(--call-border);
}

body.call-active .brand {
  color: var(--call-text);
}

body.call-active .brand-logo {
  filter: brightness(0) invert(1);
}

body.call-active #user-email,
body.call-active footer {
  color: var(--call-muted);
}

body.call-active .container {
  width: min(960px, 92%);
  min-height: calc(100vh - 150px);
  margin: 28px auto 44px;
}

.call-shell {
  width: min(100%, 860px);
  margin: 0 auto;
}

.call-intro {
  min-height: 70px;
  margin-bottom: 12px;
  text-align: center;
}

.call-intro .eyebrow {
  color: #a79cf5;
}

.call-message {
  min-height: 1.5em;
  margin: 5px 0 0;
  color: var(--call-muted);
  font-size: 14px;
}

.call-intro #start-call-btn {
  margin-top: 8px;
}

.call-intro .audio-retry-btn {
  margin-top: 8px;
  border: 1px solid var(--call-border);
  background: #292b3c;
  color: var(--call-text);
}

.call-intro .audio-retry-btn:hover {
  background: #34364b;
}

.call-panel {
  padding: clamp(28px, 6vw, 54px) clamp(18px, 6vw, 64px) 24px;
  overflow: hidden;
  border: 1px solid var(--call-border);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 38%),
    var(--call-surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  text-align: center;
  backdrop-filter: blur(18px);
}

.partner-identity {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.partner-avatar-ring {
  display: grid;
  width: 142px;
  height: 142px;
  margin-bottom: 22px;
  padding: 5px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #9c88f3 2%, #5e74d7 48%, #4ba5bd 100%);
  box-shadow: 0 12px 38px rgba(94, 103, 205, 0.2);
}

.partner-avatar {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 3px solid #1b1c2c;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 24%, rgba(191, 171, 255, 0.24), transparent 42%),
    linear-gradient(145deg, #34324f, #242c42);
  color: #f7f4ff;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.partner-identity h1 {
  margin: 0;
  color: var(--call-text);
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.call-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--call-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c2bfd4;
  font-size: 12px;
  font-weight: 600;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a3a2b8;
}

.connection-pill[data-state="connected"] {
  border-color: rgba(97, 203, 160, 0.2);
  color: #9bdec3;
}

.connection-pill[data-state="connected"] .connection-dot {
  background: #65c99e;
}

.connection-pill[data-state="connecting"] .connection-dot {
  background: #c2a76b;
}

.connection-pill[data-state="disconnected"] .connection-dot {
  background: #e2767e;
}

.call-duration {
  min-width: 48px;
  color: var(--call-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.call-subtitle {
  margin: 11px 0 0;
  color: var(--call-muted);
  font-size: 14px;
}

.audio-wave {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 26px auto 30px;
}

.audio-wave span {
  width: 3px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #a991f3, #658bd9);
  opacity: 0.66;
  transform: scaleY(0.72);
  transform-origin: center;
}

.audio-wave span:nth-child(3n + 1) { height: 13px; }
.audio-wave span:nth-child(4n + 2) { height: 20px; }
.audio-wave span:nth-child(5n + 3) { height: 27px; }
.audio-wave span:nth-child(7n + 4) { height: 34px; }

.call-panel.is-connected .audio-wave span {
  animation: call-wave 1.2s ease-in-out infinite alternate;
}

.call-panel.is-connected .audio-wave span:nth-child(3n) { animation-delay: -0.52s; }
.call-panel.is-connected .audio-wave span:nth-child(4n + 1) { animation-delay: -0.81s; }
.call-panel.is-connected .audio-wave span:nth-child(5n + 2) { animation-delay: -0.29s; }

@keyframes call-wave {
  from { transform: scaleY(0.46); opacity: 0.42; }
  to { transform: scaleY(1); opacity: 0.9; }
}

.call-controls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(32px, 9vw, 84px);
  margin: 0 auto 30px;
}

.call-control {
  display: flex;
  min-width: 78px;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}

.control-button {
  display: grid;
  width: 66px;
  height: 66px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(223, 220, 245, 0.14);
  border-radius: 50%;
  background: #292b3c;
  color: #f3f1fc;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.control-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(198, 184, 255, 0.42);
  background: #34364b;
}

.control-button:focus-visible,
.transcript-toggle:focus-visible,
.call-intro #start-call-btn:focus-visible {
  outline: 3px solid #a99af7;
  outline-offset: 4px;
}

.control-button:disabled {
  opacity: 0.45;
}

.control-button.is-muted {
  border-color: rgba(226, 118, 126, 0.38);
  background: rgba(128, 51, 65, 0.35);
  color: #ffb2b8;
}

.control-button-end {
  width: 72px;
  height: 72px;
  border-color: transparent;
  background: linear-gradient(145deg, #f06470, #d84656);
  box-shadow: 0 8px 22px rgba(216, 70, 86, 0.19);
}

.control-button-end:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(145deg, #fa7480, #e34d5e);
}

.control-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.end-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
  transform: rotate(135deg);
}

.control-label {
  color: #c0bfd0;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.skip-limit-message {
  margin: -14px 0 22px;
  color: #e4bd83;
  font-size: 13px;
}

#remote-audio {
  display: none;
}

.transcript-panel {
  margin-top: 12px;
  border: 1px solid var(--call-border);
  border-radius: 16px;
  background: rgba(12, 13, 23, 0.28);
  text-align: left;
}

.transcript-toggle {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--call-text);
  text-align: left;
}

.transcript-toggle:hover {
  background: rgba(255, 255, 255, 0.025);
}

.transcript-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(156, 136, 243, 0.17);
  border-radius: 12px;
  background: rgba(126, 105, 218, 0.11);
  color: #b2a3f5;
}

.transcript-icon svg,
.transcript-chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.transcript-title-group {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.transcript-title {
  font-size: 15px;
  font-weight: 600;
}

.transcript-privacy {
  margin-top: 3px;
  color: var(--call-muted);
  font-size: 12px;
  font-weight: 400;
}

.transcript-state {
  padding: 5px 9px;
  border: 1px solid var(--call-border);
  border-radius: 999px;
  color: #aaa8bc;
  font-size: 11px;
  font-weight: 600;
}

.transcript-state[data-state="listening"] {
  border-color: rgba(97, 203, 160, 0.2);
  color: #9bdec3;
}

.transcript-state[data-state="unavailable"] {
  border-color: rgba(226, 118, 126, 0.2);
  color: #f2a4aa;
}

.transcript-state[data-state="paused"] {
  color: #e4bd83;
}

.transcript-chevron {
  flex: 0 0 auto;
  color: var(--call-muted);
  transition: transform 160ms ease;
}

.transcript-toggle[aria-expanded="true"] .transcript-chevron {
  transform: rotate(180deg);
}

.transcript-content {
  padding: 0 20px 18px 72px;
}

.transcript-status {
  margin: 0 0 8px;
  color: var(--call-muted);
  font-size: 12px;
}

.browser-transcript-button {
  min-height: 42px;
  margin: 0 0 12px;
  padding: 9px 14px;
  border: 1px solid rgba(156, 136, 243, 0.28);
  border-radius: 10px;
  background: rgba(126, 105, 218, 0.13);
  color: #c8bdfb;
  font-size: 13px;
}

.browser-transcript-button:hover:not(:disabled) {
  border-color: rgba(156, 136, 243, 0.5);
  background: rgba(126, 105, 218, 0.2);
}

.browser-transcript-button:focus-visible {
  outline: 3px solid #a99af7;
  outline-offset: 3px;
}

.server-transcript-status {
  margin: 0 0 8px;
  color: #8f8ea4;
  font-size: 11px;
}

.transcript-state[data-state="ready"],
.transcript-state[data-state="reconnecting"],
.transcript-state[data-state="starting"] {
  color: #c2b7f5;
}

.transcript-interim {
  min-height: 1.6em;
  margin: 0;
  color: #bbb4dd;
  font-size: 14px;
  font-style: italic;
  overflow-wrap: anywhere;
}

.transcript-list {
  max-height: 220px;
  min-height: 52px;
  margin-top: 6px;
  overflow-y: auto;
  color: #e2e0ec;
}

.transcript-entry {
  margin: 0 0 9px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.transcript-entry:last-child {
  margin-bottom: 0;
}

.empty-state {
  margin: 0;
  color: #87869b;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .call-panel.is-connected .audio-wave span,
  .control-button,
  .transcript-chevron {
    animation: none;
    transition: none;
  }
}

@media (max-width: 600px) {
  body.call-active .container {
    width: min(100% - 28px, 480px);
    margin: 16px auto 28px;
  }

  .call-intro {
    min-height: 62px;
  }

  .call-panel {
    padding: 30px 18px 18px;
    border-radius: 22px;
  }

  .partner-avatar-ring {
    width: 116px;
    height: 116px;
    margin-bottom: 18px;
  }

  .partner-avatar {
    font-size: 40px;
  }

  .audio-wave {
    margin: 24px auto 28px;
  }

  .call-controls {
    gap: clamp(24px, 8vw, 48px);
    margin-bottom: 26px;
  }

  .control-button {
    width: 60px;
    height: 60px;
  }

  .control-button-end {
    width: 66px;
    height: 66px;
  }

  .call-control {
    min-width: 68px;
  }

  .transcript-toggle {
    gap: 10px;
    min-height: 72px;
    padding: 12px;
  }

  .transcript-title {
    font-size: 14px;
  }

  .transcript-privacy {
    font-size: 11px;
  }

  .transcript-state {
    padding: 4px 7px;
  }

  .transcript-content {
    padding: 0 14px 16px;
  }

  .browser-transcript-button {
    width: 100%;
  }
}

@media (max-width: 370px) {
  .transcript-toggle {
    flex-wrap: wrap;
  }

  .transcript-title-group {
    flex-basis: calc(100% - 54px);
  }

  .transcript-chevron {
    margin-left: auto;
  }
}

body.auth-active,
body.document-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 5% 5%, rgba(116, 104, 232, 0.11), transparent 34rem),
    radial-gradient(ellipse at 96% 72%, rgba(92, 135, 226, 0.09), transparent 32rem),
    #f7f7fc;
}

body.auth-active .topbar,
body.document-page .document-topbar {
  min-height: 76px;
  padding: 14px max(4%, calc((100vw - 1180px) / 2));
  border-bottom-color: rgba(97, 91, 169, 0.1);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

body.auth-active .brand,
body.document-page .brand {
  min-width: 0;
}

body.auth-active .container {
  width: min(1140px, calc(100% - 40px));
  min-height: auto;
  margin: clamp(36px, 7vh, 78px) auto 40px;
}

.auth-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  align-items: center;
  column-gap: clamp(42px, 8vw, 112px);
  row-gap: 38px;
}

.hero {
  max-width: 540px;
}

.hero > .eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #625bd0;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.hero h1 {
  max-width: 520px;
  margin: 12px 0 18px;
  color: #20223d;
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

.hero h1 span,
.page-heading h1 span {
  color: #665cda;
}

.hero > p {
  max-width: 440px;
  margin: 0;
  color: #686c83;
  font-size: 16px;
  line-height: 1.75;
}

.feature-list {
  gap: 17px;
  margin-top: 32px;
}

.feature {
  align-items: flex-start;
  gap: 14px;
}

.feature > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(103, 94, 214, 0.13);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  color: #655bd5;
  font-size: 11px;
}

.feature strong {
  display: block;
  margin: 1px 0 2px;
  color: #292b45;
  font-size: 14px;
}

.feature p {
  color: #787b8e;
  font-size: 13px;
}

.auth-panel {
  width: 100%;
  padding: clamp(24px, 3.5vw, 38px);
  border-color: rgba(97, 91, 169, 0.12);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(44, 42, 95, 0.09), 0 2px 8px rgba(44, 42, 95, 0.03);
  backdrop-filter: blur(14px);
}

.auth-panel .tabs {
  gap: 5px;
  margin: 0 0 28px;
  padding: 5px;
  border: 1px solid #eeedf6;
  border-radius: 13px;
  background: #f5f4fa;
}

.auth-panel .tabs .tab {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #74758a;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.auth-panel .tabs .tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.65);
  color: #464763;
}

.auth-panel .tabs .tab.active {
  background: #fff;
  color: #4f49b9;
  box-shadow: 0 2px 7px rgba(38, 35, 78, 0.09);
}

.auth-panel h2 {
  margin: 0 0 5px;
  color: #252640;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.auth-panel > form > .muted {
  margin: 0 0 7px;
  color: #787b8f;
  font-size: 13px;
}

.auth-panel form {
  gap: 11px;
}

.auth-panel form label {
  margin-top: 6px;
  color: #3b3c56;
  font-size: 12px;
  font-weight: 600;
}

.auth-panel form input {
  min-height: 48px;
  padding: 11px 13px;
  border-color: #e2e2ec;
  border-radius: 11px;
  background: #fff;
  color: #22243d;
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-panel form input::placeholder {
  color: #999bad;
}

.auth-panel form input:focus {
  border-color: #7a70dc;
  box-shadow: 0 0 0 4px rgba(103, 94, 214, 0.12);
}

.auth-panel .auth-submit {
  min-height: 49px;
  margin-top: 10px;
  border-radius: 11px;
  background: linear-gradient(110deg, #6c5fdd, #527bd6);
  box-shadow: 0 8px 17px rgba(90, 89, 202, 0.2);
  font-size: 14px;
}

.auth-panel .auth-submit:hover:not(:disabled) {
  background: linear-gradient(110deg, #5d51ce, #446dc7);
}

.auth-panel .auth-submit:focus-visible,
.auth-panel .tab:focus-visible,
.auth-panel input:focus-visible,
.auth-footer a:focus-visible,
.document-page a:focus-visible {
  outline: 3px solid rgba(91, 83, 208, 0.45);
  outline-offset: 3px;
}

.auth-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(97, 91, 169, 0.12);
  color: #818397;
  font-size: 12px;
}

.auth-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 23px;
}

.auth-footer a,
.document-page a {
  color: #5953bb;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.auth-footer a {
  text-decoration: none;
}

.auth-footer a:hover,
.document-page a:hover {
  color: #403aa0;
  text-decoration: underline;
}

.auth-footer p {
  margin: 0;
  text-align: right;
}

body.auth-active .app-footer {
  display: none;
}

body.document-page {
  display: flex;
  flex-direction: column;
}

.document-topbar {
  flex: 0 0 auto;
}

.document-back {
  color: #5551b8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.document-back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.document-container {
  width: min(820px, calc(100% - 36px));
  flex: 1 0 auto;
  margin: 42px auto 56px;
}

.document-card {
  padding: clamp(25px, 6vw, 58px);
  border: 1px solid rgba(97, 91, 169, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 64px rgba(44, 42, 95, 0.08);
}

.document-card > .eyebrow {
  color: #625bd0;
  font-size: 11px;
  letter-spacing: 0.15em;
}

.document-card h1 {
  margin: 9px 0 4px;
  color: #22243d;
  font-size: clamp(34px, 6vw, 48px);
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.document-updated {
  margin: 0 0 25px;
  color: #828498;
  font-size: 13px;
}

.document-card p,
.document-card li {
  color: #55596e;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.document-card h2 {
  margin: 30px 0 8px;
  color: #292b45;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.document-card ul {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.document-card li::marker {
  color: #6b60d8;
}

.document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #ecebf3;
  font-size: 14px;
}

.document-footer {
  padding: 18px 20px 24px;
  color: #85879a;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  body.auth-active .container {
    width: min(100% - 36px, 520px);
    margin: 32px auto 28px;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .hero {
    max-width: none;
    text-align: center;
  }

  .hero h1 {
    max-width: 540px;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(37px, 8vw, 52px);
  }

  .hero > p {
    margin: 0 auto;
    font-size: 15px;
  }

  .feature-list {
    width: min(100%, 430px);
    margin: 23px auto 0;
    text-align: left;
  }

  .auth-panel {
    max-width: 520px;
    justify-self: center;
  }

  .auth-footer {
    flex-direction: column;
    align-items: center;
    gap: 11px;
    padding-top: 18px;
    text-align: center;
  }

  .auth-footer-links {
    justify-content: center;
  }

  .auth-footer p {
    text-align: center;
  }

  .document-container {
    margin: 24px auto 36px;
  }
}

@media (max-width: 380px) {
  body.auth-active .container {
    width: calc(100% - 28px);
    margin-top: 25px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero > p {
    font-size: 14px;
  }

  .auth-panel {
    padding: 21px 17px;
    border-radius: 19px;
  }

  .auth-panel .tabs .tab {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 12px;
  }

  .auth-footer-links {
    gap: 10px 16px;
  }

  .document-container {
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  .document-card {
    padding: 24px 19px;
    border-radius: 17px;
  }

  .document-card p,
  .document-card li {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel .tabs .tab,
  .auth-panel form input,
  .auth-panel .auth-submit {
    transition: none;
  }
}
