:root {
  color-scheme: light;
  --ink: #183c42;
  --ink-soft: #466267;
  --sky: #1f7787;
  --sky-dark: #155b68;
  --sky-pale: #dceef0;
  --earth: #a84e2d;
  --earth-dark: #7f351e;
  --earth-pale: #f5dfd3;
  --sun: #efa92d;
  --sun-dark: #ca7f13;
  --sun-pale: #fff1c8;
  --sand: #f6ead5;
  --sand-deep: #e9d5b5;
  --paper: #fffdf8;
  --paper-warm: #fbf6ec;
  --white: #ffffff;
  --success: #24734c;
  --success-pale: #e1f2e8;
  --danger: #a13b35;
  --danger-pale: #fae5e1;
  --line: #ddcfb8;
  --line-soft: #ebe1d1;
  --shadow-sm: 0 2px 8px rgba(45, 47, 35, 0.06);
  --shadow-md: 0 16px 44px rgba(64, 48, 25, 0.1);
  --shadow-focus: 0 0 0 4px rgba(31, 119, 135, 0.18);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shell: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper-warm);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="range"],
input[type="file"],
label[for] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: currentColor;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(139, 108, 62, 0.17);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand > span:last-child,
.footer-brand > span:last-child {
  display: grid;
  line-height: 1.12;
}

.brand strong,
.footer-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.23rem;
  letter-spacing: -0.02em;
}

.brand small,
.footer-brand small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 45px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--sun-pale);
  box-shadow: inset 0 0 0 1px rgba(168, 78, 45, 0.11);
}

.brand-sun {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--sun);
}

.brand-land {
  position: absolute;
  right: -5px;
  bottom: -1px;
  left: -5px;
  height: 20px;
  border-radius: 55% 48% 0 0;
  background: var(--earth);
  transform: rotate(-5deg);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
}

.brand-mark.small .brand-sun {
  top: 7px;
  left: 11px;
  width: 17px;
  height: 17px;
}

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9b958b;
  box-shadow: 0 0 0 4px rgba(155, 149, 139, 0.13);
}

.server-state[data-status="online"] .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(36, 115, 76, 0.13);
}

.server-state[data-status="offline"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(161, 59, 53, 0.13);
}

.server-state[data-status="checking"] .status-dot {
  animation: breathe 1.4s ease-in-out infinite;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid rgba(139, 108, 62, 0.17);
  background:
    linear-gradient(118deg, rgba(255, 253, 248, 0.27), rgba(255, 255, 255, 0)),
    var(--sand);
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.hero::before {
  right: -9vw;
  bottom: -132px;
  width: 58vw;
  height: 220px;
  border-radius: 50% 0 0;
  background: rgba(168, 78, 45, 0.13);
  transform: rotate(-4deg);
}

.hero::after {
  right: 4vw;
  bottom: -164px;
  width: 53vw;
  height: 220px;
  border-radius: 55% 0 0;
  background: rgba(31, 119, 135, 0.11);
  transform: rotate(6deg);
}

.hero-sun {
  position: absolute;
  z-index: -1;
  top: -112px;
  right: max(-92px, calc((100vw - var(--shell)) / 2 - 80px));
  width: 295px;
  height: 295px;
  border: 1px solid rgba(202, 127, 19, 0.12);
  border-radius: 50%;
  background: rgba(239, 169, 45, 0.16);
  box-shadow:
    0 0 0 36px rgba(239, 169, 45, 0.045),
    0 0 0 72px rgba(239, 169, 45, 0.025);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(360px, 0.83fr);
  align-items: center;
  gap: clamp(48px, 9vw, 120px);
  min-height: 425px;
  padding-block: 74px 70px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--earth);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.history-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(2.75rem, 5.5vw, 5.1rem);
}

.hero-lead {
  max-width: 650px;
  margin: 24px 0 27px;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.65;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 24px;
  color: var(--success);
}

.privacy-note strong {
  color: var(--ink);
}

