.voice-study {
  --vs-ink: var(--ink, #202938);
  --vs-muted: var(--muted, #718096);
  --vs-line: var(--line, #dfe6ef);
  --vs-green: var(--green, #16a34a);
  max-width: 1160px;
  margin: 0 auto;
  color: var(--vs-ink);
}

.vs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border: 1px solid var(--vs-line);
  border-radius: 22px;
  background: linear-gradient(115deg, #f1fbf4 0%, #fff 66%);
  box-shadow: 0 8px 24px rgba(22, 35, 63, .045);
}

.vs-eyebrow,
.vs-answer-kicker {
  margin: 0 0 7px;
  color: var(--vs-green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.vs-header h2 {
  margin: 0;
  color: var(--vs-ink);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
}

.vs-intro {
  max-width: 610px;
  margin: 8px 0 0;
  color: var(--vs-muted);
  font-size: 15px;
  line-height: 1.55;
}

.vs-mark {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border-radius: 16px;
  background: #e4f7e9;
  color: var(--vs-green);
  font-size: 25px;
}

.vs-layout {
  display: grid;
  grid-template-columns: minmax(250px, .78fr) minmax(0, 1.7fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.vs-settings,
.vs-session {
  min-width: 0;
  border: 1px solid var(--vs-line);
  border-radius: 20px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(22, 35, 63, .045);
}

.vs-settings {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.vs-field-label,
.vs-compose > label {
  display: block;
  margin: 0 0 7px;
  color: var(--vs-ink);
  font-size: 13px;
  font-weight: 850;
}

.vs-select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--vs-line);
  border-radius: 11px;
  background: #fff;
  color: var(--vs-ink);
  font: inherit;
}

.vs-materials {
  margin-top: 23px;
  padding-top: 20px;
  border-top: 1px solid var(--vs-line);
}

.vs-section-heading h3,
.vs-answer-head h3 {
  margin: 0;
  color: var(--vs-ink);
  font-size: 16px;
}

.vs-section-heading p {
  margin: 4px 0 12px;
  color: var(--vs-muted);
  font-size: 12px;
  line-height: 1.45;
}

.vs-source-list {
  display: grid;
  max-height: 250px;
  gap: 7px;
  overflow: auto;
}

.vs-source {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--vs-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.vs-source:has(input:checked) {
  border-color: #8fdaa0;
  background: #f2fbf4;
}

.vs-source input,
.vs-auto-read input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 2px 0 0;
  accent-color: var(--vs-green);
}

.vs-source span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.vs-source b {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.vs-source small {
  color: var(--vs-muted);
  font-size: 11px;
}

.vs-source-note,
.vs-empty {
  margin: 10px 0 0;
  color: var(--vs-muted);
  font-size: 12px;
  line-height: 1.5;
}

.vs-link-button {
  margin-top: 10px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--vs-green);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.vs-link-button:hover { text-decoration: underline; }

.vs-auto-read {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--vs-line);
  color: var(--vs-muted);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.vs-session { padding: 20px; }

.vs-status {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid #dcefe1;
  border-radius: 12px;
  background: #f4fbf5;
  color: #375d43;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.vs-status[data-kind="listening"],
.vs-status[data-kind="speaking"] {
  border-color: #b7d6ff;
  background: #f1f7ff;
  color: #31567f;
}

.vs-status[data-kind="working"] {
  border-color: #d7dff0;
  background: #f5f7fb;
  color: #48566b;
}

.vs-status[data-kind="error"] {
  border-color: #f1d2ce;
  background: #fff6f4;
  color: #92453e;
}

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

.vs-status[data-kind="listening"] .vs-status-dot,
.vs-status[data-kind="speaking"] .vs-status-dot { background: #397bd3; }
.vs-status[data-kind="error"] .vs-status-dot { background: #d7685d; }

.vs-voice-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
}

.vs-mic-button,
.vs-send-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #12833e;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.vs-mic-button:hover:not(:disabled),
.vs-send-button:hover:not(:disabled) { background: #12833e; transform: translateY(-1px); }

.vs-mic-button:disabled,
.vs-send-button:disabled,
.vs-read-button:disabled,
.vs-stop-button:disabled { opacity: .52; cursor: not-allowed; }

.vs-mic-button[aria-pressed="true"] { background: #d7443f; border-color: #bd3834; }

.vs-mic-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 9px;
}

.vs-stop-button,
.vs-read-button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--vs-line);
  border-radius: 10px;
  background: #fff;
  color: var(--vs-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.vs-mic-hint {
  margin: 8px 0 15px;
  color: var(--vs-muted);
  font-size: 12px;
}

.vs-compose {
  padding: 15px;
  border: 1px solid var(--vs-line);
  border-radius: 15px;
  background: #fbfcfe;
}

.vs-compose textarea {
  display: block;
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--vs-line);
  border-radius: 10px;
  background: #fff;
  color: var(--vs-ink);
  font: inherit;
  line-height: 1.5;
}

.vs-compose textarea:focus,
.vs-select:focus,
.vs-source input:focus-visible,
.vs-auto-read input:focus-visible,
.voice-study button:focus-visible,
.voice-study summary:focus-visible {
  outline: 3px solid rgba(44, 120, 215, .3);
  outline-offset: 2px;
}

.vs-compose-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.vs-draft-hint {
  color: var(--vs-muted);
  font-size: 11px;
  line-height: 1.4;
}

.vs-send-button { min-height: 40px; padding: 0 14px; font-size: 12px; }

.vs-answer-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dfe8f5;
  border-radius: 15px;
  background: #f8faff;
}

.vs-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.vs-answer-kicker { display: block; margin-bottom: 3px; font-size: 10px; }
.vs-read-button { min-height: 36px; padding: 7px 11px; color: #31567f; }

.vs-answer-copy {
  color: var(--vs-ink);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.vs-answer-copy p { margin: 0 0 9px; }
.vs-answer-copy p:last-child { margin-bottom: 0; }
.vs-answer-copy h3 { margin: 12px 0 5px; font-size: 15px; }
.vs-answer-copy ul,
.vs-answer-copy ol { margin: 5px 0 10px; padding-left: 22px; }
.vs-answer-copy li { padding: 2px 0; }
.vs-answer-copy code { padding: 1px 4px; border-radius: 4px; background: #e9eef7; }

.vs-answer-placeholder { margin: 0; color: var(--vs-muted); font-size: 13px; line-height: 1.5; }

.vs-transcript-details {
  margin-top: 13px;
  border: 1px solid var(--vs-line);
  border-radius: 13px;
  background: #fff;
}

.vs-transcript-details summary {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  color: var(--vs-ink);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.vs-transcript-details summary span {
  min-width: 23px;
  padding: 3px 7px;
  border-radius: 20px;
  background: #eef2f7;
  color: var(--vs-muted);
  text-align: center;
}

.vs-transcript {
  display: grid;
  max-height: 340px;
  gap: 10px;
  overflow: auto;
  padding: 13px;
  border-top: 1px solid var(--vs-line);
}

.vs-message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f7fa;
}

.vs-message.is-student { justify-self: end; background: #edf8ef; }
.vs-message.is-tutor { justify-self: start; }
.vs-message-label { display: block; margin-bottom: 4px; color: var(--vs-muted); font-size: 10px; font-weight: 850; }
.vs-message-content { color: var(--vs-ink); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.vs-message-content p { margin: 0 0 6px; }
.vs-message-content p:last-child { margin-bottom: 0; }
.vs-message-content ul,
.vs-message-content ol { margin: 3px 0 6px; padding-left: 19px; }
.vs-thinking { color: var(--vs-muted); font-style: italic; }
.vs-error { color: #a03e35; }

.vs-privacy {
  margin: 13px 2px 0;
  color: var(--vs-muted);
  font-size: 11px;
  line-height: 1.55;
}

.vs-fallback {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #f0d7aa;
  border-radius: 11px;
  background: #fffaf0;
  color: #705d3b;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .vs-layout { grid-template-columns: minmax(0, 1fr); }
  .vs-settings { position: static; }
  .vs-source-list { max-height: 210px; }
}

@media (max-width: 560px) {
  .vs-header { padding: 19px; border-radius: 16px; }
  .vs-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
  .vs-settings,
  .vs-session { padding: 15px; border-radius: 16px; }
  .vs-voice-actions { align-items: stretch; flex-direction: column; }
  .vs-mic-button { width: 100%; }
  .vs-stop-button { align-self: flex-start; }
  .vs-compose-bottom { align-items: flex-end; }
  .vs-draft-hint { max-width: 54%; }
  .vs-answer-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .vs-mic-button,
  .vs-send-button { transition: none; }
}
