:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #20251f;
  --muted: #647064;
  --line: #dfe4dc;
  --accent: #1f6f62;
  --accent-strong: #164f47;
  --warn: #9d3b30;
  --shadow: 0 10px 30px rgba(31, 45, 37, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-strong);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar div,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.topbar nav a {
  text-decoration: none;
  font-weight: 650;
}

main {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.intro,
.panel,
.question,
.result,
.test-card,
.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro {
  padding: 32px;
  margin-bottom: 22px;
}

.intro.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.intro h1,
.result h1,
.panel h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.intro p,
.panel p,
.test-card p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.test-list,
.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.test-card,
.panel,
.question,
.result {
  padding: 24px;
}

.test-card h2,
.panel h2,
.question h3 {
  margin: 0 0 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-strong);
  background: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--accent);
}

.test-form,
.list,
.results-table {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.text-input,
.code-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.code-area {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
}

.option input {
  margin-top: 5px;
}

.muted {
  color: var(--muted);
}

.narrow {
  max-width: 520px;
}

.notice,
.error {
  border-radius: 6px;
  padding: 12px 14px;
}

.notice {
  border: 1px solid #b9d6c8;
  background: #ecf6f1;
}

.training-note {
  margin: 0 0 22px;
  color: var(--muted);
}

.training-note strong {
  color: var(--accent-strong);
}

.error {
  border: 1px solid #e0b2ad;
  background: #fff0ee;
  color: var(--warn);
}

.item,
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  padding: 16px;
}

.item span {
  color: var(--muted);
}

.results-table {
  margin-top: 12px;
}

.row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(120px, 0.8fr) minmax(180px, 1.2fr) 80px 70px;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .topbar,
  .intro.compact {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  main {
    width: min(100vw - 20px, 1120px);
    padding-top: 18px;
  }

  .test-list,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .intro,
  .test-card,
  .panel,
  .question,
  .result {
    padding: 18px;
  }

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