.triage-overline {
  margin: 0 0 8px;
  color: var(--wine-800);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.triage-primary,
.triage-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 17px;
  border-radius: 6px;
  font-weight: 900;
}

.triage-primary {
  color: var(--wine-950);
  background: var(--gold-500);
  border: 1px solid #e5ae14;
  box-shadow: 0 8px 18px rgba(101, 8, 0, .12);
}

.triage-primary:hover { background: var(--gold-300); }
.triage-primary:focus-visible,
.triage-text-button:focus-visible,
.triage-choice:has(input:focus-visible) {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}

.triage-text-button {
  color: var(--wine-800);
  background: transparent;
  border: 1px solid var(--cream-300);
}

.triage-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--cream-300);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.triage-intro-main {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(30px, 6vw, 76px);
  background:
    linear-gradient(135deg, rgba(255, 204, 61, .1), transparent 44%),
    linear-gradient(180deg, #fffdf8, #fff8e7);
}

.triage-intro-main h2,
.triage-game-header h2,
.triage-results-hero h2 {
  margin: 0;
  color: var(--wine-950);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: .98;
  letter-spacing: -.035em;
}

.triage-intro-main > p:not(.triage-overline) {
  max-width: 690px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.triage-how {
  display: grid;
  align-content: center;
  padding: 40px;
  color: #fff8dc;
  background: linear-gradient(155deg, var(--wine-800), var(--wine-950));
}

.triage-how h3 { margin: 0 0 25px; color: var(--gold-300); font-size: 1.35rem; }
.triage-how ol { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.triage-how li { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 13px; line-height: 1.45; }
.triage-how li span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--wine-950);
  background: var(--gold-500);
  border-radius: 50%;
  font-weight: 900;
}
.triage-how > p {
  display: flex;
  gap: 10px;
  margin: 32px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 224, 138, .28);
  color: #f4dca7;
  font-size: .85rem;
  line-height: 1.5;
}
.triage-how > p i { color: var(--gold-500); font-size: 1.25rem; }

.triage-game,
.triage-results {
  overflow: hidden;
  border: 1px solid var(--cream-300);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.triage-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--cream-300);
}
.triage-game-header h2 { font-size: clamp(1.75rem, 3vw, 2.75rem); }

