:root {
  --ink: #171717;
  --muted: #696b70;
  --line: #d9d5cd;
  --paper: #f8f6f1;
  --panel: #ffffff;
  --blue: #4a8fbd;
  --green: #5d9b6f;
  --red: #c44e43;
  --gold: #c99a35;
  --rose: #c76b83;
  --violet: #8164a8;
  --shadow: 0 18px 50px rgba(24, 24, 24, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(440px, 1.15fr);
  min-height: calc(100vh - 88px);
  gap: 20px;
  align-items: stretch;
}

.input-panel,
.result-panel,
.details-grid article,
.score-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.brand-mark {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 24px 0 26px;
  max-width: 580px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #303238;
  font-size: 13px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8c2b7;
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffdfa;
  font: inherit;
  outline: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 143, 189, 0.18);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button.primary {
  color: white;
  background: var(--ink);
}

button.secondary {
  color: var(--ink);
  background: transparent;
}

.status {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(260px, 0.7fr);
  gap: 18px;
  padding: 22px;
  align-items: center;
}

.wheel-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-center {
  position: absolute;
  inset: 36%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.wheel-center span {
  max-width: 120px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wheel-center strong {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.summary {
  display: grid;
  gap: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin: 0;
}

h2 {
  margin-top: 6px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.summary p,
.details-grid p {
  color: var(--muted);
  line-height: 1.55;
}

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

.metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.details-grid article {
  min-height: 170px;
  padding: 18px;
  box-shadow: none;
}

.details-grid h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.score-list {
  margin-top: 18px;
  padding: 18px;
  box-shadow: none;
}

.score-row {
  display: grid;
  grid-template-columns: 160px 1fr 52px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ebe7df;
}

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

.bar {
  height: 10px;
  border-radius: 999px;
  background: #ebe7df;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--score);
  background: var(--color);
}

@media (max-width: 980px) {
  .workbench,
  .result-panel,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .workbench {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 10px;
  }

  .input-panel,
  .result-panel {
    padding: 16px;
  }

  .actions,
  .metrics {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 112px 1fr 42px;
    font-size: 13px;
  }
}
