/* Local SIL OFL fonts; license notices are included beside the font files. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin.woff2") format("woff2");
}
:root {
  --paper: #f6f4ee;
  --ink: #2c302a;
  --muted: #696b61;
  --line: #cfcec3;
  --soft: #eaeae1;
  --pressed: #dee1d4;
  --selected: #e5e8dc;
  --error: #963d2d;
  --focus: #52664b;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font: 15px/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  font-synthesis: none;
  -webkit-tap-highlight-color: #52664b26;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.site-footer form {
  margin: 0;
}
.site-footer button {
  font-size: inherit;
  padding-inline: 8px;
}
.login-main {
  max-width: 480px;
  padding-top: clamp(64px, 18vh, 180px);
}
.login-main h1 {
  font-size: clamp(36px, 8vw, 48px);
}
.login-intro {
  margin: 16px 0 40px;
  color: var(--muted);
}
.login-form {
  display: grid;
  gap: 12px;
}
.login-form label {
  font-size: 13px;
}
.login-form input {
  width: 100%;
}
.login-form button {
  margin-top: 12px;
}
.login-error {
  color: var(--error);
  margin: 0;
  font-size: 13px;
}
@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover {
    color: var(--ink);
  }
}
header,
main {
  max-width: 880px;
  margin: auto;
  padding: 0 40px;
}
header {
  padding-top: 64px;
  padding-bottom: 40px;
}
main {
  padding-bottom: 48px;
}
h1 {
  margin: 0;
  font: 400 52px/1.15 var(--serif);
  letter-spacing: -1.6px;
  font-optical-sizing: auto;
}
h2,
h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  min-height: 48px;
  padding: 12px 22px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
}
.primary:disabled {
  opacity: 1;
  background: #e5e5dc;
  border-color: transparent;
  color: #62675c;
}
.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: inherit;
  overflow-wrap: anywhere;
}
input {
  min-height: 48px;
  border: 1px solid #aaac9e;
  border-radius: 3px;
  padding: 11px 14px;
  background: transparent;
}
::selection {
  background: #dfe6d5;
  color: var(--ink);
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
input[type="radio"] {
  min-height: 0;
  accent-color: var(--ink);
}
input::placeholder {
  color: var(--muted);
  opacity: 1;
}
input::-webkit-search-cancel-button {
  filter: grayscale(1);
  cursor: pointer;
}
.workspace {
  min-width: 0;
}
.editor-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.editor-heading label,
.control-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.editor-meta {
  opacity: 0;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.workspace:has(#text-input:focus) .editor-meta,
.editor-meta.near-limit {
  opacity: 1;
}
.editor-meta.invalid {
  color: var(--error);
}
textarea {
  display: block;
  width: 100%;
  height: 320px;
  min-height: 220px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 24px 0;
  font: 400 21px/1.65 var(--serif);
  font-optical-sizing: auto;
  resize: vertical;
}
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--focus);
  box-shadow: 0 1px 0 var(--focus);
}
.workspace:has(textarea:focus-visible) .editor-heading {
  border-bottom-color: var(--focus);
}
textarea[aria-invalid="true"] {
  border-bottom-color: var(--error);
  box-shadow: 0 1px 0 var(--error);
}
.controls {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.voice-trigger {
  min-width: 0;
  max-width: 55%;
  min-height: 52px;
  justify-content: flex-start;
  padding: 4px 12px;
  margin-left: -12px;
  border: 0;
  background: transparent;
  text-align: left;
}
.voice-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}
.control-label {
  color: var(--muted);
}
#current-voice {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.chevron {
  margin-left: 8px;
  flex-shrink: 0;
  color: var(--muted);
}
#generate {
  flex-shrink: 0;
}
.muted {
  font-size: 13px;
  color: var(--muted);
}
.status {
  padding-top: 24px;
  font-size: 14px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#status-message {
  margin: 0;
}
#status-detail {
  margin: 4px 0 0;
}
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.status[data-kind="error"] {
  padding: 12px 0 12px 16px;
  margin-top: 24px;
  border-left: 2px solid var(--error);
}
.status[data-kind="error"] #status-message {
  color: var(--error);
}
progress {
  display: block;
  width: 100%;
  height: 2px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  margin-top: 16px;
  accent-color: var(--focus);
  background: var(--soft);
}
progress::-webkit-progress-bar {
  background: var(--soft);
}
progress::-webkit-progress-value {
  background: var(--focus);
}
progress::-moz-progress-bar {
  background: var(--focus);
}
.recording {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.recording-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.recording-voice {
  margin: 0;
  font: 400 23px/1.3 var(--serif);
  overflow-wrap: anywhere;
}
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  margin-right: -10px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
audio {
  display: block;
  width: 100%;
  height: 50px;
  margin: 12px 0 0;
  border-radius: 3px;
}
/* Tone supported native controls; other browsers keep their platform player. */
@supports selector(audio::-webkit-media-controls-enclosure) {
  audio {
    border: 1px solid var(--line);
    background: var(--soft);
  }
  audio::-webkit-media-controls-enclosure {
    border-radius: 2px;
    background: var(--soft);
  }
  audio::-webkit-media-controls-panel {
    background: var(--soft);
  }
}
audio:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.playback-error {
  color: var(--error);
  font-size: 13px;
}
.previous-toggle {
  border: 0;
  background: transparent;
  justify-content: flex-start;
  padding: 10px 12px;
  margin-left: -12px;
  color: var(--muted);
  font-size: 13px;
}
.previous-toggle[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}
.recording.previous {
  padding-top: 8px;
  margin-top: 20px;
  border: 0;
}
.previous .recording-body {
  padding: 4px 0 12px;
}
dialog {
  padding: 0;
  width: 500px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  border: 1px solid #c6c6b9;
  border-radius: 6px;
  color: inherit;
  background: var(--paper);
  box-shadow: 0 16px 64px #292e251a;
}
dialog::backdrop {
  background: #33372c42;
}
dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialog-header {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
}
.dialog-header h2 {
  font: 400 28px/1.2 var(--serif);
  letter-spacing: -0.4px;
}
.close-button {
  width: 44px;
  padding: 8px;
  margin-right: -10px;
  flex-shrink: 0;
}
.dialog-body {
  padding: 0 28px 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
#voice-search {
  display: block;
  width: 100%;
  margin-bottom: 16px;
}
#voice-search:focus-visible {
  outline-offset: -2px;
}
.voice-options {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
#voices-list {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.voice-option {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  padding: 14px 12px;
  margin: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 16px;
}
.voice-option:has(input:checked) {
  background: var(--selected);
}
.voice-option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.voice-option input {
  flex-shrink: 0;
  margin: 0;
}
.voice-option input:focus-visible {
  outline: none;
}
.voice-preview {
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.voice-preview h3 {
  font: 400 23px/1.3 var(--serif);
}
.voice-preview audio {
  margin: 12px 0 0;
}
#preview-error {
  font-size: 13px;
  color: var(--error);
}
.dialog-footer {
  flex-shrink: 0;
  padding: 20px 28px 24px;
  display: flex;
  justify-content: flex-end;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Pointer feedback; touch keeps the browser's transient tap highlight. */
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled),
  .download:hover {
    background: var(--soft);
  }
  .primary:hover:not(:disabled) {
    background: #3b4335;
    border-color: #3b4335;
  }
  .download:hover,
  .quiet:hover:not(:disabled),
  .previous-toggle:hover {
    color: var(--ink);
  }
  .voice-option:hover {
    background: var(--soft);
  }
  .voice-option:has(input:checked):hover {
    background: var(--selected);
  }
  #voice-search:hover:not(:focus) {
    border-color: var(--muted);
  }
  button:active:not(:disabled),
  .download:active {
    background: var(--pressed);
  }
  .primary:active:not(:disabled) {
    background: #20251d;
    border-color: #20251d;
  }
  .voice-option:active,
  .voice-option:has(input:checked):active {
    background: var(--pressed);
  }
}
@media (forced-colors: active) {
  textarea:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 3px;
  }
}
@media (max-width: 600px) {
  header,
  main {
    padding-left: 24px;
    padding-right: 24px;
  }
  header {
    padding-top: 36px;
    padding-bottom: 32px;
  }
  h1 {
    font-size: 42px;
    letter-spacing: -1.2px;
  }
  textarea {
    height: clamp(260px, 34svh, 320px);
    padding: 20px 0;
    font-size: 19px;
    line-height: 1.65;
  }
  .controls {
    gap: 12px;
    margin-top: 16px;
  }
  .voice-trigger {
    max-width: none;
    flex: 1;
  }
  .chevron {
    margin-left: 2px;
  }
  #generate {
    padding: 12px 18px;
  }
  .recording {
    margin-top: 32px;
    padding-top: 16px;
  }
  .recording-heading {
    flex-wrap: wrap;
  }
  .recording-voice {
    font-size: 22px;
  }
  .status-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .status-actions {
    max-width: 100%;
  }
  dialog {
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }
  .dialog-header {
    padding: 16px 20px;
  }
  .dialog-header h2 {
    font-size: 24px;
  }
  .dialog-body {
    padding: 0 20px 6px;
  }
  #voices-list {
    max-height: 224px;
  }
  .dialog-footer {
    padding: 20px;
  }
  .dialog-footer button {
    width: 100%;
  }
}
