:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0b73ce;
  --accent-dark: #075da8;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(960px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.segmented,
.iconButton,
.primary,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented {
  min-height: 42px;
  background: var(--surface);
  color: var(--text);
}

.segmented.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #edf6ff;
}

.iconButton {
  width: 42px;
  height: 42px;
  background: var(--surface);
  color: var(--accent);
  font-size: 20px;
}

.panel,
.voicePanel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.panel {
  margin-bottom: 12px;
}

.voiceGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

select,
input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.metaRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.metaRow select {
  width: 120px;
}

.statusBar {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.statusBar.error {
  border-color: #fda29b;
  color: var(--danger);
  background: #fff3f1;
}

.actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: var(--bg);
}

.primary {
  width: 100%;
  min-height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .voiceGrid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 240px;
  }
}
