:root {
  --canvas: #f3f5f3;
  --surface: #ffffff;
  --surface-subtle: #f8f9f8;
  --ink: #171a17;
  --muted: #687169;
  --line: #d9dfda;
  --line-strong: #bdc8bf;
  --green: #176b4b;
  --green-dark: #0d4f36;
  --green-soft: #e6f2ec;
  --coral: #bd573b;
  --coral-soft: #f8ebe6;
  --blue: #315f87;
  --blue-soft: #e8f0f6;
  --yellow: #b17a0b;
  --yellow-soft: #fbf2dc;
  --shadow: 0 12px 36px rgba(23, 26, 23, 0.07);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 95, 135, 0.22);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 780;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.brand-mark svg,
.button svg,
.icon-button svg,
.input-with-icon svg,
.sample-control svg,
.input-note svg,
.profile-lists svg,
.evidence-block svg,
.tailored-heading svg,
.comparison-label svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.topbar-actions,
.system-status,
.button,
.sample-control,
.input-note,
.profile-lists h4,
.evidence-block h4,
.tailored-heading > span,
.comparison-label {
  display: inline-flex;
  align-items: center;
}

.topbar-actions {
  gap: 14px;
}

.system-status {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.system-status.ready .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

main {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 52px;
}

.workbench-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.workbench-heading h1 {
  max-width: 820px;
  margin: 0;
  font-size: 32px;
  font-weight: 740;
  line-height: 1.14;
}

.pilot-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 3px;
  color: var(--muted);
  white-space: nowrap;
}

.pilot-price strong {
  color: var(--ink);
  font-size: 21px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  min-height: 710px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}

.panel-heading,
.result-heading,
.dialog-heading,
.label-row,
.tailored-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading > div,
.result-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2,
.result-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}

.step-index {
  color: var(--green);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 750;
}

.sample-control {
  position: relative;
  gap: 5px;
  color: var(--blue);
}

.sample-control select {
  max-width: 150px;
  padding: 6px 24px 6px 3px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 680;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-grow {
  flex: 1;
}

.field label,
.label-row label {
  color: #343b35;
  font-size: 12px;
  font-weight: 700;
}

.field label span,
.label-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 190px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
}

textarea.textarea-compact {
  min-height: 74px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #a8b4aa;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 95, 135, 0.1);
  outline: 0;
}

::placeholder {
  color: #929b94;
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  top: 13px;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 36px;
}