.journey {
  position: relative;
  display: grid;
  gap: 25px;
  margin: 0;
  padding: 30px;
  border: 1px solid rgba(154, 112, 50, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.68);
  box-shadow: var(--shadow-md);
  list-style: none;
  backdrop-filter: blur(8px);
}

.journey::before {
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 49px;
  width: 1px;
  background: var(--line);
  content: "";
}

.journey li {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 17px;
}

.journey li > span {
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--earth);
  font-family: Georgia, serif;
  font-weight: 700;
}

.journey li:first-child > span {
  border-color: var(--earth);
  background: var(--earth);
  color: var(--white);
}

.journey li div {
  display: grid;
  gap: 2px;
}

.journey strong {
  font-size: 0.96rem;
}

.journey small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.workspace {
  padding-block: 42px 100px;
}

.notice {
  position: sticky;
  z-index: 20;
  top: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 auto 24px;
  padding: 11px 44px 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 0.89rem;
  font-weight: 700;
  text-align: center;
}

.notice[data-type="success"] {
  border-color: #a9cfb6;
  background: var(--success-pale);
  color: #185d3c;
}

.notice[data-type="error"] {
  border-color: #e6afa7;
  background: var(--danger-pale);
  color: #852e29;
}

.notice[data-type="info"] {
  border-color: #aed4da;
  background: var(--sky-pale);
  color: var(--sky-dark);
}

.studio-section {
  padding-block: 62px 70px;
  border-bottom: 1px solid var(--line-soft);
}

.studio-section:first-of-type {
  padding-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  max-width: 790px;
  margin-bottom: 29px;
}

.step-number {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--earth);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step-number::after {
  display: inline-block;
  width: 36px;
  height: 1px;
  margin: 0 3px 5px 11px;
  background: var(--earth);
  content: "";
}

.section-heading h2,
.history-heading h2 {
  font-size: clamp(2rem, 3.7vw, 3.15rem);
}

.section-heading > div:last-child > p:last-child {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.voice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  align-items: start;
  gap: 24px;
}

.voice-form,
.voice-library,
.text-studio,
.synthesis-panel {
  padding: clamp(24px, 3vw, 36px);
}

.panel-heading,
.history-heading,
.text-card-heading,
.label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 28px;
}

.panel-heading h3,
.current-job h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  line-height: 1.2;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.local-chip,
.count-badge,
.state-chip,
.status-badge,
.voice-selected-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.local-chip {
  background: var(--success-pale);
  color: var(--success);
}

.count-badge {
  min-width: 29px;
  min-height: 29px;
  padding-inline: 8px;
  background: var(--sand);
  color: var(--earth-dark);
  font-size: 0.76rem;
}

.field {
  margin-bottom: 23px;
}

.field label,
.audio-fieldset legend,
.text-card-heading label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.field input[type="text"],
.field textarea,
.text-card textarea,
.select-wrap select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--white);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input[type="text"],
.select-wrap select {
  min-height: 50px;
  padding: 11px 14px;
}

textarea {
  display: block;
  min-height: 112px;
  padding: 13px 14px;
  line-height: 1.6;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8a9693;
  opacity: 1;
}

input:hover:not(:disabled),
textarea:hover:not(:disabled),
.select-wrap select:hover:not(:disabled) {
  border-color: #baa98d;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--sky);
}

input:user-invalid,
textarea:user-invalid,
select:user-invalid {
  border-color: var(--danger);
}

.field-help {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.label-line {
  align-items: end;
}

.label-line > span,
.text-card-heading > span {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.audio-fieldset {
  min-width: 0;
  margin: 0 0 23px;
  padding: 0;
  border: 0;
}

.audio-fieldset legend {
  padding: 0;
}

.audio-options {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 13px;
  margin-top: 13px;
}

.record-box,
.upload-box {
  min-height: 146px;
  border: 1px dashed #cbb998;
  border-radius: var(--radius-sm);
  background: var(--paper-warm);
}

.record-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 17px;
}

.record-box.is-recording {
  border-color: var(--danger);
  background: #fff8f5;
}

.record-visual {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--earth-pale);
  color: var(--earth);
}