.triage-case-progress {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 16px 28px;
  color: var(--wine-950);
  background: #fbefd1;
  border-bottom: 1px solid var(--cream-300);
}
.triage-case-progress > strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1.08rem; }
.triage-case-progress > em { color: var(--muted); font-size: .8rem; font-style: normal; font-weight: 800; }
.triage-case-progress > div { display: flex; align-items: center; justify-content: center; }
.triage-case-progress > div span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid #d6bb7b;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 900;
}
.triage-case-progress > div span + span { margin-left: clamp(14px, 3vw, 42px); }
.triage-case-progress > div span + span::before {
  position: absolute;
  top: 50%;
  right: 100%;
  width: clamp(14px, 3vw, 42px);
  height: 1px;
  background: #d6bb7b;
  content: '';
}
.triage-case-progress span.is-current { color: var(--wine-950); background: var(--gold-500); border-color: #e5ae14; }
.triage-case-progress span.is-complete { color: #fff; background: var(--wine-800); border-color: var(--wine-800); }

.triage-workspace {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr);
  align-items: start;
  gap: 20px;
  padding: 22px;
}

.triage-case-card,
.triage-decision {
  border: 1px solid #e2cb94;
  border-radius: 8px;
  background: #fffdf7;
}
.triage-case-card { padding: 22px; }
.triage-case-card > header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.triage-case-card > header span { color: var(--wine-800); font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.triage-case-card > header h3 { margin: 4px 0 0; color: var(--wine-950); font-family: Georgia, 'Times New Roman', serif; font-size: 1.5rem; }
.triage-case-card > header > strong { color: var(--muted); font-size: .85rem; }
.triage-context { margin: 18px 0 0; color: var(--muted); line-height: 1.55; }
.triage-case-card blockquote {
  margin: 18px 0 22px;
  padding: 14px 16px;
  color: var(--wine-900);
  background: #fff4d7;
  border-left: 4px solid var(--gold-500);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.5;
}
.triage-case-card h4 { margin: 0 0 8px; color: var(--wine-950); }
.triage-score-list { border-top: 1px solid #eadab4; }
.triage-score-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 42px minmax(100px, auto);
  align-items: center;
  gap: 10px;
  min-height: 55px;
  border-bottom: 1px solid #eadab4;
}
.triage-score-row span { display: grid; }
.triage-score-row small { color: var(--muted); font-size: .67rem; font-weight: 900; }
.triage-score-row strong { color: var(--wine-950); font-size: .86rem; }
.triage-score-row b { color: var(--wine-950); font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; }
.triage-score-row em { justify-self: end; color: var(--muted); font-size: .72rem; font-style: normal; font-weight: 900; }
.triage-score-row em.is-high { color: #9e251b; }
.triage-score-row em.is-watch { color: #9a6100; }
.triage-score-row em.is-positive { color: #3e681e; }

.triage-caution {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  margin-top: 18px;
  padding: 13px;
  color: var(--muted);
  background: #f8edcf;
  border-radius: 6px;
}
.triage-caution i { color: var(--wine-800); font-size: 1.25rem; }
.triage-caution p { margin: 0; font-size: .78rem; line-height: 1.45; }
.triage-caution strong { display: block; margin-bottom: 3px; color: var(--wine-900); }

.triage-decision { padding: 22px; }
.triage-decision-heading { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid #eadab4; }
.triage-decision-heading span { color: var(--wine-950); font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; font-weight: 900; }
.triage-decision-heading strong { color: var(--muted); font-size: .75rem; }
.triage-choice-group { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.triage-choice-group legend { display: grid; width: 100%; margin-bottom: 10px; }
.triage-choice-group legend span { color: var(--wine-950); font-size: 1rem; font-weight: 900; }
.triage-choice-group legend small { margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.triage-choices { display: grid; gap: 8px; }
.triage-choice {
  display: grid;
  grid-template-columns: 1fr 22px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fffdfa;
  border: 1px solid #dfc991;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.triage-choice:hover { border-color: #c78a16; transform: translateY(-1px); }
.triage-choice.is-selected { background: #fff3cf; border-color: #d99a12; box-shadow: inset 3px 0 var(--gold-500); }
.triage-choice.is-correct { background: #edf7e5; border-color: #639443; box-shadow: inset 3px 0 #639443; }
.triage-choice.is-wrong { background: #fff0ed; border-color: #b84a3f; box-shadow: inset 3px 0 #b84a3f; }
.triage-choice input { position: absolute; opacity: 0; pointer-events: none; }
.triage-choice > span { display: grid; }
.triage-choice strong { color: var(--wine-950); font-size: .85rem; line-height: 1.35; }
.triage-choice small { margin-top: 3px; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.triage-choice > i { color: #ac8d5b; font-size: 1.2rem; }
.triage-choice.is-selected > i { color: var(--wine-800); }
.triage-choice.is-correct > i { color: #507b34; }

.triage-form-feedback { display: none; margin-top: 18px; padding: 14px 16px; border: 1px solid #d9bb70; border-radius: 6px; background: #fff6dc; }
.triage-form-feedback.is-visible { display: block; }
.triage-form-feedback strong { color: var(--wine-900); }
.triage-form-feedback p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.triage-form-error { min-height: 18px; margin: 12px 0 0; color: #a3251c; font-size: .8rem; font-weight: 900; }
.triage-form-actions { display: flex; justify-content: flex-end; margin-top: 5px; }

.triage-competencies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 18px 28px 22px;
  border-top: 1px solid var(--cream-300);
  background: #fbefd1;
}
.triage-competencies > div + div { padding-left: 28px; border-left: 1px solid #d8bd7e; }
.triage-competencies p { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; color: var(--wine-950); font-size: .78rem; }
.triage-competencies p span { color: var(--muted); }
.triage-meter,
.triage-result-bar { display: block; height: 7px; overflow: hidden; background: #e6d6ad; border-radius: 99px; }
.triage-meter i,
.triage-result-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--wine-800), var(--gold-500)); border-radius: inherit; transition: width .3s ease; }

.triage-results { padding: clamp(24px, 4vw, 48px); }
.triage-results-hero { display: flex; align-items: center; gap: 30px; padding-bottom: 32px; border-bottom: 1px solid var(--cream-300); }
.triage-results-hero h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
.triage-results-hero > div > p:last-child { margin: 10px 0 0; color: var(--muted); }
.triage-result-ring {
  --result: 0;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold-500) calc(var(--result) * 1%), #eadcb6 0);
}
.triage-result-ring::before { position: absolute; width: 94px; height: 94px; border-radius: 50%; background: var(--paper); content: ''; }
.triage-result-ring span { position: relative; z-index: 1; display: grid; text-align: center; }
.triage-result-ring strong { color: var(--wine-950); font-size: 1.8rem; }
.triage-result-ring small { color: var(--muted); }
.triage-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 24px; }
.triage-result-grid article { padding: 17px; border: 1px solid #e2cb94; border-radius: 7px; background: #fffdf7; }
.triage-result-grid article > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--wine-950); }
.triage-result-grid article p { margin: 11px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.triage-review-list { margin-top: 30px; }
.triage-review-list h3 { color: var(--wine-950); font-family: Georgia, 'Times New Roman', serif; font-size: 1.45rem; }
.triage-review-list details { border-top: 1px solid #dfc991; }
.triage-review-list details:last-child { border-bottom: 1px solid #dfc991; }
.triage-review-list summary { display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 15px; padding: 15px 3px; color: var(--wine-950); cursor: pointer; }
.triage-review-list summary::-webkit-details-marker { display: none; }
.triage-review-list summary strong { color: var(--muted); font-size: .8rem; }
.triage-review-list details[open] summary i { transform: rotate(180deg); }
.triage-review-list details p { margin: 0; padding: 0 3px 17px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.triage-results-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.triage-disclaimer { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--cream-300); color: var(--muted); font-size: .76rem; }

@media (prefers-reduced-motion: reduce) {
  .triage-choice,
  .triage-meter i,
  .triage-result-bar i { transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 1100px) {
  .triage-workspace { grid-template-columns: 1fr; }
  .triage-case-card { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(330px, 1.25fr); gap: 0 24px; }
  .triage-case-card > header,
  .triage-case-card > .triage-context,
  .triage-case-card > blockquote,
  .triage-case-card > .triage-caution { grid-column: 1; }
  .triage-case-card > h4,
  .triage-case-card > .triage-score-list { grid-column: 2; }
  .triage-case-card > h4 { grid-row: 1; align-self: end; margin-bottom: 10px; }
  .triage-case-card > .triage-score-list { grid-row: 2 / span 5; }
}

@media (max-width: 760px) {
  .triage-intro { grid-template-columns: 1fr; }
  .triage-intro-main { padding: 34px 24px; }
  .triage-how { padding: 30px 24px; }
  .triage-game-header { align-items: flex-start; padding: 20px; }
  .triage-text-button { min-height: 40px; padding: 8px 10px; font-size: .75rem; }
  .triage-case-progress { grid-template-columns: 1fr; gap: 12px; padding: 14px 20px; }
  .triage-case-progress > div { justify-content: flex-start; overflow-x: auto; padding: 2px; }
  .triage-case-progress > em { display: none; }
  .triage-workspace { padding: 12px; }
  .triage-case-card { display: block; padding: 18px; }
  .triage-decision { padding: 18px; }
  .triage-score-row { grid-template-columns: minmax(110px, 1fr) 36px minmax(82px, auto); }
  .triage-competencies,
  .triage-result-grid { grid-template-columns: 1fr; }
  .triage-competencies { gap: 14px; padding: 18px 20px; }
  .triage-competencies > div + div { padding: 14px 0 0; border-top: 1px solid #d8bd7e; border-left: 0; }
  .triage-results { padding: 24px 18px; }
  .triage-results-hero { align-items: flex-start; gap: 18px; }
  .triage-result-ring { width: 96px; height: 96px; }
  .triage-result-ring::before { width: 72px; height: 72px; }
  .triage-result-ring strong { font-size: 1.35rem; }
}

@media (max-width: 430px) {
  .triage-game-header h2 { font-size: 1.6rem; }
  .triage-game-header .triage-overline { font-size: .62rem; }
  .triage-text-button { width: 42px; padding: 0; font-size: 0; }
  .triage-text-button i { font-size: 1rem; }
  .triage-case-progress > div span + span { margin-left: 12px; }
  .triage-case-progress > div span + span::before { width: 12px; }
  .triage-case-card > header { display: grid; }
  .triage-score-row { grid-template-columns: minmax(105px, 1fr) 34px 82px; gap: 7px; }
  .triage-score-row em { font-size: .65rem; text-align: right; }
  .triage-results-hero { display: grid; }
}
