:root {
  color-scheme: light;
  --bg: oklch(96.8% 0.009 96);
  --panel: oklch(99% 0.005 96);
  --panel-alt: oklch(95% 0.011 96);
  --ink: oklch(17% 0.018 124);
  --muted: oklch(46% 0.02 124);
  --line: oklch(84% 0.014 102);
  --soft-line: oklch(90.5% 0.012 102);
  --accent: oklch(42% 0.085 174);
  --accent-dark: oklch(29% 0.078 174);
  --accent-soft: oklch(92.5% 0.038 174);
  --gold: oklch(74% 0.115 78);
  --green: oklch(58% 0.095 154);
  --red: oklch(56% 0.12 28);
  --shadow: 0 18px 44px oklch(43% 0.024 124 / 0.14);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, oklch(92% 0.025 174) 0 212px, transparent 212px),
    linear-gradient(135deg, oklch(97.5% 0.009 96), oklch(94.5% 0.013 72));
  color: var(--ink);
}

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

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: oklch(98% 0.006 96);
  color: var(--ink);
  min-height: 36px;
  cursor: pointer;
  box-shadow: 0 1px 0 oklch(99% 0.004 96) inset;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

button:hover {
  border-color: oklch(70% 0.035 176);
  background: oklch(96% 0.014 176);
  box-shadow: 0 8px 18px oklch(45% 0.03 176 / 0.08);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid oklch(80% 0.075 176);
  outline-offset: 2px;
}

a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

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

h1 {
  font-size: 1.18rem;
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
  line-height: 1.25;
}

h3 {
  font-size: 0.84rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: oklch(78% 0.045 174);
}

.topbar h1 {
  color: oklch(98% 0.006 96);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 16px 24px;
  border-bottom: 1px solid oklch(35% 0.04 174);
  background: oklch(23% 0.045 174);
  color: oklch(97% 0.008 96);
}

.site-intake {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 12px;
  width: min(1380px, calc(100% - 40px));
  margin: 20px auto 0;
  padding: 14px;
  border: 1px solid oklch(82% 0.02 104);
  border-radius: var(--radius);
  background: oklch(99% 0.006 96);
  box-shadow: var(--shadow);
}

.site-intake label {
  color: var(--ink);
  font-size: 0.86rem;
}

.site-intake input {
  margin-top: 0;
  min-height: 44px;
  border-color: oklch(78% 0.025 174);
  font-size: 0.98rem;
}

.site-intake p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.go-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 8px;
}

.go-row button {
  white-space: nowrap;
}

.brand-lockup,
.topbar-actions,
.section-head,
.score-row,
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup {
  min-width: 230px;
}

.app-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 10px 24px oklch(13% 0.04 174 / 0.28);
}

.topbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.mini-button {
  font-weight: 700;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: oklch(98% 0.004 176);
  padding: 0 14px;
  box-shadow: 0 10px 24px oklch(34% 0.08 174 / 0.22);
}

.secondary-button {
  padding: 0 12px;
}

.topbar .secondary-button {
  border-color: oklch(52% 0.045 174);
  background: oklch(30% 0.045 174);
  color: oklch(96% 0.008 96);
}

.topbar .secondary-button:hover {
  background: oklch(35% 0.055 174);
}

.topbar .primary-button {
  border-color: oklch(77% 0.1 78);
  background: var(--gold);
  color: oklch(19% 0.02 78);
  box-shadow: 0 12px 24px oklch(14% 0.04 78 / 0.2);
}

.mini-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(310px, 24vw) minmax(360px, 0.78fr) minmax(430px, 1.05fr);
  gap: 16px;
  width: min(1380px, calc(100% - 40px));
  margin: 16px auto 28px;
  height: calc(100vh - 178px);
  min-height: 760px;
}

.panel,
.work-panel,
.report-panel {
  min-width: 0;
  overflow: auto;
}

.panel,
.report-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(98% 0.007 96);
  padding: 16px;
  box-shadow: 0 10px 28px oklch(43% 0.024 124 / 0.08);
}

.input-panel {
  border-right: 1px solid var(--line);
}

.report-panel {
  border-left: 1px solid var(--line);
}

.work-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(97.8% 0.007 96);
  padding: 16px;
  box-shadow: 0 10px 28px oklch(43% 0.024 124 / 0.08);
}

.panel-section,
.criteria-panel,
.recommendation-panel,
.score-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 1px 0 oklch(99% 0.004 96) inset;
}

.panel-section + .panel-section {
  margin-top: 14px;
}

.compact-section {
  padding-bottom: 10px;
}

.section-head,
.report-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.field-grid {
  display: grid;
  gap: 10px;
}

.privacy-note,
.confidence-panel p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.privacy-note {
  margin-top: 12px;
}

.utility-hidden {
  display: none;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(99.2% 0.004 96);
  color: var(--ink);
  padding: 9px 10px;
  margin-top: 6px;
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

.save-state {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  padding: 4px 8px;
  white-space: nowrap;
}

.score-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 18px;
  background:
    linear-gradient(135deg, oklch(99% 0.004 96), oklch(94.5% 0.026 174));
}

