.voice-recorder-page {
  background: #fafafa;
  min-height: calc(100vh - 70px);
  padding: 52px 20px 80px;
}

.voice-recorder-shell {
  margin: 0 auto;
  max-width: 860px;
}

.voice-recorder-sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.voice-recorder-hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.voice-recorder-intro {
  margin: 0;
  max-width: 760px;
  text-align: center;
}

.voice-recorder-intro h1 {
  color: var(--dark);
  font-size: clamp(36px, 4.2vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.16;
  margin: 0;
}

.voice-recorder-intro h1 span {
  color: var(--orange);
  font: inherit;
}

.voice-recorder-intro p {
  color: #494949;
  font-size: 17px;
  line-height: 1.55;
  margin: 14px auto 0;
  max-width: 650px;
}

.voice-recorder-intro p strong {
  color: var(--dark);
  font-weight: 700;
}

.voice-recorder-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  max-width: 760px;
  padding: 26px;
  width: 100%;
}

.voice-recorder-field {
  display: block;
  margin-bottom: 20px;
}

.voice-recorder-field > span {
  color: #242833;
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.voice-recorder-field input {
  background: #fff;
  border: 1px solid #d8dce3;
  border-radius: 9px;
  color: #161616;
  font: inherit;
  min-height: 48px;
  padding: 11px 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.voice-recorder-field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 130, 13, 0.14);
  outline: 0;
}

.voice-recorder-field input:disabled {
  background: #f3f4f6;
  color: #6b7280;
}

