:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #66635d;
  --line: #d7d3ca;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --accent: #d84b32;
  --accent-soft: #f8e5df;
  --success: #287a50;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 242, 0.96);
  backdrop-filter: blur(12px);
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 14px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 4px;
  background: var(--ink);
  color: #ffffff;
  font-size: 11px;
}

.topbar-actions {
  font-size: 13px;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 32px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.section-heading {
  margin-bottom: 24px;
}

.scorecard-panel,
.result-panel {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.scorecard-rows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.score-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1fr);
  min-height: 78px;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.score-row:last-child {
  border-bottom: 0;
}

.area-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.area-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.score-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.score-options label {
  position: relative;
  min-width: 0;
}

.score-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-options span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.score-options label:last-child span {
  border-right: 0;
}

.score-options input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}

.score-options input:checked + span {
  background: var(--ink);
  color: #ffffff;
}

.result-panel {
  position: sticky;
  top: 90px;
  width: 100%;
  max-width: 100%;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.result-panel > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
}

.score-summary {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  padding: 22px 22px 18px;
}

.score-summary span,
.rating-block span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.score-summary strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.score-summary small {
  color: var(--muted);
  font-size: 16px;
}

.rating-block strong {
  font-size: 18px;
  line-height: 1.15;
}

.progress-track {
  height: 5px;
  margin: 0 22px;
  overflow: hidden;
  background: #ebe8e1;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.blockers {
  min-height: 182px;
  padding: 22px;
}

.blockers h2 {
  margin: 0 0 12px;
  font-size: 13px;
}

.blockers ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.blockers li + li {
  margin-top: 6px;
}

.commands {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.8fr 40px;
  gap: 8px;
  padding: 18px 22px 10px;
  border-top: 1px solid var(--line);
}

.commands button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.commands button:hover,
.icon-button:hover {
  border-color: var(--ink);
}

.commands .primary-command {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.command-status {
  min-height: 30px;
  margin: 0;
  padding: 0 22px 14px;
  color: var(--success);
  font-size: 12px;
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
    width: min(calc(100% - 28px), 680px);
    padding-top: 28px;
  }

  .result-panel {
    position: static;
    grid-row: 1;
  }

  .scorecard-panel {
    grid-row: 2;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .topbar-actions > a:nth-of-type(3) {
    display: none;
  }

  .score-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 116px;
  }

  .score-summary {
    grid-template-columns: 1fr 1fr;
  }

  .commands {
    grid-template-columns: 1fr 1fr 1fr 40px;
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
