:root {
  color-scheme: light;
  --ink-950: #131826;
  --ink-900: #171c28;
  --ink-800: #22283a;
  --ink-700: #2e3852;
  --ink-600: #44506c;
  --signal-600: #66b9c8;
  --signal-500: #8fd5df;
  --signal-400: #b8eaf0;
  --convert-600: #da7f2e;
  --convert-500: #f29b54;
  --success-500: #19b37d;
  --warning-500: #e9a23b;
  --alert-500: #e15d5d;
  --surface-0: #ffffff;
  --surface-50: #f3f5f8;
  --surface-100: #e7ecf2;
  --border-200: #d5dce6;
  --text-muted: #657087;
  --shadow: 0 18px 50px rgba(19, 24, 38, 0.1);
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-50);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-800);
  background: var(--surface-50);
}

button,
select,
textarea {
  font: inherit;
}

button,
a,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  border: 0;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.app-header,
.intro,
.model-strip,
.workbench,
.method-band,
.site-footer {
  width: min(1240px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.app-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-900);
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-links a,
.method-band a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.header-links a {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink-600);
  border-radius: 6px;
}

.header-links a:hover,
.header-links a:focus-visible {
  color: var(--ink-900);
  background: var(--surface-100);
}

.header-links .header-guide {
  color: var(--surface-0);
  background: var(--ink-800);
}

.header-links .header-guide:hover,
.header-links .header-guide:focus-visible {
  color: var(--surface-0);
  background: var(--ink-700);
}

main {
  padding-bottom: 52px;
}

.intro {
  min-height: 320px;
  padding: 62px 0 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 64px;
  border-top: 1px solid var(--border-200);
}

.eyebrow,
.workspace-kicker {
  display: block;
  margin: 0 0 10px;
  color: var(--signal-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
}

.intro-summary {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--ink-600);
  font-size: 17px;
  line-height: 1.65;
}

.intro-facts {
  margin: 0 0 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  border-top: 1px solid var(--border-200);
  border-bottom: 1px solid var(--border-200);
}

.intro-facts div {
  min-width: 112px;
  padding: 18px 20px;
  border-left: 1px solid var(--border-200);
}

.intro-facts div:last-child {
  border-right: 1px solid var(--border-200);
}

.intro-facts dt {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-facts dd {
  margin: 0;
  color: var(--ink-800);
  font-size: 14px;
  font-weight: 750;
}

.model-strip {
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--surface-0);
  background: var(--ink-900);
  border-radius: 8px 8px 0 0;
}

.model-status-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-light {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: var(--warning-500);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(233, 162, 59, 0.11);
}

.model-strip[data-state="ready"] .status-light {
  background: var(--success-500);
  box-shadow: 0 0 0 5px rgba(25, 179, 125, 0.12);
}

.model-strip[data-state="error"] .status-light {
  background: var(--alert-500);
  box-shadow: 0 0 0 5px rgba(225, 93, 93, 0.12);
}

.model-status-copy div {
  min-width: 0;
}

.model-status-copy strong,
.model-status-copy span {
  display: block;
}

.model-status-copy strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.model-status-copy span {
  overflow: hidden;
  color: #aeb8ca;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-progress-wrap {
  min-width: 250px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.model-progress {
  width: 150px;
  height: 5px;
  overflow: hidden;
  background: #333b4e;
  border-radius: 3px;
}

.model-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal-500);
  border-radius: inherit;
  transition: width 240ms ease;
}

.model-progress-wrap > span {
  width: 52px;
  color: #c9d1dd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.retry-button {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--surface-0);
  background: var(--ink-700);
  border: 1px solid var(--ink-600);
  border-radius: 5px;
  cursor: pointer;
}

.retry-button svg {
  width: 15px;
  height: 15px;
}

.workbench {
  overflow: hidden;
  background: var(--surface-0);
  border: 1px solid var(--border-200);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.workspace-heading {
  min-height: 86px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border-200);
}

.workspace-heading h2,
.inspector h2,
.method-band h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0;
}

