:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-bg-color, #fff);
  --fg: var(--tg-theme-text-color, #111);
  --muted: var(--tg-theme-hint-color, #888);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-fg: var(--tg-theme-button-text-color, #fff);
  --border: var(--tg-theme-section-separator-color, #ddd);
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px;
  background: var(--bg); color: var(--fg);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
header h1 { margin: 0; font-size: 20px; }
#user-tag { color: var(--muted); font-size: 13px; }
main { display: flex; flex-direction: column; gap: 12px; }
textarea {
  width: 100%; min-height: 140px; resize: vertical;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: inherit; font: inherit;
}
.row { display: flex; gap: 8px; }
select, button {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: transparent; color: inherit; font: inherit;
}
button {
  flex: 1; background: var(--accent); color: var(--accent-fg); border: none;
  font-weight: 600; cursor: pointer;
}
button.secondary {
  flex: 0 0 auto; background: transparent; color: var(--fg);
  border: 1px solid var(--border); font-weight: 500;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.meta { display: flex; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-top: -6px; }
.meta.warn { color: #c80; }
.meta.error { color: #d33; }
.status { color: var(--muted); font-size: 14px; min-height: 20px; }
.status.error { color: #d33; }
audio { width: 100%; margin-top: 8px; }
