:root {
  --ink: #1c2430;
  --muted: #5c6b7a;
  --line: #dde3ea;
  --accent: #0f6fbe;
  --bg: #f5f7fa;
  --warn: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

header h1 { font-size: 18px; margin: 0; font-weight: 600; }

.account { font-size: 14px; color: var(--muted); }
.account a { color: var(--accent); }

main { max-width: 820px; margin: 24px auto; padding: 0 16px 48px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }

.hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.voice { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.voice:last-child { border-bottom: 0; }
.voice label { cursor: pointer; }
.voice .label { font-weight: 600; }
.voice .note { display: block; font-size: 13px; color: var(--muted); }

textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}
.counter { font-size: 13px; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.over { color: var(--warn); font-weight: 600; }

button.primary {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 20px;
  cursor: pointer;
}
button.primary:disabled { background: #9fb4c6; cursor: progress; }

a.btn {
  font: inherit;
  font-size: 13px;
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.status { margin-top: 12px; font-size: 14px; color: var(--muted); min-height: 20px; }
.status.error { color: var(--warn); }

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 6px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result { margin-top: 12px; }
.result audio { width: 100%; margin-bottom: 8px; }

.history { font-size: 14px; }
.history table { width: 100%; border-collapse: collapse; }
.history td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.history .meta { color: var(--muted); font-size: 13px; }
