:root {
  color-scheme: light;
  --paper: #fff; --surface: #fffefb; --ink: #241f20; --muted: #625953; --line: #d6cfc8;
  --accent: #05a551; --tint: #f6eddf;
  font-family: 'Oswald', sans-serif;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
main { max-width: 65rem; margin: auto; padding: clamp(2rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem) 3rem; }
header { margin-bottom: 2rem; text-align: center; }
.brand-logo, .footer-logo {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
.brand-logo {
  width: clamp(7rem, 24vw, 12rem);
  margin-bottom: .75rem;
}
h1 { font-size: clamp(2.6rem, 6vw, 3.9rem); font-weight: 700; line-height: 1; letter-spacing: -.05em; margin: 0; }
header p { color: var(--muted); margin: 1.05rem 0 0; }
h2 { margin: 0; font-size: 1.125rem; font-weight: 650; line-height: 1.35; }
.panel, .result { border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.panel { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 1fr); overflow: hidden; }
.editor, .settings, .result { padding: clamp(1rem, 3vw, 1.7rem); }
.editor { display: flex; flex-direction: column; }
textarea {
  display: block; width: 100%; flex: 1; min-height: 10rem; resize: vertical; margin: 1rem 0;
  padding: .85rem 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .6rem;
  font-size: 1.25rem; line-height: 1.65;
}
.examples, .settings-heading, .result-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.examples, .voice, .setting, .status, details, #download-status { font-size: .9rem; }
.examples > span { color: var(--muted); margin-right: .2rem; }
.examples button { border: 1px solid transparent; padding: .28rem .7rem; border-radius: 2rem; }
button, textarea, pre { font-family: inherit; }
button, a { cursor: pointer; }
button { background: var(--accent); color: #fff; }
a { color: var(--accent); }
.examples button:hover { border-color: var(--ink); }
#download:hover { border-color: var(--accent); }
.settings { border-inline-start: 1px solid var(--line); }
.settings-heading, .result-heading { justify-content: space-between; }
.voice { color: var(--muted); }
.voice b { margin-left: .25rem; color: var(--ink); }
.setting { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-top: .85rem; gap: .15rem .5rem; }
.setting output { font-variant-numeric: tabular-nums; color: var(--muted); }
.setting input { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--accent); }
.action { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 1.7rem); border-top: 1px solid var(--line); }
#speak { border: 0; border-radius: .55rem; font-size: 1rem; font-weight: 650; padding: .72rem 1.65rem; }
#speak:disabled { opacity: .54; cursor: default; }
.feedback { min-width: 0; max-width: 27rem; flex: 1; }
.status, details, #download-status { color: var(--muted); }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: .35rem; }
.bar i { display: block; height: 100%; background: var(--accent); }
.result { margin-top: 1rem; }
.result-heading { margin-bottom: .75rem; }
#download { border: 1px solid var(--line); border-radius: .4rem; padding: .4rem .85rem; font-size: .9rem; font-weight: 600; text-decoration: none; }
audio { display: block; width: 100%; }
#waveform { display: block; width: 100%; height: 4rem; margin-top: .65rem; background: var(--tint); border-radius: .6rem; color: var(--accent); }
details { margin-top: .8rem; }
summary { cursor: pointer; }
pre { color: var(--ink); white-space: pre-wrap; word-break: break-word; font-size: .875rem; }
.site-footer {
  padding: 0 1rem clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.site-footer p { margin: 0 auto .75rem; }
.footer-logo { width: clamp(3rem, 12vw, 4.5rem); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 44rem) {
  .panel { grid-template-columns: 1fr; }
  .settings { border-inline-start: 0; border-top: 1px solid var(--line); }
  header { margin-bottom: 1.25rem; }
}
