#mode-hcs {
  --hcs-paper: #f4f7fc;
  --hcs-ink: #1e293b;
  --hcs-muted: #64748b;
  --hcs-border: rgba(37, 99, 235, 0.15);
  --hcs-accent: #2563eb;
  --hcs-accent-hover: #1d4ed8;
  --hcs-accent-soft: rgba(37, 99, 235, 0.08);
  --hcs-accent-softer: rgba(37, 99, 235, 0.04);
  --hcs-success: #16a34a;
  --hcs-success-bg: rgba(22, 163, 74, 0.06);
  --hcs-success-border: rgba(22, 163, 74, 0.4);
  --hcs-danger: #dc2626;
  --hcs-danger-bg: rgba(220, 38, 38, 0.06);
  --hcs-danger-border: rgba(220, 38, 38, 0.4);
  
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 35%),
    radial-gradient(circle at left bottom, rgba(59, 130, 246, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 8px 2px 18px;
}

#mode-hcs::before {
  display: none;
}

.hcs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.hcs-split-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin-bottom: 20px;
  align-items: stretch;
}

.hcs-audio-section,
.hcs-question-section,
.hcs-explanation-section {
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}

.hcs-card-header {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.08);
  padding-bottom: 12px;
}

.hcs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hcs-accent);
  font-weight: 700;
}

/* Audio player controls */
.hcs-audio-player {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
  margin-top: 8px;
}

.hcs-audio-player:hover {
  box-shadow: none;
}

/* Visualizer Bars */
.hcs-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 48px;
  margin: 10px 0;
}

.hcs-vis-bar {
  width: 4px;
  height: 8px;
  background-color: var(--hcs-accent);
  border-radius: 2px;
  opacity: 0.3;
  transition: height 0.15s ease, opacity 0.15s ease;
}

.hcs-visualizer.is-playing .hcs-vis-bar {
  opacity: 0.85;
  animation: hcs-bounce 1s ease-in-out infinite alternate;
}

.hcs-vis-bar:nth-child(1) { animation-delay: 0.1s; }
.hcs-vis-bar:nth-child(2) { animation-delay: 0.3s; }
.hcs-vis-bar:nth-child(3) { animation-delay: 0.5s; }
.hcs-vis-bar:nth-child(4) { animation-delay: 0.2s; }
.hcs-vis-bar:nth-child(5) { animation-delay: 0.4s; }
.hcs-vis-bar:nth-child(6) { animation-delay: 0.6s; }
.hcs-vis-bar:nth-child(7) { animation-delay: 0.15s; }

@keyframes hcs-bounce {
  0% { height: 8px; }
  100% { height: 36px; }
}

/* Audio Controls */
.hcs-audio-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Play/Pause Button */
.hcs-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--hcs-accent) 0%, #1d4ed8 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.hcs-play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.hcs-play-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.hcs-play-btn:active {
  transform: scale(0.96);
}

.hcs-play-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Progress Area */
.hcs-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.hcs-timeline-wrapper {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.hcs-timeline {
  width: 100%;
  height: 6px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 3px;
  position: relative;
  overflow: visible;
}

.hcs-timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hcs-accent) 0%, #3b82f6 100%);
  border-radius: 3px;
  pointer-events: none;
}

.hcs-timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid var(--hcs-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: transform 0.1s ease;
}

.hcs-timeline-wrapper:hover .hcs-timeline-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}

.hcs-time-display {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: var(--hcs-muted);
  font-weight: 500;
}

/* Selector settings */
.hcs-settings-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid rgba(37, 99, 235, 0.08);
  padding-top: 18px;
}

.hcs-setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  min-width: 140px;
}

.hcs-setting-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hcs-muted);
  font-weight: 700;
}

/* Voice Dropdown Picker */
.hcs-voice-select-wrapper {
  position: relative;
  width: 100%;
}

