:root {
  --ink: #17202a;
  --muted: #68737d;
  --soft: #f4f6f7;
  --line: #dfe4e7;
  --paper: #ffffff;
  --brand: #e9531d;
  --brand-dark: #b6380c;
  --navy: #17334d;
  --green: #157a55;
  --amber: #a96206;
  --red: #b43332;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(233, 83, 29, 0.07), transparent 24rem),
    #f7f8f8;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-header {
  height: 74px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--navy);
  border-bottom: 4px solid var(--brand);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--brand);
  font-size: 25px;
  font-weight: 900;
  font-style: italic;
}
.brand strong { display: block; letter-spacing: 0.13em; font-size: 17px; }
.brand span { display: block; color: #c9d4dd; font-size: 12px; }
.header-meta { display: flex; align-items: center; gap: 8px; color: #dce5eb; font-size: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #51d39a; box-shadow: 0 0 0 4px rgba(81, 211, 154, .13); }

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
}

.workspace, .case-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.workspace { padding: 42px 48px 48px; min-height: 710px; }
.case-panel { padding: 28px; align-self: start; position: sticky; top: 24px; }

.eyebrow { margin: 0 0 8px; color: var(--brand-dark); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.intro h1 { margin: 0; font-size: clamp(30px, 3vw, 43px); line-height: 1.1; letter-spacing: -.035em; }
.intro > p:last-child { max-width: 680px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.progress { display: flex; align-items: center; margin: 36px 0 40px; }
.progress-step { display: flex; align-items: center; gap: 8px; color: #9aa3aa; white-space: nowrap; }
.progress-step span { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #cfd5d9; border-radius: 50%; font-size: 12px; }
.progress-step strong { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.progress-step.is-active { color: var(--navy); }
.progress-step.is-active span { color: white; border-color: var(--brand); background: var(--brand); }
.progress-step.is-complete span { color: white; border-color: var(--green); background: var(--green); }
.progress-line { flex: 1; height: 2px; min-width: 20px; margin: 0 11px; background: var(--line); }

.decision-panel { min-height: 400px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.section-heading p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.choice-card {
  min-height: 105px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.choice-card:hover, .choice-card:focus-visible { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23, 32, 42, .08); outline: none; }
.choice-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #fff0e9; color: var(--brand-dark); font-size: 24px; }
.choice-card strong { display: block; font-size: 16px; }
.choice-card small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.choice-card[disabled] { cursor: not-allowed; opacity: .45; }

.catalog-search { max-width: 800px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfc; }
.catalog-search > label { display: block; margin-bottom: 9px; color: var(--navy); font-size: 13px; font-weight: 800; }
.catalog-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.catalog-control input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #c9d1d6; border-radius: 9px; background: white; color: var(--ink); }
.catalog-control input:focus { border-color: var(--brand); outline: 3px solid rgba(233, 83, 29, .12); }
.catalog-help { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.catalog-selection { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--green); border-radius: 8px; background: #eef9f4; }
.catalog-selection strong, .catalog-selection span { display: block; }
.catalog-selection strong { color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.catalog-selection span { margin-top: 4px; color: #34434b; font-size: 13px; }

.question-box { max-width: 720px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfc; }
.question-count { color: var(--brand-dark); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.question-box h2 { margin: 8px 0 10px; font-size: 25px; line-height: 1.3; }
.question-box > p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.answer-buttons { display: grid; gap: 10px; }
.answer-button {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #cfd6da;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  text-align: left;
}
.answer-button:hover, .answer-button:focus-visible { border-color: var(--brand); background: #fff8f5; outline: none; }
.answer-button::after { content: "→"; color: var(--brand); font-weight: 900; }

.result-card { max-width: 760px; padding: 30px; border-radius: 16px; border: 1px solid var(--line); border-left: 6px solid var(--navy); background: white; }
.result-card.result-resolved { border-left-color: var(--green); }
.result-card.result-sat { border-left-color: var(--red); }
.result-card.result-review { border-left-color: var(--amber); }
.result-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.result-card h2 { margin: 8px 0 14px; font-size: 28px; }
.result-card .result-text { color: #39444d; line-height: 1.65; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.primary-button, .secondary-button, .text-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9px;
  font-weight: 750;
}
.primary-button { border: 1px solid var(--brand); color: white; background: var(--brand); }
.primary-button:hover { background: var(--brand-dark); }
.secondary-button { width: 100%; border: 1px solid var(--navy); color: var(--navy); background: white; }
.secondary-button:disabled { border-color: #cfd5d9; color: #9aa3aa; cursor: not-allowed; }
.text-button { border: 0; color: var(--navy); background: transparent; }

.case-heading { display: flex; align-items: center; justify-content: space-between; }
.case-heading h2 { margin: 0; font-size: 25px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: white; font-size: 21px; }
.case-summary { margin: 24px 0; }
.case-summary div { padding: 13px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf0f2; }
.case-summary dt { color: var(--muted); font-size: 13px; }
.case-summary dd { margin: 0; text-align: right; font-size: 13px; font-weight: 700; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge-neutral { color: #5f6870; background: #edf0f2; }
.badge-active { color: #8a4d00; background: #fff1d8; }
.badge-resolved { color: #0e6746; background: #dff5eb; }
.badge-sat { color: #912523; background: #fde8e7; }

.case-data { display: grid; gap: 12px; margin: 20px 0; }
.case-data label { color: var(--muted); font-size: 12px; font-weight: 700; }
.case-data input { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #ccd3d7; border-radius: 8px; color: var(--ink); background: white; }
.case-data input:focus { border-color: var(--brand); outline: 3px solid rgba(233, 83, 29, .12); }

.answer-log { margin: 22px 0; }
.answer-log h3 { margin: 0 0 10px; font-size: 13px; }
.answer-log ol { margin: 0; padding-left: 20px; color: #505b64; font-size: 12px; line-height: 1.55; }
.answer-log li + li { margin-top: 6px; }
.privacy-note { margin: 24px 0 18px; padding: 14px; display: flex; gap: 10px; border-radius: 10px; color: #53606a; background: var(--soft); }
.privacy-note p { margin: 0; font-size: 12px; line-height: 1.45; }

.toast { position: fixed; right: 28px; bottom: 28px; padding: 13px 18px; border-radius: 10px; color: white; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; padding: 22px; }
  .case-panel { position: static; }
}

@media (max-width: 680px) {
  .app-header { padding: 0 18px; }
  .header-meta { display: none; }
  .workspace { padding: 28px 20px; }
  .choice-grid { grid-template-columns: 1fr; }
  .catalog-control { grid-template-columns: 1fr; }
  .progress-step strong { display: none; }
  .progress-line { margin: 0 7px; }
}
