:root {
  --canvas: #edf2f6;
  --ink: #172f45;
  --muted: #667789;
  --teal: #137e83;
  --teal-dark: #0d676c;
  --teal-soft: #e4f2f1;
  --white: #fff;
  --lilac: #eae8f4;
  --line: #dfe6ec;
  --error: #a63749;
  --error-soft: #fbebee;
  --display: Bahnschrift,"Segoe UI",sans-serif;
  --body: "Segoe UI",Arial,sans-serif;
  --mono: Consolas,"Courier New",monospace;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

button,a,input,select,textarea,summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

button,select,input,textarea {
  touch-action: manipulation;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible,.upload-button:focus-within {
  outline: 3px solid #6aaeb7;
  outline-offset: 3px;
}

::selection {
  background: #c3e3e2;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  font-family: var(--display);
  font-weight: 600;
}

button {
  border: 0;
}

svg {
  flex-shrink: 0;
}

[hidden] {
  display: none!important;
}

.app-shell {
  max-width: 1264px;
  margin: 0 auto;
  padding: 0 42px;
}

.masthead {
  min-height: 114px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d5dfe7;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font: 600 39px/.7 var(--display);
  padding-bottom: 7px;
}

.wordmark {
  font: 600 23px/1.25 var(--display);
  letter-spacing: 5px;
}

.wordmark span {
  display: block;
  font: 11px/1.5 var(--body);
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.masthead-actions form { margin: 0; }

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9cabb5;
  flex-shrink: 0;
}

.status-dot.ready {
  background: var(--teal);
  box-shadow: 0 0 0 4px #137e830d;
}

.status-dot.error {
  background: var(--error);
}

.status-dot.busy {
  background: #a7863d;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 42px 0 35px;
}

.eyebrow {
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.intro .eyebrow {
  margin-bottom: 13px;
}

h1 {
  font-size: clamp(38px,4.7vw,57px);
  line-height: 1.04;
  letter-spacing: -1.8px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 290px;
  margin-top: 17px;
}

.privacy-note svg {
  color: var(--teal);
  margin-top: 2px;
}

.privacy-note strong {
  font-size: 13px;
  font-weight: 600;
}

.privacy-note p {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 5px;
  color: var(--muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0,.88fr) minmax(0,1.22fr);
  gap: 23px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 18px #172f4503;
  padding: 29px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.panel-heading .eyebrow {
  margin-bottom: 7px;
}

h2 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.6px;
}

.step-number {
  font: 400 31px/1 var(--display);
  letter-spacing: -1.4px;
  color: #c5cfda;
}

.section-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.recorder {
  background: #f3f6f8;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px 16px 13px;
  overflow: hidden;
}

.recorder-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.monitor-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}

.record-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a3b0ba;
  flex-shrink: 0;
}

.is-recording .record-dot {
  background: #ba485b;
  box-shadow: 0 0 0 3px #ba485b14;
}

.timer {
  font: 12px var(--mono);
  white-space: nowrap;
}

.timer span {
  color: #8291a0;
  font-size: 10px;
}

#waveform {
  display: block;
  width: 100%;
  height: 86px;
  margin: 7px 0 0;
}

.meter-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  margin: 0 0 16px;
}

.meter-line>span:first-child {
  white-space: nowrap;
}

.meter-line>span:last-child {
  font: 9px var(--mono);
  min-width: 25px;
  text-align: right;
}

meter {
  height: 5px;
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  background: #dce4ea;
}

meter::-webkit-meter-bar {
  background: #dce4ea;
  border: 0;
  border-radius: 10px;
  height: 5px;
}

meter::-webkit-meter-optimum-value {
  background: var(--teal);
}

meter::-webkit-meter-suboptimum-value {
  background: #8b9aa7;
}

meter::-webkit-meter-even-less-good-value {
  background: #b55561;
}

meter::-moz-meter-bar {
  background: var(--teal);
}