.hcs-voice-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 10px 16px;
  padding-right: 40px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--hcs-ink);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hcs-voice-select:hover {
  border-color: var(--hcs-accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}

.hcs-voice-select:focus {
  outline: none;
  border-color: var(--hcs-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.hcs-voice-select-wrapper::after {
  content: "\25BE";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--hcs-muted);
  pointer-events: none;
}

/* Speed Button Group */
.hcs-speed-group {
  display: flex;
  background: rgba(37, 99, 235, 0.05);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.05);
  align-self: flex-start;
}

.hcs-speed-btn {
  border: none;
  background: transparent;
  color: var(--hcs-muted);
  padding: 6px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hcs-speed-btn:hover {
  color: var(--hcs-accent);
}

.hcs-speed-btn.is-active {
  background: #ffffff;
  color: var(--hcs-accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Question Prompts & Subtitles */
.hcs-question-prompt {
  font-family: 'Outfit', sans-serif;
  color: var(--hcs-ink);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.hcs-subtitle {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hcs-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.hcs-choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Choice card designs */
.hcs-choice-card {
  appearance: none;
  position: relative;
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.hcs-choice-card:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: var(--hcs-accent);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.06);
}

.hcs-choice-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.hcs-choice-card:disabled {
  cursor: default;
}

/* Radio button appearance */
.hcs-choice-radio {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.25);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-top: 3px;
}

.hcs-choice-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: all 0.15s ease;
}

.hcs-choice-text {
  font-family: 'Outfit', sans-serif;
  color: var(--hcs-ink);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Active Selected state */
.hcs-choice-card.is-selected {
  border-color: var(--hcs-accent);
  background: var(--hcs-accent-soft);
}

.hcs-choice-card.is-selected .hcs-choice-radio {
  background: var(--hcs-accent);
  border-color: var(--hcs-accent);
}

.hcs-choice-card.is-selected .hcs-choice-radio::after {
  opacity: 1;
}

/* Correctly selected choice: Solid green border and soft green bg */
.hcs-choice-card.is-correct-selected {
  border-color: var(--hcs-success);
  background: var(--hcs-success-bg);
  pointer-events: none;
}
.hcs-choice-card.is-correct-selected .hcs-choice-radio {
  background: var(--hcs-success);
  border-color: var(--hcs-success);
}
.hcs-choice-card.is-correct-selected .hcs-choice-radio::after {
  opacity: 1;
}

/* Incorrectly selected choice: Solid red border and soft red bg */
.hcs-choice-card.is-incorrect-selected {
  border-color: var(--hcs-danger);
  background: var(--hcs-danger-bg);
  pointer-events: none;
}
.hcs-choice-card.is-incorrect-selected .hcs-choice-radio {
  background: var(--hcs-danger);
  border-color: var(--hcs-danger);
}
.hcs-choice-card.is-incorrect-selected .hcs-choice-radio::after {
  opacity: 1;
}

/* Missed correct answer: Dashed green border and very soft green bg */
.hcs-choice-card.is-missed-correct {
  border: 2px dashed var(--hcs-success);
  background: rgba(22, 163, 74, 0.04);
  pointer-events: none;
}
.hcs-choice-card.is-missed-correct .hcs-choice-radio {
  border-color: var(--hcs-success);
  border-style: dashed;
}

/* Disabled state for unselected incorrect options after submit */
.hcs-choice-card.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

/* Actions footer */
.hcs-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.hcs-buttons-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Result panel */
.hcs-result-box {
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--hcs-border);
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
}

.hcs-result-header {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.hcs-result-header.is-correct {
  color: var(--hcs-success);
}

.hcs-result-header.is-incorrect {
  color: var(--hcs-danger);
}

.hcs-result-desc {
  font-size: 0.92rem;
  color: var(--hcs-muted);
}

/* Explanation Panel accordion styling */
.hcs-explanation-panel {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hcs-explanation-section {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hcs-explanation-header {
  font-weight: 700;
  color: var(--hcs-accent);
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.2);
  padding-bottom: 6px;
}

.hcs-explanation-content {
  font-size: 0.96rem;
  color: var(--hcs-ink);
  line-height: 1.65;
}

.hcs-explanation-content p {
  margin: 0 0 12px 0;
}

.hcs-explanation-content strong {
  color: var(--hcs-accent);
}

.hcs-inline-code {
  display: inline-block;
  padding: 0 0.25em;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--hcs-accent);
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 0.92em;
}

/* Transcript Container (Shown after submit) */
.hcs-transcript-section {
  padding: 18px 0 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 0;
}

.hcs-transcript-header {
  font-weight: 700;
  color: var(--hcs-accent);
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.2);
  padding-bottom: 6px;
}

.hcs-transcript-text {
  font-family: 'Lora', serif;
  color: var(--hcs-ink);
  font-size: 1.04rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* Responsive queries */
@media (max-width: 900px) {
  .hcs-split-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .hcs-audio-player {
    padding: 0;
  }
}

@media (max-width: 640px) {
  #mode-hcs {
    padding-inline: 0;
  }
  
  .hcs-audio-section,
  .hcs-question-section,
  .hcs-explanation-section {
    padding: 12px 0;
  }
  
  .hcs-result-box {
    border-radius: 8px;
    padding: 16px;
  }
  
  .hcs-settings-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}