.workspace-kicker {
  margin-bottom: 5px;
}

.privacy-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #0d7656;
  font-size: 12px;
  font-weight: 750;
}

.privacy-state svg {
  width: 17px;
  height: 17px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
}

.composer,
.inspector {
  min-width: 0;
  padding: 28px;
}

.composer {
  border-right: 1px solid var(--border-200);
}

.field-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.field-heading label,
.example-row > label {
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 800;
}

.field-heading span {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

textarea {
  width: 100%;
  min-height: 214px;
  resize: vertical;
  padding: 18px;
  color: var(--ink-900);
  background: #fbfcfd;
  border: 1px solid var(--border-200);
  border-radius: 6px;
  outline: none;
  font-size: 15px;
  line-height: 1.65;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea::placeholder {
  color: #929caf;
}

textarea:hover {
  border-color: #b8c1cf;
}

textarea:focus {
  background: var(--surface-0);
  border-color: var(--signal-600);
  box-shadow: 0 0 0 3px rgba(102, 185, 200, 0.16);
}

.input-feedback {
  min-height: 19px;
  margin: 6px 0 4px;
  color: #b63d3d;
  font-size: 11px;
}

.example-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 12px;
  color: var(--ink-700);
  background: var(--surface-0);
  border: 1px solid var(--border-200);
  border-radius: 6px;
  outline: none;
  appearance: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.select-wrap select:focus {
  border-color: var(--signal-600);
  box-shadow: 0 0 0 3px rgba(102, 185, 200, 0.14);
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  color: var(--ink-600);
  pointer-events: none;
  transform: translateY(-50%);
}

.composer-actions {
  margin-top: 18px;
  display: flex;
  gap: 9px;
}

.analyze-button,
.clear-button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.analyze-button {
  min-width: 176px;
  padding: 0 18px;
  gap: 9px;
  color: var(--ink-950);
  background: var(--convert-500);
  font-size: 13px;
  font-weight: 800;
}

.analyze-button:hover {
  background: #f5a769;
}

.analyze-button:active,
.clear-button:active {
  transform: translateY(1px);
}

.analyze-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.analyze-button.is-loading svg {
  animation: spin 900ms linear infinite;
}

.clear-button {
  width: 44px;
  color: var(--ink-600);
  background: var(--surface-50);
  border: 1px solid var(--border-200);
}

.clear-button:hover {
  color: var(--ink-900);
  background: var(--surface-100);
}

.privacy-note {
  margin: 20px 0 0;
  padding-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-100);
  font-size: 11px;
  line-height: 1.55;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--signal-600);
}

.inspector {
  min-height: 510px;
  background: #fafbfd;
}

.inspector-empty {
  min-height: 454px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-signal {
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  color: var(--signal-600);
  background: #e9f7f9;
  border: 1px solid var(--signal-400);
  border-radius: 50%;
}

.empty-signal svg {
  width: 25px;
  height: 25px;
}

.inspector-empty > span {
  margin-bottom: 7px;
  color: var(--signal-600);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector-empty p {
  max-width: 370px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.inspector-result {
  animation: result-in 360ms ease both;
}

.decision-heading {
  padding-bottom: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border-200);
}

.decision-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
}

.match-score {
  margin-bottom: 3px;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.route-line {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-200);
}

.route-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink-800);
  background: var(--signal-400);
  border-radius: 6px;
}

.route-icon svg {
  width: 19px;
  height: 19px;
}

.route-line div span,
.closest-pattern > span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.route-line div strong {
  color: var(--ink-900);
  font-size: 14px;
}

.route-arrow {
  color: #96a0b2;
}

.review-state {
  margin: 18px 0;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #0c6d50;
  background: #eaf8f3;
  border-left: 3px solid var(--success-500);
  border-radius: 0 5px 5px 0;
}

.review-state[data-review="true"] {
  color: #8a5b0e;
  background: #fff7e8;
  border-left-color: var(--warning-500);
}

