:root {
  --ink: var(--tools-text);
  --muted: var(--tools-muted);
  --paper: var(--tools-bg);
  --surface: var(--tools-surface);
  --surface-soft: var(--tools-surface-soft);
  --line: var(--tools-line);
  --green: var(--tools-green);
  --green-dark: var(--tools-green-strong);
  --green-soft: var(--tools-green-soft);
  --red: var(--tools-red);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--tools-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 13% 12%, color-mix(in srgb, var(--green) 8%, transparent), transparent 27rem),
    var(--paper);
}
button, input, select { font: inherit; }
button, select, input[type="color"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
[v-cloak] { display: none; }
.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
}

main {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}
.hero {
  max-width: 900px;
  margin: 42px auto 50px;
  text-align: center;
}
.eyebrow, .step-label {
  margin: 0 0 12px;
  color: var(--green-dark);
  font: 700 .72rem/1.3 var(--tools-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 auto;
  font-family: var(--tools-serif);
  font-size: clamp(2.75rem, 6vw, 5.15rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.058em;
}
.hero-copy {
  max-width: 680px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.7;
}
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 18px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--green-dark);
  font-size: .76rem;
  font-weight: 750;
  list-style: none;
}
.hero-proof li { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof svg { width: 14px; height: 14px; }

.workspace, .repair-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--tools-shadow);
}
.workspace { overflow: hidden; }
.workspace-heading, .repair-heading {
  padding: clamp(25px, 5vw, 45px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
}
.workspace-heading > div, .repair-heading > div { max-width: 720px; }
.workspace h2, .repair-panel h2, .preview-panel h2 {
  margin: 0;
  font-family: var(--tools-serif);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.workspace-heading p:not(.step-label), .repair-heading p:not(.step-label) {
  margin: 11px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
  transition: transform .16s cubic-bezier(.23, 1, .32, 1), background .16s, border-color .16s;
}
.button:active { transform: scale(.97); }
.button-primary { color: var(--tools-on-action); background: var(--tools-action); }
.button-secondary { color: var(--green-dark); border-color: var(--line); }
.swap-button svg { width: 18px; height: 18px; }

.color-inputs {
  padding: 0 clamp(25px, 5vw, 45px) clamp(28px, 5vw, 46px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.color-field { min-width: 0; }
.color-model-explainer {
  grid-column: 1 / -1;
  max-width: 900px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.55;
}
.color-field > label {
  margin-bottom: 9px;
  display: block;
  font-size: .78rem;
  font-weight: 800;
}
.color-entry {
  min-height: 76px;
  padding: 7px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.color-well {
  width: 96px;
  height: 60px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.color-well::-webkit-color-swatch-wrapper { padding: 0; }
.color-well::-webkit-color-swatch,
.color-well::-moz-color-swatch {
  border: 0;
  border-radius: 6px;
}
.color-entry > input[type="text"] {
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: 700 1.02rem/1 var(--tools-mono);
  text-transform: uppercase;
}
.color-entry > .color-copy-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--surface);
}
.color-copy-button svg { width: 18px; height: 18px; }
.color-field.invalid .color-entry { border-color: var(--red); }
.field-error { margin: 7px 0 0; color: var(--red); font-size: .72rem; }

.color-tuning-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.color-tuning-panel summary {
  min-height: 52px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.color-tuning-panel summary::marker { color: var(--green-dark); }
.color-tuning-panel[open] summary { border-bottom: 1px solid var(--line); }
.inline-color-picker {
  margin: 0;
  padding: 14px 13px 13px;
  display: grid;
  gap: 11px;
  border: 0;
}
.picker-slider { display: grid; gap: 6px; }
.picker-slider > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .67rem; font-weight: 750; }
.inline-color-picker output { color: var(--ink); font: 700 .65rem/1 var(--tools-mono); }
.inline-color-picker input[type="range"] {
  width: 100%;
  height: 15px;
  margin: 0;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  cursor: pointer;
}
.inline-color-picker .hue-range { background: var(--picker-hue-gradient); }
.inline-color-picker .intensity-range { background: var(--picker-intensity-gradient); }
.inline-color-picker .lightness-range { background: var(--picker-lightness-gradient); }
.inline-color-picker input[type="range"]::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--picker-current);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 36%, var(--line)), 0 2px 5px rgb(0 0 0 / 18%);
}
.picker-state-hint {
  min-height: 2.8em;
  margin: 0;
  padding-top: 2px;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.4;
}
.inline-color-picker input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--picker-current);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 36%, var(--line)), 0 2px 5px rgb(0 0 0 / 18%);
}