.button {
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 720;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

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

.button-primary:hover {
  background: var(--green-dark);
}

.button-accent {
  background: var(--coral);
  color: white;
}

.button-accent:hover {
  background: #a8452d;
}

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

.button-dark:hover {
  background: #303630;
}

.button-quiet {
  min-height: 36px;
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.button-full {
  width: 100%;
  min-height: 46px;
}

.input-note {
  align-items: flex-start;
  gap: 6px;
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.input-note svg {
  margin-top: 1px;
  color: var(--green);
}

.form-error {
  min-height: 0;
  color: #a33e28;
  font-size: 12px;
  font-weight: 650;
}

.form-error:not(:empty) {
  padding: 9px 11px;
  border: 1px solid #e8c4b9;
  border-radius: 6px;
  background: var(--coral-soft);
}

.output-panel {
  position: relative;
  min-width: 0;
  background: white;
}

.empty-state,
.loading-state {
  display: flex;
  min-height: 710px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 48px;
  text-align: center;
}

.empty-state h2,
.loading-state h2 {
  margin: 4px 0 7px;
  font-size: 20px;
}

.empty-state > p:last-child,
.loading-state > p:last-child {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
}

.signal-visual {
  position: relative;
  display: grid;
  width: 132px;
  height: 112px;
  margin-bottom: 25px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.signal-visual svg {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  color: var(--green);
}

.signal-line {
  position: absolute;
  left: 18px;
  height: 6px;
  border-radius: 3px;
  background: #dce3de;
}

.signal-line-a {
  top: 20px;
  width: 67px;
}

.signal-line-b {
  right: 17px;
  bottom: 22px;
  left: auto;
  width: 54px;
  background: #edd9d3;
}

.signal-line-c {
  bottom: 39px;
  width: 28px;
  background: #d8e5ef;
}

.empty-kicker {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.loader {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 54px;
  margin-bottom: 24px;
}

.loader span {
  display: block;
  width: 7px;
  border-radius: 4px;
  background: var(--green);
  animation: meter 900ms ease-in-out infinite alternate;
}

.loader span:nth-child(1) {
  height: 24px;
}

.loader span:nth-child(2) {
  height: 46px;
  animation-delay: 160ms;
  background: var(--coral);
}

.loader span:nth-child(3) {
  height: 33px;
  animation-delay: 320ms;
  background: var(--blue);
}

@keyframes meter {
  to { transform: scaleY(0.45); }
}

.loading-track {
  width: min(360px, 80%);
  height: 5px;
  margin: 22px 0 13px;
  overflow: hidden;
  border-radius: 3px;
  background: #e4e8e5;
}

.loading-track span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  transition: width 700ms ease;
}

.results {
  min-height: 710px;
}

.profile-section,
.comparison-section {
  padding: 26px 30px;
}

.profile-section {
  border-bottom: 1px solid var(--line);
}

.confidence-block {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.confidence-block strong {
  color: var(--green);
  font-size: 18px;
}

.archetype-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 15px;
  margin: 24px 0 20px;
}

.archetype-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
}

.archetype-icon svg {
  width: 24px;
  height: 24px;
}

.archetype-row h3 {
  margin: 1px 0 3px;
  font-size: 20px;
}

.archetype-row p:last-child {
  max-width: 770px;
  margin: 0;
  color: var(--muted);
}

.dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dimension-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.dimension-labels strong {
  color: var(--ink);
  font-size: 11px;
}

.dimension-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8ece9;
}

.dimension-track span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
}

.dimension:nth-child(2) .dimension-track span,
.dimension:nth-child(5) .dimension-track span {
  background: var(--coral);
}

.dimension:nth-child(3) .dimension-track span,
.dimension:nth-child(6) .dimension-track span {
  background: var(--green);
}

.profile-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 18px 0 2px;
}

.profile-lists h4,
.evidence-block h4 {
  gap: 7px;
  margin: 0 0 9px;
  font-size: 12px;
}

.profile-lists > div:first-child h4 {
  color: var(--green);
}

.profile-lists > div:last-child h4 {
  color: var(--coral);
}

.profile-lists ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.profile-lists li {
  position: relative;
  padding-left: 13px;
}

.profile-lists li::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.evidence-block {
  margin-top: 18px;
  padding: 15px 17px;
  border-left: 3px solid var(--yellow);
  background: var(--yellow-soft);
}

.evidence-block h4 {
  color: #765207;
}

#evidence-list {
  display: grid;
  gap: 7px;
}

.evidence-quote {
  margin: 0;
  color: #5c5140;
  font-size: 12px;
}

.mode-badge {
  padding: 4px 8px;
  border: 1px solid #bfd0dc;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.generic-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  margin-top: 21px;
  padding: 15px 17px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.comparison-label {
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.generic-row p {
  margin: 0;
  color: #777e78;
}

.tailored-heading {
  margin: 22px 0 10px;
}

.tailored-heading > span {
  gap: 7px;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.tailored-heading > span svg {
  color: var(--green);
}

.tailored-heading small {
  color: var(--muted);
}

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

.opening-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.opening-card:hover {
  border-color: #a8b9ad;
  box-shadow: 0 5px 18px rgba(23, 26, 23, 0.06);
}

.opening-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-soft);
}

.opening-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 760;
}

.opening-text {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.42;
}

.opening-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  color: var(--muted);
  font-size: 11px;
}