.score-row strong {
  font-size: 3.2rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.score-row span {
  color: var(--muted);
  font-weight: 750;
  align-self: flex-end;
  padding-bottom: 7px;
}

#scoreSummary {
  color: var(--muted);
  line-height: 1.45;
  max-width: 68ch;
}

.score-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, var(--soft-line) 0deg);
  position: relative;
  box-shadow: 0 8px 20px oklch(42% 0.045 174 / 0.12);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--panel);
}

.criteria-list {
  display: grid;
  gap: 10px;
}

.criterion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 10px;
  background: oklch(98% 0.004 86);
}

.criterion strong {
  display: block;
  font-size: 0.9rem;
}

.criterion p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 3px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.segmented button {
  min-height: 32px;
  padding: 0 6px;
  font-size: 0.74rem;
  font-weight: 750;
}

.segmented button[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.recommendation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 18px;
  align-items: start;
  border-color: oklch(78% 0.03 78);
  background: oklch(98.5% 0.012 78);
}

.recommendation-panel p {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 6px;
}

.next-actions {
  display: grid;
  gap: 8px;
}

.next-actions div {
  border: 1px solid oklch(84% 0.03 78);
  border-radius: var(--radius);
  background: oklch(99% 0.006 78);
  padding: 9px;
  font-size: 0.84rem;
  font-weight: 700;
}

.report-page {
  width: min(100%, 820px);
  min-height: 1040px;
  margin: 0 auto;
  border: 1px solid oklch(80% 0.018 96);
  border-radius: var(--radius);
  background: oklch(99% 0.004 86);
  padding: 30px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 18px;
  box-shadow: 0 22px 54px oklch(36% 0.026 124 / 0.16);
}

.report-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: start;
  gap: 18px;
  border-bottom: 1px solid oklch(80% 0.018 174);
  margin: -30px -30px 0;
  padding: 24px 30px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: oklch(95.5% 0.03 174);
}

.report-header p,
.report-footer {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.report-header h2 {
  font-size: 1.7rem;
  margin: 2px 0 4px;
}

.report-score {
  border: 1px solid oklch(72% 0.045 174);
  border-radius: var(--radius);
  background: oklch(99% 0.006 96);
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 10px 22px oklch(37% 0.03 174 / 0.1);
}

.report-score strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.report-score span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 750;
  margin-top: 4px;
}

.report-visual {
  min-height: 178px;
  border: 1px solid oklch(80% 0.025 174);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, oklch(92.5% 0.038 174), oklch(97% 0.018 78));
  overflow: hidden;
  display: grid;
  place-items: center;
}

.report-visual div {
  text-align: center;
}

.report-visual span,
.report-visual strong {
  display: block;
}

.report-visual span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.report-visual strong {
  margin-top: 4px;
}

.report-visual img {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
}

.report-visual[data-has-image="true"] div {
  display: none;
}

.report-visual[data-has-image="true"] img {
  display: block;
}

.report-section {
  border-top: 1px solid oklch(88% 0.012 96);
  padding-top: 15px;
}

.report-section p,
.report-section li {
  color: oklch(27% 0.015 86);
  line-height: 1.45;
}

.two-column-report {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.report-section ol,
.report-section ul {
  margin: 0;
  padding-left: 20px;
}

.report-section li + li {
  margin-top: 7px;
}

.report-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid oklch(76% 0.04 174);
  border-radius: var(--radius);
  background: oklch(93.5% 0.035 174);
  padding: 14px;
}

.report-cta p {
  color: var(--accent-dark);
  line-height: 1.4;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: oklch(98% 0.004 176);
  font-size: 0.86rem;
  font-weight: 750;
  padding: 0 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.primary-link:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  box-shadow: none;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 1180px) {
  .app-shell,
  .site-intake {
    grid-template-columns: 1fr;
    height: auto;
  }

  .app-shell,
  .site-intake {
    width: min(100% - 28px, 860px);
  }

  .input-panel,
  .report-panel {
    border: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar,
  .site-intake,
  .topbar-actions,
  .score-board,
  .criterion,
  .recommendation-panel,
  .report-header,
  .two-column-report,
  .report-cta {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-intake {
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: stretch;
    width: 100%;
  }

  .topbar-actions button {
    flex: 1 1 140px;
  }

  .report-page {
    min-height: auto;
    padding: 18px;
  }

  .report-header {
    margin: -18px -18px 0;
    padding: 18px;
  }
}

@media print {
  body {
    background: oklch(99% 0.004 86);
  }

  .topbar,
  .site-intake,
  .input-panel,
  .work-panel,
  .report-toolbar {
    display: none;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 0;
  }

  .report-panel {
    border: 0;
    padding: 0;
    background: oklch(99% 0.004 86);
    overflow: visible;
  }

  .report-page {
    width: 100%;
    min-height: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
}
