:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --warn: #b45309;
  --bad: #b42318;
  --good: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 18px;
}

.auth-form,
.inline-form,
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-form input {
  width: 160px;
}

input,
select,
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

input,
select {
  width: 100%;
  background: #ffffff;
  color: var(--ink);
}

button {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  white-space: nowrap;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.is-unauthenticated [data-auth-required] {
  opacity: 0.62;
}

.status {
  min-height: 40px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef7f6;
  color: var(--accent);
}

.status.error {
  background: #fff4f2;
  color: var(--bad);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric,
.word,
.sample,
.voice,
.suggestion {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfe;
}

.metric strong {
  display: block;
  font-size: 24px;
}

.metric span,
.word small,
.sample small {
  color: var(--muted);
}

.words,
.samples,
.voices,
.suggestions {
  display: grid;
  gap: 10px;
}

.voices {
  margin-top: 12px;
}

.voice-warning {
  margin: 8px 0 12px;
  color: var(--warn);
}

.voice-update-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}

.voice-update-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.voice-update-form button {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.word {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.word h3,
.sample h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pill {
  align-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff7ed;
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.pill.ready {
  background: #ecfdf3;
  color: var(--good);
}

.pill.experimental {
  background: #eef2ff;
  color: #4338ca;
}

.model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.model-generate,
.model-download {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.model-download {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

.sample-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sample-form label,
.inline-form {
  min-width: 0;
}

.sample-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.sample-form .wide,
.sample-form button {
  grid-column: 1 / -1;
}

.inline-form {
  margin: 12px 0;
}

@media (max-width: 820px) {
  .topbar,
  .grid,
  .summary,
  .sample-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: stretch;
  }

  .auth-form,
  .inline-form,
  .voice-update-form {
    display: grid;
    grid-template-columns: 1fr;
  }
}