.record-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.sound-bars {
  display: none;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.sound-bars i {
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  animation: soundbar 600ms ease-in-out infinite alternate;
}

.sound-bars i:nth-child(2),
.sound-bars i:nth-child(4) {
  animation-delay: -280ms;
}

.sound-bars i:nth-child(3) {
  animation-delay: -430ms;
}

.record-box.is-recording .record-visual {
  background: var(--danger-pale);
  color: var(--danger);
}

.record-box.is-recording .record-pulse {
  display: none;
}

.record-box.is-recording .sound-bars {
  display: flex;
}

.record-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.record-content strong {
  font-size: 0.82rem;
}

.record-content span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.record-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
}

.audio-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.audio-divider::before,
.audio-divider::after {
  width: 1px;
  height: 35px;
  background: var(--line);
  content: "";
}

.audio-divider {
  flex-direction: column;
  gap: 7px;
}

.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 17px;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.upload-box:hover,
.upload-box.is-dragging {
  border-color: var(--sky);
  background: var(--sky-pale);
}

.upload-box:focus-within {
  border-color: var(--sky);
  box-shadow: var(--shadow-focus);
}

.upload-box > svg {
  flex: 0 0 auto;
  width: 27px;
  color: var(--sky);
}

.upload-box > span {
  display: grid;
  gap: 3px;
}

.upload-box strong {
  font-size: 0.82rem;
}

.upload-box small {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.audio-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #bed7d9;
  border-radius: var(--radius-sm);
  background: #f0f8f8;
}

.audio-preview > div:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.audio-preview svg {
  flex: 0 0 auto;
  width: 21px;
  color: var(--sky);
}

.audio-preview span {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.audio-preview strong,
.audio-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-preview strong {
  font-size: 0.76rem;
}

.audio-preview small {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.audio-preview audio {
  width: 100%;
  height: 34px;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 11px;
  margin: 6px 0 24px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper-warm);
}

.consent-check:hover {
  border-color: var(--line);
}

.consent-check input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--sky);
}

.consent-check span {
  display: grid;
  gap: 3px;
}

.consent-check strong {
  font-size: 0.79rem;
}

.consent-check small {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}

.button,
.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.button {
  min-height: 47px;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.83rem;
}

.button svg,
.text-button svg {
  width: 19px;
}

.button:not(:disabled):active,
.icon-button:not(:disabled):active,
.text-button:not(:disabled):active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.48;
}

.button-primary {
  background: var(--sky);
  box-shadow: 0 5px 15px rgba(31, 119, 135, 0.2);
  color: var(--white);
}

.button-primary:hover:not(:disabled) {
  background: var(--sky-dark);
}

.button-sun {
  min-width: 190px;
  background: var(--sun);
  box-shadow: 0 5px 15px rgba(202, 127, 19, 0.18);
  color: #452e0a;
}

.button-sun:hover:not(:disabled) {
  background: #e19a20;
}

.button-secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  border-color: #bca989;
  background: var(--sand);
}

.button-danger-soft {
  border-color: #e7bbb5;
  background: var(--danger-pale);
  color: var(--danger);
}

.button-danger-soft:hover:not(:disabled) {
  border-color: var(--danger);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.74rem;
}

.button[aria-busy="true"]::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.stop-icon {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.icon-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}

.icon-button svg {
  width: 18px;
}

.icon-button:hover {
  background: var(--danger-pale);
  color: var(--danger);
}

.voice-library {
  position: sticky;
  top: 100px;
}

.loading-block,
.history-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 35px 18px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--sand);
  color: var(--earth);
}

.empty-icon svg {
  width: 26px;
}

.empty-state strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1rem;
}

.empty-state p {
  max-width: 260px;
  margin: 5px 0 0;
  font-size: 0.78rem;
}