.button {
  min-height: 46px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s,color .15s,transform .15s;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.record-button {
  width: 100%;
  background: var(--white);
  border: 1px solid #d8e1e8;
  color: var(--ink);
  min-height: 42px;
}

.record-button:hover:not(:disabled) {
  border-color: #aabdc9;
  background: #fbfdfd;
}

.record-button-icon {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: var(--teal);
}

.is-recording .record-button-icon {
  border-radius: 2px;
  background: var(--error);
}

.is-recording .record-button {
  color: var(--error);
  border-color: #e3c2c9;
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 13px;
}

.upload-button {
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  border-radius: 2px;
}

.upload-button:hover {
  text-decoration: underline;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.upload-button.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.file-types {
  font-size: 9px;
  color: #778697;
  text-align: center;
  margin-top: 4px;
}

.reading-guide {
  margin: 18px 0;
  font-size: 12px;
}

.reading-guide summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}

.reading-guide p {
  border-left: 2px solid #c7d4df;
  padding-left: 13px;
  color: #506477;
  margin: 11px 0 9px;
  line-height: 1.75;
}

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

.reading-guide .hint {
  display: block;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.field label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.field input,.field textarea,.field select {
  width: 100%;
  border: 1px solid #dce4eb;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.field select {
  height: 43px;
  padding-right: 28px;
}

.field input {
  height: 42px;
}

.field textarea {
  resize: vertical;
  min-height: 83px;
}

.field input::placeholder,.field textarea::placeholder {
  color: #8996a4;
}

.field input:hover,.field textarea:hover,.field select:hover {
  border-color: #b8c8d4;
}

.field select:disabled {
  color: var(--muted);
  background: #f7f9fa;
  opacity: 1;
}

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

.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 11px;
  color: #566b7c;
  cursor: pointer;
  line-height: 1.6;
}

.consent input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  margin: 1px 0 0;
  flex-shrink: 0;
}

.button-secondary {
  color: var(--ink);
  background: var(--lilac);
}

.button-secondary:hover:not(:disabled) {
  background: #dedbef;
}

.button:disabled {
  background: #f0f3f6;
  border-color: #e6ecf1;
  color: #8b99a6;
}

.button:disabled .record-button-icon {
  background: #8b99a6;
}

.save-button {
  justify-content: space-between;
  padding: 0 16px;
}

.voice-library {
  margin-top: 20px;
}

.add-voice {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 17px;
}

.add-voice > summary {
  color: var(--teal);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.add-voice-content {
  padding-top: 17px;
}

#voice-message {
  margin-top: 15px;
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-line h3 {
  font-size: 15px;
  letter-spacing: -.2px;
}

.count {
  font: 11px var(--mono);
  color: var(--muted);
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  background: #f1f4f7;
  border-radius: 7px;
  padding: 0 6px;
}

.empty-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.output-column {
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.compose-panel {
  padding: 29px 31px 25px;
}

.compose-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, .65fr);
  gap: 12px;
  margin: 23px 0 13px;
}

.delivery-options {
  margin-bottom: 18px;
}

.delivery-options .hint {
  margin-top: 8px;
  font-size: 10px;
}

.breaths-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  font-size: 12px;
  color: #506477;
  cursor: pointer;
}

.breaths-toggle input {
  appearance: none;
  width: 29px;
  height: 17px;
  margin: 0;
  border: 1px solid #bac8d2;
  border-radius: 12px;
  background: #e1e8ed;
  flex-shrink: 0;
  cursor: pointer;
}

.breaths-toggle input::before {
  content: '';
  display: block;
  width: 11px;
  height: 11px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #172f4520;
  transition: transform .15s;
}

.breaths-toggle input:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.breaths-toggle input:checked::before {
  transform: translateX(12px);
}

.breaths-toggle input:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.text-cues {
  margin-top: 12px;
}

.text-cues summary,
.performance-preview summary {
  color: var(--teal);
  font-size: 11px;
  width: fit-content;
  cursor: pointer;
}

.cue-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 8px;
}

.cue-buttons button {
  border: 1px solid #d6e4e6;
  border-radius: 6px;
  padding: 5px 9px;
  min-height: 32px;
  background: #f4f9f9;
  color: var(--teal);
  font-size: 11px;
}

.cue-buttons button:hover:not(:disabled) {
  background: var(--teal-soft);
  border-color: #aacdcd;
}

.cue-buttons button:disabled {
  color: var(--muted);
  background: var(--canvas);
}

.text-cues .hint {
  font-size: 10px;
}

.performance-preview {
  margin-top: 15px;
  padding: 12px;
  border: 1px solid #dae7e8;
  border-radius: 8px;
  background: #f7fbfa;
}

.performance-preview .hint {
  margin-top: 10px;
}

.analysis-button {
  margin-top: 10px;
}