.review-state svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.review-state strong,
.review-state span {
  display: block;
}

.review-state strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.review-state span {
  font-size: 11px;
  line-height: 1.45;
}

.closest-pattern {
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--border-200);
}

.closest-pattern p {
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
  font-style: italic;
  line-height: 1.55;
}

.score-section {
  padding-top: 19px;
}

.score-heading {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-heading h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 12px;
}

.score-heading span {
  color: var(--text-muted);
  font-size: 10px;
}

.score-list {
  display: grid;
  gap: 11px;
}

.score-item {
  display: grid;
  grid-template-columns: 104px minmax(80px, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.score-item strong,
.score-item span {
  font-size: 11px;
}

.score-item strong {
  overflow: hidden;
  color: var(--ink-700);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-item > span {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.score-track {
  height: 7px;
  overflow: hidden;
  background: var(--surface-100);
  border-radius: 4px;
}

.score-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal-600);
  border-radius: inherit;
  transition: width 620ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.score-item.is-top strong {
  color: var(--ink-950);
}

.score-item.is-top .score-track i {
  background: var(--convert-500);
}

.score-item.is-top > span {
  color: var(--ink-800);
  font-weight: 800;
}

.method-band {
  margin-top: 28px;
  padding: 30px 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr) auto;
  align-items: center;
  gap: 42px;
  border-top: 1px solid var(--border-200);
  border-bottom: 1px solid var(--border-200);
}

.method-band p {
  margin: 0;
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.65;
}

.method-band a {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink-800);
  border: 1px solid var(--border-200);
  border-radius: 6px;
  white-space: nowrap;
}

.method-band a:hover,
.method-band a:focus-visible {
  background: var(--surface-100);
  border-color: #b7c1cf;
}

.site-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-muted);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink-600);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink-900);
}

:focus-visible {
  outline: 3px solid rgba(102, 185, 200, 0.35);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .intro-facts {
    width: 100%;
  }

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

  .composer {
    border-right: 0;
    border-bottom: 1px solid var(--border-200);
  }

  .method-band {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .method-band a {
    justify-self: start;
  }
}

@media (max-width: 680px) {
  .app-header,
  .intro,
  .model-strip,
  .workbench,
  .method-band,
  .site-footer {
    width: min(100% - 28px, 1240px);
  }

  .app-header {
    min-height: 68px;
  }

  .header-links a:first-child {
    display: none;
  }

  .header-links .header-guide {
    min-height: 36px;
    padding: 0 11px;
    font-size: 11px;
  }

  .brand {
    gap: 8px;
    font-size: 14px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .intro {
    min-height: 0;
    padding: 42px 0 38px;
  }

  .intro h1 {
    font-size: 36px;
  }

  .intro-summary {
    font-size: 15px;
  }

  .intro-facts {
    grid-template-columns: 1fr;
  }

  .intro-facts div,
  .intro-facts div:last-child {
    min-width: 0;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 1px solid var(--border-200);
    border-bottom: 1px solid var(--border-200);
  }

  .intro-facts div:last-child {
    border-bottom: 0;
  }

  .intro-facts dt {
    margin: 0;
  }

  .model-strip {
    padding: 14px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .model-status-copy span {
    white-space: normal;
  }

  .model-progress-wrap {
    width: 100%;
    min-width: 0;
  }

  .model-progress {
    width: auto;
    flex: 1;
  }

  .workspace-heading {
    padding: 18px;
  }

  .workspace-heading h2 {
    font-size: 17px;
  }

  .privacy-state {
    font-size: 0;
  }

  .privacy-state svg {
    width: 19px;
    height: 19px;
  }

  .composer,
  .inspector {
    padding: 20px 18px;
  }

  .example-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .decision-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .score-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .score-item {
    grid-template-columns: 82px minmax(70px, 1fr) 40px;
    gap: 8px;
  }

  .site-footer {
    padding: 20px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 390px) {
  .intro h1 {
    font-size: 32px;
  }

  .header-guide svg {
    display: none;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .analyze-button {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