.voice-list {
  display: grid;
  max-height: 635px;
  gap: 10px;
  margin: 0;
  padding: 0 3px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--line) transparent;
}

.voice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.voice-card[data-selected="true"] {
  border-color: var(--sky);
  background: #f4fafa;
  box-shadow: 0 0 0 2px rgba(31, 119, 135, 0.07);
}

.voice-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--earth-pale);
  color: var(--earth);
}

.voice-avatar svg {
  width: 20px;
}

.voice-card-main {
  min-width: 0;
}

.voice-card-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.voice-card-title strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-selected-chip {
  background: var(--sky-pale);
  color: var(--sky-dark);
  font-size: 0.56rem;
}

.voice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.voice-card-actions {
  display: flex;
  gap: 4px;
}

.voice-card .select-voice {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.68rem;
}

.voice-card[data-selected="true"] .select-voice {
  display: none;
}

.text-studio {
  overflow: hidden;
}

.state-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 27px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}

.state-field {
  flex: 0 1 390px;
  margin: 0;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  padding-right: 42px;
}

.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 20px;
  color: var(--ink-soft);
  pointer-events: none;
  transform: translateY(-50%);
}

.select-wrap select:disabled {
  background: #f1eee7;
  color: #7c827e;
  opacity: 1;
}

.adapt-principle {
  display: flex;
  align-items: flex-start;
  max-width: 460px;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.adapt-principle svg {
  flex: 0 0 auto;
  width: 18px;
  margin-top: 1px;
  color: var(--sky);
}

.text-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.text-card {
  display: flex;
  min-width: 0;
  min-height: 324px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.text-card-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.text-card-heading > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.text-card-heading > div > div {
  display: grid;
}

.text-card-heading label {
  margin: 1px 0 0;
}

.text-card-heading small {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.text-order {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--sand);
  color: var(--earth);
  font-family: Georgia, serif;
  font-size: 0.75rem;
  font-weight: 800;
}

.text-card textarea {
  flex: 1;
  min-height: 232px;
  padding: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 1rem;
}

.text-card textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 119, 135, 0.15);
}

.adapted-card {
  position: relative;
  border-color: #b5d5da;
  background: linear-gradient(145deg, #f8fdfd, #f2f8f7);
}

.adapted-card[data-state="stale"] {
  border-color: #dfbc71;
  background: #fffaf0;
}

.adapted-placeholder {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 22px;
  color: var(--ink-soft);
  text-align: center;
}

.adapted-placeholder span {
  height: 45px;
  color: #8ebdc3;
  font-family: Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
}

.adapted-placeholder p {
  max-width: 320px;
  margin: 7px 0 0;
  font-size: 0.8rem;
}

.adapt-arrow {
  display: grid;
  align-self: center;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--earth);
}

.adapt-arrow svg {
  width: 20px;
}

.text-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 0;
  border-top: 1px solid #d9e9e9;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.text-button {
  gap: 5px;
  padding: 4px;
  background: transparent;
  color: var(--sky-dark);
  font-size: 0.69rem;
}

.text-button:hover {
  color: var(--sky);
  text-decoration: underline;
}

.text-button svg {
  width: 16px;
}

.adapt-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 23px;
}

.adapt-actions p {
  flex: 1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.adapt-actions p[data-type="error"] {
  color: var(--danger);
}

.adapt-actions p[data-type="success"] {
  color: var(--success);
}

.synthesis-panel {
  padding-block: 28px;
}

.synthesis-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(190px, 0.95fr) minmax(190px, 0.85fr) auto;
  align-items: end;
  gap: 22px;
}

.synthesis-controls .field {
  margin: 0;
}

.speed-field input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 14px 0 10px;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, var(--earth) 0 50%, var(--line) 50% 100%);
  accent-color: var(--earth);
  appearance: none;
}

.speed-field input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--earth);
  box-shadow: 0 0 0 1px var(--earth), var(--shadow-sm);
  appearance: none;
}