.performance-reason {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.performance-segments {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  max-height: 300px;
  overflow: auto;
}

.performance-segments li + li {
  margin-top: 9px;
}

.performance-text {
  display: block;
  font-size: 12px;
  color: #506477;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.performance-pause {
  display: block;
  font-size: 10px;
  color: var(--teal);
  margin-bottom: 4px;
}

.voice-reference {
  margin-top: 5px;
}

.voice-reference summary {
  color: var(--teal);
  font-size: 10px;
  cursor: pointer;
}

.voice-reference p {
  font-size: 10px;
  margin-top: 6px;
}

.script-field {
  border: 1px solid #dce4eb;
  border-radius: 11px;
  overflow: hidden;
  background: #fbfcfd;
  transition: border-color .15s;
}

.script-field:focus-within {
  border-color: #72aeb2;
}

.script-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  padding: 16px 17px 0;
}

.script-field textarea {
  display: block;
  width: 100%;
  min-height: 234px;
  resize: vertical;
  padding: 12px 17px 18px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.script-field textarea:focus-visible {
  outline-offset: -3px;
  border-radius: 7px;
}

.script-field textarea::placeholder {
  color: #8d99a5;
  font-size: 14px;
}

.script-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border-top: 1px solid #e6ecf0;
  color: #7d8b99;
  font-size: 10px;
  line-height: 1.5;
}

.script-footer>span:first-child {
  max-width: 260px;
}

.character-count {
  font: 10px/1.5 var(--mono);
  white-space: nowrap;
}

.button-primary {
  background: var(--teal);
  color: #fff;
}

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

.synth-button {
  width: 100%;
  margin-top: 23px;
  min-height: 49px;
}

.speech-preparation {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.render-expression {
  margin: 10px 0;
  color: var(--teal);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.speech-preparation > summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  color: var(--teal);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.7;
  list-style: none;
}

.speech-preparation > summary::-webkit-details-marker {
  display: none;
}

.speech-preparation > summary > span:first-child::before {
  content: '＋';
  margin-right: 7px;
}

.speech-preparation[open] > summary > span:first-child::before {
  content: '−';
}

.preparation-notice {
  color: #80663e;
  font-size: 10px;
}

.pronunciation-content {
  padding-top: 15px;
}

.pronunciation-rules-field {
  margin-top: 19px;
}

.pronunciation-rules-field .hint {
  margin-top: 7px;
  font-size: 10px;
}

.pronunciation-rules-field textarea {
  line-height: 1.7;
}

.review-language {
  margin-top: 16px;
  max-width: 220px;
}

.render-preparation summary {
  color: #51687b;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.6;
}

.preparation-action {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.preparation-action .hint {
  line-height: 1.6;
  font-size: 10px;
}

.prepared-preview,
#preparation-error {
  margin-top: 14px;
}

.prepared-field {
  background: #f7fbfa;
  border-color: #c9e1df;
}

.prepared-field textarea {
  min-height: 164px;
  font-size: 14px;
}

.stress-action {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin: 9px 0 0;
}

.stress-action .hint {
  font-size: 10px;
}

.preparation-warnings {
  color: #755730;
  font-size: 11px;
  line-height: 1.7;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.render-preparation {
  border-left: 2px solid #c9e1df;
  padding: 0 0 0 11px;
  margin: 12px 0;
}

.render-preparation-meta {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}

.generation-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 11px;
}

.history-panel {
  padding: 27px 31px;
}

.history-panel h2 {
  font-size: 21px;
}

.history-panel .section-line {
  margin-bottom: 22px;
}

.history-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0 20px;
}

.empty-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe8ee;
  border-radius: 50%;
  color: #8095a6;
  background: #f6f9fa;
  flex-shrink: 0;
}

.history-empty strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.history-empty p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 10px;
  margin-top: 9px;
}

.voice-item.selected {
  border-color: #acd2d0;
  background: #f5faf9;
}

.voice-initial {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--lilac);
  font: 600 13px var(--display);
}

.voice-content {
  flex: 1;
  min-width: 0;
}