.voice-recorder-readout {
  align-items: center;
  background: linear-gradient(145deg, #111318 0%, #252933 100%);
  border: 1px solid #2e333e;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 35px rgba(15, 23, 42, 0.12);
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: 126px minmax(0, 1fr);
  min-height: 188px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.voice-recorder-readout::after {
  background: radial-gradient(circle, rgba(255, 130, 13, 0.16), transparent 68%);
  content: "";
  height: 220px;
  pointer-events: none;
  position: absolute;
  right: -88px;
  top: -102px;
  width: 220px;
}

.voice-recorder-visual {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 126px;
  position: relative;
}

.voice-recorder-disc {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  height: 96px;
  justify-content: center;
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
  width: 96px;
  z-index: 1;
}

.voice-recorder-disc::before,
.voice-recorder-disc::after {
  border: 1px solid rgba(255, 130, 13, 0.35);
  border-radius: 50%;
  content: "";
  inset: -1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.voice-recorder-disc svg {
  display: block;
  height: 44px;
  width: 44px;
}

.voice-recorder-visual[data-state="recording"] .voice-recorder-disc {
  background: rgba(255, 130, 13, 0.12);
  border-color: rgba(255, 130, 13, 0.72);
  color: #ff942f;
}

.voice-recorder-visual[data-state="recording"] .voice-recorder-disc::before,
.voice-recorder-visual[data-state="recording"] .voice-recorder-disc::after {
  animation: voice-recorder-pulse 2s ease-out infinite;
  opacity: 1;
}

.voice-recorder-visual[data-state="recording"] .voice-recorder-disc::after {
  animation-delay: 1s;
}

.voice-recorder-visual[data-state="paused"] .voice-recorder-disc {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.voice-recorder-visual[data-state="uploading"] .voice-recorder-disc {
  animation: voice-recorder-breathe 1.5s ease-in-out infinite;
  color: #ff942f;
}

.voice-recorder-visual[data-state="complete"] .voice-recorder-disc {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.5);
  color: #71d9a7;
}

.voice-recorder-visual[data-state="error"] .voice-recorder-disc {
  background: rgba(255, 122, 110, 0.1);
  border-color: rgba(255, 122, 110, 0.5);
  color: #ff9a90;
}

.voice-recorder-display {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.voice-recorder-mode {
  color: rgba(255, 255, 255, 0.55);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.voice-recorder-timer {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 43px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.045em;
  line-height: 1;
}

.voice-recorder-status {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.voice-recorder-status.is-good {
  color: #71d9a7;
}

.voice-recorder-status.is-bad {
  color: #ff9a90;
}

.voice-recorder-waveform {
  align-items: center;
  display: flex;
  gap: 4px;
  height: 34px;
  margin-top: 12px;
  max-width: 390px;
}

.voice-recorder-waveform span {
  --peak: 0.7;
  --rest: 0.28;
  background: rgba(255, 255, 255, 0.34);
  border-radius: 3px;
  display: block;
  height: 28px;
  transform: scaleY(var(--rest));
  transform-origin: center;
  transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  width: 3px;
}

.voice-recorder-waveform span:nth-child(2n) { --peak: 0.48; --rest: 0.4; }
.voice-recorder-waveform span:nth-child(3n) { --peak: 0.92; --rest: 0.55; }
.voice-recorder-waveform span:nth-child(4n) { --peak: 0.62; --rest: 0.34; }
.voice-recorder-waveform span:nth-child(5n) { --peak: 1; --rest: 0.68; }

.voice-recorder-visual[data-state="recording"] + .voice-recorder-display .voice-recorder-waveform span {
  animation: voice-recorder-wave 0.9s ease-in-out infinite;
  background: #ff942f;
}

.voice-recorder-visual[data-state="recording"] + .voice-recorder-display .voice-recorder-waveform span:nth-child(2n) { animation-delay: -0.36s; }
.voice-recorder-visual[data-state="recording"] + .voice-recorder-display .voice-recorder-waveform span:nth-child(3n) { animation-delay: -0.63s; }
.voice-recorder-visual[data-state="recording"] + .voice-recorder-display .voice-recorder-waveform span:nth-child(4n) { animation-delay: -0.18s; }
.voice-recorder-visual[data-state="recording"] + .voice-recorder-display .voice-recorder-waveform span:nth-child(5n) { animation-delay: -0.75s; }

.voice-recorder-visual[data-state="paused"] + .voice-recorder-display .voice-recorder-waveform span {
  background: rgba(255, 255, 255, 0.7);
  transform: scaleY(var(--rest));
}

.voice-recorder-visual[data-state="uploading"] + .voice-recorder-display .voice-recorder-waveform span {
  animation: voice-recorder-upload 1.2s ease-in-out infinite;
  background: #ff942f;
}

.voice-recorder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.voice-recorder-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
}

.voice-recorder-button[hidden] {
  display: none !important;
}

.voice-recorder-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.voice-recorder-button.primary {
  background: var(--orange);
  color: #fff;
}

.voice-recorder-button.primary:hover:not(:disabled) {
  background: var(--orange-hover);
}

.voice-recorder-button.secondary {
  background: #fff;
  border-color: #d8dce3;
  color: #20242c;
}

.voice-recorder-button.secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

.voice-recorder-control::before {
  background: #fff;
  border-radius: 50%;
  content: "";
  display: block;
  flex: 0 0 11px;
  height: 11px;
  margin-right: 9px;
  transition: clip-path 0.18s ease, border-radius 0.18s ease;
  width: 11px;
}

.voice-recorder-control[data-mode="pause"]::before {
  background: linear-gradient(90deg, #fff 0 34%, transparent 34% 66%, #fff 66% 100%);
  border-radius: 1px;
}

.voice-recorder-control[data-mode="resume"]::before {
  border-radius: 1px;
  clip-path: polygon(12% 0, 100% 50%, 12% 100%);
}

.voice-recorder-help {
  color: #697180;
  font-size: 13px;
  line-height: 1.55;
  margin: 16px 0 0;
}

.voice-recorder-next {
  align-items: flex-start;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  display: flex;
  gap: 11px;
  margin-top: 18px;
  padding: 14px 16px;
}

.voice-recorder-next img {
  flex: 0 0 22px;
  height: 22px;
  margin-top: 1px;
  width: 22px;
}

.voice-recorder-next p {
  color: #4c3726;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

@keyframes voice-recorder-pulse {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.46); }
}

@keyframes voice-recorder-wave {
  0%, 100% { transform: scaleY(0.2); }
  50% { transform: scaleY(var(--peak)); }
}

@keyframes voice-recorder-upload {
  0%, 100% { opacity: 0.28; transform: scaleY(0.22); }
  50% { opacity: 1; transform: scaleY(0.7); }
}

@keyframes voice-recorder-breathe {
  0%, 100% { transform: scale(0.96); }
  50% { transform: scale(1.03); }
}

@media (max-width: 1024px) {
  .voice-recorder-page {
    padding-top: 44px;
  }

  .voice-recorder-hero {
    gap: 28px;
  }

  .voice-recorder-intro {
    max-width: 720px;
  }

  .voice-recorder-card {
    max-width: 720px;
  }
}

@media (max-width: 640px) {
  .voice-recorder-page {
    padding: 38px 16px 60px;
  }

  .voice-recorder-hero {
    gap: 24px;
  }

  .voice-recorder-intro h1 {
    font-size: 34px;
  }

  .voice-recorder-intro p {
    font-size: 16px;
  }

  .voice-recorder-card {
    border-radius: 14px;
    padding: 18px;
  }

  .voice-recorder-readout {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 20px;
    text-align: center;
  }

  .voice-recorder-visual {
    min-height: 108px;
  }

  .voice-recorder-disc {
    height: 84px;
    width: 84px;
  }

  .voice-recorder-timer {
    font-size: 38px;
  }

  .voice-recorder-waveform {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .voice-recorder-actions {
    flex-direction: column;
  }

  .voice-recorder-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-recorder-disc,
  .voice-recorder-disc::before,
  .voice-recorder-disc::after,
  .voice-recorder-waveform span {
    animation: none !important;
    transition: none !important;
  }
}