.speed-field input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--earth);
  box-shadow: 0 0 0 1px var(--earth), var(--shadow-sm);
}

.speed-field input[type="range"]:focus-visible {
  box-shadow: var(--shadow-focus);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.6rem;
}

.synthesis-button {
  min-height: 50px;
  white-space: nowrap;
}

.synthesis-hint {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
  text-align: right;
}

.current-job {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: clamp(30px, 6vw, 82px);
  margin-top: 24px;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--ink);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

.current-job::after {
  position: absolute;
  right: -65px;
  bottom: -115px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(255, 255, 255, 0.025), 0 0 0 70px rgba(255, 255, 255, 0.015);
  content: "";
}

.job-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  gap: 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.job-illustration > span {
  position: absolute;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(239, 169, 45, 0.28);
  border-radius: 50%;
}

.job-illustration i {
  z-index: 1;
  width: 5px;
  height: 27px;
  border-radius: 99px;
  background: var(--sun);
  animation: voicewave 950ms ease-in-out infinite alternate;
}

.job-illustration i:nth-of-type(2),
.job-illustration i:nth-of-type(6) {
  height: 54px;
  animation-delay: -200ms;
}

.job-illustration i:nth-of-type(3),
.job-illustration i:nth-of-type(5) {
  height: 78px;
  animation-delay: -440ms;
}

.job-illustration i:nth-of-type(4) {
  height: 102px;
  animation-delay: -610ms;
}

.job-copy {
  position: relative;
  z-index: 1;
}

.job-copy .eyebrow {
  color: #f3c671;
}

.current-job h3 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.job-copy > p:not(.eyebrow, .job-error) {
  margin: 11px 0 0;
  color: #c8d6d8;
  font-size: 0.85rem;
}

.job-copy audio {
  width: min(100%, 540px);
  margin-top: 24px;
}

.job-error {
  margin: 17px 0 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 172, 162, 0.35);
  border-radius: 8px;
  background: rgba(161, 59, 53, 0.25);
  color: #ffd7d1;
  font-size: 0.76rem;
}

.job-logs {
  width: min(100%, 620px);
  margin-top: 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: #dbe8e9;
  font-size: 0.72rem;
}

.job-logs summary {
  padding: 10px 13px;
  color: #f3c671;
  cursor: pointer;
  font-weight: 750;
}

.job-logs ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 13px 13px;
  list-style: none;
}

.job-log {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding-left: 13px;
  line-height: 1.45;
}

.job-log::before {
  position: absolute;
  top: 0.32rem;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75d2bf;
  content: "";
}

.job-log time {
  grid-column: 1;
  color: #9eb7ba;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-log span {
  grid-column: 2;
}

.job-log[data-level="error"]::before {
  background: #ff9a8f;
}

.job-log[data-level="error"] span {
  color: #ffd7d1;
}

.history-section {
  padding-top: 70px;
}

.history-heading {
  margin-bottom: 27px;
}

.history-heading .eyebrow {
  margin-bottom: 6px;
}

.history-list {
  display: grid;
  gap: 13px;
}

.history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  align-items: center;
  gap: 26px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.history-main {
  min-width: 0;
}

.history-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.history-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-chip {
  background: var(--sand);
  color: var(--earth-dark);
  font-size: 0.58rem;
}

.status-badge[data-status="completed"] {
  background: var(--success-pale);
  color: var(--success);
}

.status-badge[data-status="failed"] {
  background: var(--danger-pale);
  color: var(--danger);
}

.status-badge[data-status="queued"],
.status-badge[data-status="processing"] {
  background: var(--sun-pale);
  color: #8a570b;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.history-text {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.history-text summary {
  width: fit-content;
  border-radius: 4px;
  color: var(--sky-dark);
  font-weight: 750;
  list-style-position: inside;
  cursor: pointer;
}

.history-text p {
  margin: 9px 0 0;
  padding-left: 13px;
  border-left: 2px solid var(--line);
  white-space: pre-wrap;
}

