:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #172033;
  --soft: #667085;
  --line: #d9e1ec;
  --panel: #ffffff;
  --blue: #2563eb;
  --green: #147d55;
  --red: #b42318;
  --amber: #b54708;
  --shadow: 0 16px 38px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 22px 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  max-width: 720px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
}

.stats div,
.panel,
.trainer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats div {
  padding: 12px;
  min-height: 72px;
}

.stats span {
  display: block;
  font-size: 25px;
  font-weight: 800;
}

.stats small {
  color: var(--soft);
}

.layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 16px;
}

.panel.muted {
  color: var(--soft);
  line-height: 1.45;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

select,
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

select,
input[type="file"] {
  min-height: 42px;
  padding: 8px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  padding: 14px;
  line-height: 1.45;
}

button {
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

#downloadSample,
#hintButton,
#showButton,
#shuffleButton {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

#downloadSample {
  width: 100%;
  margin-top: 10px;
}

.trainer {
  padding: 24px;
}

.prompt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.prompt-row h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.16;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.feedback {
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
  border: 1px solid var(--line);
  background: #f8fafc;
  line-height: 1.45;
}

.feedback.ok {
  border-color: rgba(20, 125, 85, 0.35);
  background: #ecfdf3;
  color: var(--green);
}

.feedback.near {
  border-color: rgba(181, 71, 8, 0.35);
  background: #fff7ed;
  color: var(--amber);
}

.feedback.bad {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fef3f2;
  color: var(--red);
}

.answer-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: none;
}

.answer-block.visible {
  display: block;
}

.answer-block h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.answer-block p {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .topbar,
  .prompt-row {
    display: grid;
  }

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

  .stats {
    width: 100%;
  }
}