.voice-content strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.voice-meta {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.icon-button {
  display: grid;
  place-items: center;
  background: transparent;
  color: #7b8b9a;
  width: 30px;
  height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
}

.icon-button:hover {
  background: #f3e9ed;
  color: var(--error);
}

.voice-play:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.icon-button:disabled {
  color: #b8c1c8;
  cursor: not-allowed;
}

.voice-item audio {
  display: none;
}

.voice-use {
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  border-radius: 2px;
}

.voice-use:hover strong {
  color: var(--teal);
}

.render-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.render-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.render-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.render-title {
  font-weight: 600;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.render-date {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.render-text {
  font-size: 12px;
  line-height: 1.75;
  color: #5b6f80;
  margin: 9px 0 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.render-text.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.render-item audio,.sample-preview audio {
  display: block;
  width: 100%;
  height: 37px;
}

.render-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.ai-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1px;
  color: #6f678c;
  background: #f0eef7;
  border-radius: 5px;
  padding: 4px 7px;
}

.render-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.download-link:hover {
  text-decoration: underline;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  cursor: pointer;
  line-height: 1.6;
  text-align: left;
  border-radius: 2px;
}

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

.text-button:disabled {
  color: var(--muted);
}

.sample-preview {
  margin: 0 0 18px;
  border: 1px solid #c9e1df;
  background: #f7fbfa;
  padding: 12px;
  border-radius: 9px;
}

.sample-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 9px;
}

.sample-heading>span {
  overflow-wrap: anywhere;
  min-width: 0;
}

.sample-heading button {
  flex-shrink: 0;
}

.sample-preview .hint {
  margin-top: 7px;
  font-size: 10px;
}

.inline-message {
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: #1e6266;
  overflow-wrap: anywhere;
}

.inline-message.error {
  background: var(--error-soft);
  color: var(--error);
}

#record-message {
  margin-bottom: 17px;
}

#synth-message {
  margin-top: 14px;
}

.job-status {
  margin-top: 4px;
}

.job-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--teal);
  margin-bottom: 7px;
}

.job-percent {
  font-family: var(--mono);
  flex-shrink: 0;
}

progress {
  display: block;
  width: 100%;
  height: 5px;
  appearance: none;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: #e5efef;
}

progress::-webkit-progress-bar {
  background: #e5efef;
}

progress::-webkit-progress-value {
  background: var(--teal);
}

progress::-moz-progress-bar {
  background: var(--teal);
}

#synth-job {
  margin-top: 16px;
}

.app-alert {
  background: var(--error-soft);
  border: 1px solid #e9cdd3;
  color: var(--error);
  padding: 13px 17px;
  border-radius: 12px;
  margin-bottom: 23px;
  font-size: 12px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

.app-alert button {
  flex-shrink: 0;
  color: var(--error);
  font-weight: 600;
}

.studio-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 1px 35px;
  color: #7c8b98;
  font-size: 10px;
}

.studio-footer>p {
  padding-top: 2px;
}

.studio-footer>p span {
  padding: 0 5px;
  color: #a2b0bc;
}

.diagnostics {
  max-width: 400px;
  text-align: right;
  font-size: 10px;
}

.diagnostics summary {
  cursor: pointer;
  display: list-item;
  list-style-position: inside;
}

.diagnostics dl {
  margin: 12px 0 7px;
}

.diagnostics dl>div {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 4px;
}

.diagnostics dd {
  margin: 0;
  color: #51687b;
  overflow-wrap: anywhere;
}

