:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #607085;
  --line: #d9e1ea;
  --accent: #0a7f78;
  --accent-strong: #05645f;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

button,
textarea {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 24px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.question-panel,
.bus-panel,
.answer-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.question-panel {
  gap: 14px;
  padding: 20px;
}

.bus-panel {
  gap: 12px;
  padding: 20px;
}

.answer-panel {
  padding: 24px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: 15px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.busy {
  background: var(--accent);
}

.status-dot.error {
  background: var(--danger);
}

.question-label {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: #fbfcfe;
  line-height: 1.55;
}

textarea:focus {
  outline: 3px solid rgba(10, 127, 120, 0.18);
  border-color: var(--accent);
}

.controls {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 10px;
  align-items: center;
}

button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

button:active {
  transform: translateY(1px);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: rgba(10, 127, 120, 0.35);
  color: var(--accent-strong);
  font-weight: 700;
}

.bus-options {
  display: grid;
  gap: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  font-size: 24px;
}

.small-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--accent-strong);
  font-weight: 700;
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.answer-text {
  margin: 22px 0 0;
  color: var(--text);
  font-size: clamp(20px, 2.5vw, 34px);
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  textarea {
    min-height: 140px;
  }
}