.history-audio {
  min-width: 0;
}

.history-audio audio {
  display: block;
  width: 100%;
  height: 40px;
}

.history-progress,
.history-failure {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: right;
}

.history-failure {
  color: var(--danger);
}

.history-progress .spinner {
  width: 16px;
  height: 16px;
}

.history-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.55);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--sand);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
  gap: 30px;
}

.footer-inner p,
.footer-inner > a {
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.footer-inner > a {
  font-weight: 750;
  text-decoration: none;
}

.footer-inner > a:hover {
  color: var(--earth);
  text-decoration: underline;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--danger);
  color: var(--white);
  font-weight: 700;
  text-align: center;
}

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

@keyframes breathe {
  50% { opacity: 0.42; }
}

@keyframes soundbar {
  to { height: 17px; }
}

@keyframes voicewave {
  to { transform: scaleY(0.42); }
}

@media (max-width: 1020px) {
  .voice-layout {
    grid-template-columns: 1fr;
  }

  .voice-library {
    position: static;
  }

  .voice-list {
    max-height: none;
  }

  .synthesis-controls {
    grid-template-columns: 1fr 1fr;
  }

  .synthesis-button {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .journey {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .journey::before {
    top: 49px;
    right: 15%;
    bottom: auto;
    left: 15%;
    width: auto;
    height: 1px;
  }

  .journey li {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .journey li div {
    min-width: 0;
  }

  .state-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-field {
    width: 100%;
    flex-basis: auto;
  }

  .text-columns {
    grid-template-columns: 1fr;
  }

  .adapt-arrow {
    transform: rotate(90deg);
  }

  .history-card {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .history-progress,
  .history-failure {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(calc(100% - 26px), var(--shell));
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand-sun {
    top: 7px;
    left: 11px;
    width: 18px;
    height: 18px;
  }

  .brand strong {
    font-size: 1.08rem;
  }

  .server-state {
    max-width: 105px;
    font-size: 0.65rem;
    line-height: 1.25;
  }

  .hero-grid {
    min-height: auto;
    padding-block: 56px 54px;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .journey {
    grid-template-columns: 1fr;
    gap: 21px;
    padding: 23px;
  }

  .journey::before {
    top: 42px;
    right: auto;
    bottom: 42px;
    left: 42px;
    width: 1px;
    height: auto;
  }

  .journey li {
    grid-template-columns: 38px 1fr;
    justify-items: initial;
    text-align: left;
  }

  .journey li > span {
    width: 38px;
    height: 38px;
  }

  .workspace {
    padding-block: 25px 74px;
  }

  .studio-section {
    padding-block: 48px 54px;
  }

  .section-heading {
    display: block;
  }

  .step-number {
    margin-bottom: 9px;
  }

  .voice-form,
  .voice-library,
  .text-studio,
  .synthesis-panel {
    padding: 21px 17px;
  }

  .audio-options {
    grid-template-columns: 1fr;
  }

  .audio-divider {
    flex-direction: row;
  }

  .audio-divider::before,
  .audio-divider::after {
    width: 35px;
    height: 1px;
  }

  .audio-preview {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .audio-preview audio {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .voice-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
  }

  .voice-card-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .text-card {
    min-height: 292px;
    padding: 14px;
  }

  .text-card textarea {
    min-height: 205px;
  }

  .adapt-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .adapt-actions .button {
    width: 100%;
  }

  .synthesis-controls {
    grid-template-columns: 1fr;
  }

  .synthesis-hint {
    text-align: left;
  }

  .current-job {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .job-illustration {
    height: 125px;
  }

  .history-heading {
    align-items: flex-end;
  }

  .history-heading h2 {
    font-size: 2rem;
  }

  .history-card {
    padding: 17px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 27px;
    gap: 12px;
  }

  .footer-inner p {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #8b795e;
    --line-soft: #b4a58e;
    --ink-soft: #344e52;
  }
}