.diagnostics p {
  max-width: 360px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 15px;
  background: white;
  padding: 10px 15px;
  border-radius: 5px;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.noscript-message {
  position: fixed;
  inset: auto 15px 15px;
  background: white;
  padding: 20px;
  border: 2px solid var(--error);
  border-radius: 12px;
}

@media(min-width:1400px) {
  .app-shell {
    max-width: 1320px;
    padding: 0 60px;
  }
  .intro {
    padding-top: 47px;
    padding-bottom: 40px;
  }
  .studio-grid {
    gap: 26px;
  }
  .panel {
    padding: 32px;
  }
  .compose-panel {
    padding: 32px 34px 28px;
  }
  .history-panel {
    padding: 29px 34px;
  }
}

@media(max-width:960px) {
  .preparation-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .app-shell {
    padding: 0 25px;
  }
  .masthead {
    min-height: 96px;
  }
  .studio-grid {
    grid-template-columns: minmax(0,1fr) minmax(0,1.15fr);
    gap: 17px;
  }
  .panel,.compose-panel,.history-panel {
    padding: 23px;
  }
  .recorder {
    padding-left: 12px;
    padding-right: 12px;
  }
  .monitor-label {
    font-size: 9px;
  }
  .timer {
    font-size: 10px;
  }
  .timer span {
    font-size: 9px;
  }
  .field label {
    flex-wrap: wrap;
    gap: 2px 8px;
  }
  .script-footer>span:first-child {
    max-width: 170px;
  }
  .script-field textarea {
    min-height: 248px;
    font-size: 14px;
  }
  .privacy-note {
    max-width: 270px;
  }
  .output-column {
    gap: 17px;
  }
  .render-topline {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media(max-width:720px) {
  .prepared-field textarea {
    min-height: 172px;
  }
  .app-shell {
    max-width: 590px;
    padding: 0 19px;
  }
  .masthead {
    min-height: 87px;
    gap: 15px;
  }
  .brand-mark {
    width: 37px;
    height: 37px;
    font-size: 33px;
    border-radius: 11px;
  }
  .brand {
    gap: 10px;
  }
  .wordmark {
    font-size: 20px;
    letter-spacing: 4px;
  }
  .wordmark span {
    font-size: 9px;
    letter-spacing: .3px;
  }
  .connection-status {
    font-size: 10px;
    max-width: 120px;
    gap: 6px;
    line-height: 1.45;
  }
  .intro {
    padding: 30px 0 26px;
    gap: 22px;
    align-items: flex-start;
    flex-direction: column;
  }
  .intro .eyebrow {
    font-size: 9px;
    margin-bottom: 11px;
  }
  h1 {
    font-size: 44px;
    letter-spacing: -1.4px;
    line-height: 1.04;
  }
  h1 br {
    display: none;
  }
  .privacy-note {
    margin: 0;
    gap: 9px;
    max-width: none;
  }
  .privacy-note strong {
    font-size: 11px;
  }
  .privacy-note p {
    font-size: 11px;
    line-height: 1.5;
    margin-top: 3px;
  }
  .privacy-note p br {
    display: none;
  }
  .privacy-note svg {
    width: 17px;
    height: 17px;
  }
  .studio-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .panel,.compose-panel,.history-panel {
    padding: 24px;
    border-radius: 17px;
  }
  .panel-heading {
    margin-bottom: 12px;
  }
  h2 {
    font-size: 24px;
  }
  .section-description br {
    display: none;
  }
  .section-description {
    margin-bottom: 17px;
  }
  .recorder {
    padding: 17px 15px 13px;
  }
  .monitor-label {
    font-size: 10px;
  }
  .timer {
    font-size: 12px;
  }
  .timer span {
    font-size: 10px;
  }
  #waveform {
    height: 90px;
  }
  .compose-options {
    margin-top: 23px;
  }
  .script-field textarea {
    min-height: 220px;
    font-size: 16px;
  }
  .script-field textarea::placeholder {
    font-size: 14px;
  }
  .field input,.field textarea,.field select {
    font-size: 16px;
  }
  .field input {
    height: 44px;
  }
  .field textarea {
    font-size: 14px;
  }
  .field select {
    font-size: 13px;
  }
  .field label {
    font-size: 12px;
  }
  .output-column {
    gap: 18px;
  }
  .history-panel {
    padding-bottom: 20px;
  }
  .studio-footer {
    font-size: 9px;
    gap: 15px;
    flex-direction: column;
    padding-top: 23px;
  }
  .diagnostics {
    text-align: left;
    max-width: 100%;
  }
  .diagnostics dl>div {
    justify-content: flex-start;
  }
  .diagnostics p {
    max-width: none;
  }
  .history-empty {
    gap: 12px;
  }
  .app-alert {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
  }
  .render-topline {
    flex-wrap: nowrap;
  }
  .render-date {
    font-size: 9px;
  }
  .reading-guide {
    font-size: 12px;
  }
}

@media(max-width:480px) {
  .compose-options {
    grid-template-columns: 1fr;
  }
}

@media(max-width:380px) {
  .app-shell {
    padding: 0 13px;
  }
  .panel,.compose-panel,.history-panel {
    padding: 21px;
  }
  .wordmark span {
    font-size: 8px;
  }
  .connection-status {
    max-width: 100px;
    font-size: 9px;
  }
  h1 {
    font-size: 39px;
  }
  .script-footer {
    padding: 10px 12px;
    gap: 10px;
  }
  .render-topline {
    flex-wrap: wrap;
  }
  .render-links {
    gap: 7px;
  }
  .ai-label {
    font-size: 8px;
  }
  .download-link {
    font-size: 10px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior: auto!important;
    transition: none!important;
    animation: none!important;
  }
}