.opening-angle {
  color: var(--blue);
  font-weight: 720;
}

.opening-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--green);
}

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

.conversion-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 30px;
  border-top: 1px solid #304238;
  background: #1b2720;
  color: white;
}

.conversion-band .eyebrow {
  color: #8dd2b0;
}

.conversion-band h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.conversion-band p:last-child {
  margin: 0;
  color: #b9c7be;
  font-size: 12px;
}

.conversion-actions {
  display: grid;
  flex: 0 0 175px;
  gap: 7px;
}

.text-button {
  padding: 3px;
  border: 0;
  background: transparent;
  color: #ccd7d0;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.validation-strip {
  display: grid;
  grid-template-columns: 145px 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.validation-strip > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.validation-number {
  color: var(--ink);
  font-size: 22px;
  font-weight: 780;
}

.plan-list {
  display: flex;
  justify-content: center;
  gap: 26px;
  color: var(--muted);
  font-size: 12px;
}

.plan-list strong {
  color: var(--ink);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 26px;
  color: var(--muted);
  font-size: 11px;
}

footer nav {
  display: flex;
  gap: 16px;
}

footer a {
  color: var(--muted);
  text-underline-offset: 3px;
}

.fazier-badge {
  display: inline-flex;
  height: 44px;
  line-height: 0;
}

.fazier-badge img {
  display: block;
  height: 44px;
  width: 103px;
}

.legal-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.legal-page h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.legal-page h2 {
  margin: 30px 0 8px;
  font-size: 17px;
}

.legal-page p,
.legal-page li {
  color: #4f5851;
  line-height: 1.7;
}

.legal-page .legal-meta {
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 12px;
}

.legal-page .legal-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  color: var(--green);
  font-weight: 700;
}

dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(23, 26, 23, 0.24);
}

dialog::backdrop {
  background: rgba(15, 20, 16, 0.62);
  backdrop-filter: blur(3px);
}

.pilot-form,
.pilot-success {
  padding: 27px;
}

.dialog-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.dialog-heading h2,
.pilot-success h2 {
  margin: 0;
  font-size: 22px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.dialog-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.pilot-success {
  min-height: 390px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.pilot-success:not(.hidden) {
  display: flex;
}

.pilot-success > p:not(.eyebrow) {
  margin: 8px 0 24px;
  color: var(--muted);
}

.success-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.success-icon svg {
  width: 26px;
  height: 26px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100% - 40px));
  padding: 11px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 30px rgba(23, 26, 23, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .workbench {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  }

  .dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .plan-list {
    gap: 13px;
  }
}

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

  .system-status {
    display: none;
  }

  main,
  footer {
    width: min(100% - 28px, 720px);
  }

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

  .workbench-heading h1 {
    font-size: 27px;
  }

  .workbench {
    display: block;
  }

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

  .empty-state,
  .loading-state {
    min-height: 500px;
  }

  .results {
    min-height: 0;
  }

  .validation-strip {
    grid-template-columns: 1fr auto;
  }

  .plan-list {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .topbar-actions .button-quiet {
    width: 36px;
    padding: 0;
    font-size: 0;
  }

  .workbench-heading h1 {
    font-size: 24px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .sample-control select {
    max-width: 124px;
  }

  .input-panel,
  .profile-section,
  .comparison-section {
    padding: 20px;
  }

  .dimensions,
  .profile-lists,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .confidence-block {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: right;
  }

  .opening-card {
    grid-template-columns: 32px 1fr;
  }

  .opening-actions {
    grid-column: 2;
  }

  .conversion-band {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 20px;
  }

  .conversion-actions {
    flex-basis: auto;
  }

  .validation-strip {
    grid-template-columns: 1fr;
  }

  .plan-list {
    grid-column: auto;
    grid-row: auto;
    flex-direction: column;
    gap: 5px;
  }

  footer {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }

  footer nav {
    order: 3;
  }
}

@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;
  }
}