.mobile-score { display: none; }

.assessment {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.assessment-layout {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
}
.score {
  min-height: 310px;
  padding: clamp(28px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}
.score > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.score > strong {
  margin-top: 8px;
  font-family: var(--tools-serif);
  font-size: clamp(4.6rem, 10vw, 7.5rem);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.07em;
}
.score > strong small { font: 600 .3em/1 var(--tools-mono); letter-spacing: 0; }
.score > small { margin-top: 13px; color: var(--muted); font-size: .7rem; }
.result-list {
  margin: 0;
  padding: 0;
  display: grid;
  align-content: center;
  list-style: none;
}
.result-details { padding: 24px clamp(20px, 4vw, 38px); display: grid; align-content: center; }
.result-explainer { max-width: 720px; margin: 0 0 10px; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.result-list li {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}
.result-list li:last-child { border-bottom: 0; }
.status-mark {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 900;
}
.passes .status-mark { color: var(--tools-green-text); background: var(--green-soft); }
.fails .status-mark { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.result-list strong, .result-list small { display: block; }
.result-list strong { font-size: .8rem; }
.result-list small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.result-list b { font-size: .68rem; }
.passes > b { color: var(--green-dark); }
.fails > b { color: var(--red); }

.preview-panel {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--tools-shadow);
}
.preview-heading { padding: clamp(25px, 5vw, 45px); }
.preview-panel h2 { max-width: 650px; }
.preview-heading > p:not(.step-label) { max-width: 650px; margin: 11px 0 0; color: var(--muted); line-height: 1.65; }
.preview-surface { min-height: 310px; padding: clamp(34px, 7vw, 72px); border-top: 1px solid var(--line); }
.large-sample { margin-top: 28px; display: block; font-size: 1.65rem; line-height: 1.2; }
.preview-surface > p { max-width: 650px; margin: 18px 0 0; font-size: 1rem; line-height: 1.72; }
.preview-surface button {
  min-height: 46px;
  margin-top: 24px;
  padding: 0 18px;
  border: 2px solid currentColor;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font-weight: 800;
}

.repair-panel { margin: 24px 0 54px; }
.target-field { min-width: min(100%, 300px); display: grid; gap: 8px; }
.target-field span { font-size: .75rem; font-weight: 800; }
.target-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}
.repair-grid {
  padding: 0 clamp(25px, 5vw, 45px) clamp(28px, 5vw, 46px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.repair-card {
  min-height: 310px;
  padding: clamp(18px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.repair-card-title { margin: 0 0 14px; font-size: .8rem; font-weight: 800; }
.repair-swatch {
  min-height: 118px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  border-radius: 12px;
}
.repair-swatch strong { font: 600 3.1rem/1 var(--tools-serif); }
.repair-swatch span { font: 700 .76rem/1 var(--tools-mono); }
.repair-result {
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.repair-result strong, .repair-result small { display: block; }
.repair-result strong { font-size: .76rem; }
.repair-result small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.repair-result button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--surface);
  font: 700 .68rem/1 var(--tools-mono);
}
.repair-card > .button { width: 100%; margin-top: auto; }
.repair-message { margin: auto 0; color: var(--muted); line-height: 1.6; text-align: center; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  border-radius: 10px;
  color: white;
  background: #171a18;
  box-shadow: var(--tools-shadow);
  transform: translateX(-50%);
  font-size: .8rem;
  font-weight: 750;
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 65%, white); outline-offset: 3px; }

@media (max-width: 820px) {
  .assessment-layout { grid-template-columns: 1fr; }
  .score { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); text-align: center; }
  .score > strong { font-size: clamp(4.6rem, 18vw, 7rem); }
  .repair-heading { align-items: stretch; flex-direction: column; }
  .target-field { width: 100%; }
}

@media (max-width: 620px) {
  main { width: min(100% - 28px, 1160px); }
  .brand { gap: 8px; font-size: .82rem; }
  .hero { margin: 34px auto 38px; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.45rem); }
  .hero-copy { font-size: .94rem; line-height: 1.55; }
  .workspace, .repair-panel, .preview-panel { border-radius: 18px; }
  .workspace { overflow: visible; }
  .workspace-heading { padding: 22px 18px 18px; align-items: stretch; flex-direction: column; gap: 16px; }
  .swap-button { width: 100%; }
  .color-inputs { padding: 0 18px 18px; grid-template-columns: 1fr; gap: 16px; }
  .color-field > label { margin-bottom: 6px; }
  .color-entry {
    min-height: 88px;
    grid-template-columns: 78px minmax(0, 1fr) 44px;
    gap: 8px;
  }
  .color-well { width: 78px; height: 72px; }
  .color-entry > input[type="text"] { height: 44px; padding: 0 7px; font-size: .93rem; }
  .mobile-score {
    position: sticky;
    z-index: 4;
    top: 8px;
    margin: 12px 10px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 7px 22px rgb(0 0 0 / 10%);
    backdrop-filter: blur(12px);
    cursor: pointer;
    list-style: none;
  }
  .mobile-score::-webkit-details-marker { display: none; }
  .mobile-score::marker { content: ""; }
  .mobile-score-measure { min-width: 0; display: grid; gap: 7px; }
  .mobile-score-measure > span { color: var(--muted); font-size: .65rem; font-weight: 800; line-height: 1.2; }
  .mobile-score-measure > strong {
    display: inline-flex;
    align-items: baseline;
    color: var(--ink);
    font: 500 2.3rem/.9 var(--tools-serif);
    letter-spacing: -.045em;
    white-space: nowrap;
  }
  .mobile-score-measure > strong small { margin-left: 2px; font: 700 .45em/1 var(--tools-mono); letter-spacing: 0; }
  .mobile-score-context { min-width: 0; display: grid; justify-items: end; gap: 6px; text-align: right; }
  .mobile-score-context > span:first-child { color: var(--muted); font-size: .63rem; line-height: 1.3; }
  .mobile-score-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); font-size: .66rem; font-weight: 800; }
  .mobile-score-toggle svg { width: 15px; height: 15px; transition: transform .16s cubic-bezier(.23, 1, .32, 1); }
  .assessment[open] .mobile-score-toggle svg { transform: rotate(180deg); }
  .color-model-explainer { font-size: .7rem; }
  .color-tuning-panel summary { min-height: 48px; padding: 10px 12px; }
  .inline-color-picker { padding: 13px 12px 12px; }
  .score { display: none; }
  .assessment { border-radius: 0 0 18px 18px; }
  .assessment-layout { display: block; }
  .result-details { padding: 18px; }
  .result-list li { min-height: 62px; }
  .preview-heading, .preview-surface { padding: 30px 22px; }
  .repair-heading { padding: 24px 18px; }
  .repair-grid { padding: 0 18px 22px; grid-template-columns: 1fr; }
  .repair-card { min-height: 295px; }
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at 13% 12%, color-mix(in srgb, var(--green) 10%, transparent), transparent 27rem),
      var(--paper);
  }
  .toast { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
