/* Live feasibility card (/product#feasibility).
   Same shape as the console: pick a protocol, then read How many / Where / Who, with a
   sponsor / practice switch that changes what is allowed to be shown. The card recomputes
   from the snapshot in js/feasibility-data.js the moment the protocol changes. */

.fc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- top bar: protocol switcher + view toggle ---------- */

.fc__bar {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  background: var(--lavender-soft);
  border-bottom: 1px solid var(--line);
}
.fc__barlabel {
  font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.fc__switch { display: flex; flex-wrap: wrap; gap: 8px; }
.fc__protocol {
  border: 1px solid var(--line-strong); background: #fff; color: var(--navy);
  border-radius: var(--radius-pill); padding: 9px 16px; cursor: pointer;
  font-size: .92rem; font-weight: 600; line-height: 1.15; text-align: left;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease),
              transform .2s var(--ease);
}
.fc__protocol:hover { border-color: var(--violet); transform: translateY(-1px); }
.fc__protocol small { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; }
.fc__protocol[aria-pressed="true"] {
  background: var(--gradient); color: #fff; border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(90, 91, 192, .9);
}
.fc__protocol[aria-pressed="true"] small { color: rgba(255, 255, 255, .82); }

.fc__view { display: flex; gap: 3px; background: #fff; border: 1px solid var(--line-strong);
            border-radius: var(--radius-pill); padding: 4px; }
.fc__view button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-pill); padding: 8px 15px; font-size: .88rem; font-weight: 700;
  white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease);
}
.fc__view button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ---------- protocol summary line ---------- */

.fc__meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: baseline;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.fc__meta h3 { font-size: 1.15rem; }
.fc__meta .fc__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fc__tag {
  font-size: .78rem; font-weight: 700; color: var(--violet);
  background: var(--lavender); border-radius: var(--radius-pill); padding: 5px 12px;
}

/* ---------- the three panels ---------- */

.fc__panels {
  display: grid; grid-template-columns: .82fr 1fr 1.3fr;
}
.fc__panel { padding: 26px 24px 28px; border-right: 1px solid var(--line); min-width: 0; }
.fc__panel:last-child { border-right: 0; }
.fc__panel > h4 {
  font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--purple); margin: 0 0 4px;
}
.fc__panel > .fc__sub { font-size: .93rem; color: var(--muted); margin-bottom: 20px; }

/* Panel content fades on recompute so a protocol switch reads as a change, not a redraw. */
.fc__body { transition: opacity .28s var(--ease), transform .28s var(--ease); }
.fc.is-recomputing .fc__body { opacity: .25; transform: translateY(5px); }

/* How many */
.fc__big {
  font-size: clamp(3.4rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.05em; line-height: .95;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fc__biglabel { font-size: .98rem; font-weight: 700; color: var(--navy); margin-top: 4px; }
.fc__stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 22px 0 14px;
             background: #EEF0F7; }
.fc__stack i { display: block; height: 100%; transition: width .5s var(--ease); }
.fc__legend { display: grid; gap: 9px; }
.fc__legrow { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--muted); }
.fc__legrow i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.fc__legrow b { color: var(--navy); font-variant-numeric: tabular-nums; margin-left: auto; }
.fc__footnote { margin-top: 18px; font-size: .85rem; color: var(--muted); }

/* Where */
.fc__minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.fc__mini {
  background: var(--lavender-soft); border-radius: 14px; padding: 12px 13px;
}
.fc__mini b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.03em; }
.fc__mini span { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.fc__map { background: var(--lavender-soft); border-radius: 16px; padding: 8px; margin-bottom: 18px; }
.fc__map svg { width: 100%; height: auto; }

.fc__bars { display: grid; gap: 10px; }
.fc__barrow { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; font-size: .9rem; }
.fc__barrow .lbl { color: var(--navy); font-weight: 600; }
.fc__barrow .lbl small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.fc__barrow .track { height: 7px; border-radius: 4px; background: #EEF0F7; overflow: hidden; margin-top: 5px; }
.fc__barrow .track i { display: block; height: 100%; background: var(--gradient); transition: width .5s var(--ease); }
.fc__barrow .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Who */
.fc__list { display: grid; gap: 10px; max-height: 366px; overflow: auto; padding-right: 4px; }
.fc__patient {
  border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: start;
}
.fc__patient:hover { border-color: var(--line-strong); background: #FCFCFE; }
.fc__who { font-weight: 700; color: var(--navy); font-size: .98rem; }
.fc__who .ref { font-family: var(--font-mono); font-size: .88rem; color: var(--violet); }
.fc__sig { font-size: .86rem; color: var(--muted); }
.fc__dx {
  grid-column: 1 / -1; font-size: .86rem; color: var(--body);
  background: var(--lavender-soft); border-radius: 10px; padding: 7px 10px;
}
.fc__dx span { color: var(--muted); }
.fc__dx em { font-style: normal; font-family: var(--font-mono); color: var(--navy); }
.fc__pill {
  align-self: start; font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  color: #fff; border-radius: var(--radius-pill); padding: 4px 10px; white-space: nowrap;
}
.fc__pill--Eligible { background: var(--eligible); }
.fc__pill--Near { background: var(--near); }

/* ---------- footer note inside the card ---------- */

.fc__note {
  padding: 16px 24px; background: var(--lavender-soft); border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--navy);
}
.fc__note b { font-weight: 700; }

.fc-under {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  font-size: .95rem; color: var(--muted);
}

@media (max-width: 1000px) {
  .fc__panels { grid-template-columns: 1fr; }
  .fc__panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .fc__panel:last-child { border-bottom: 0; }
  .fc__map svg { max-height: 300px; }
  .fc__list { max-height: none; }
}

@media (max-width: 560px) {
  .fc__bar, .fc__meta, .fc__panel, .fc__note { padding-left: 18px; padding-right: 18px; }
  .fc__protocol { flex: 1 1 calc(50% - 8px); }
  .fc__view { width: 100%; }
  .fc__view button { flex: 1; }
}

/* Demo additions on top of the live feasibility.css. Ulysse tokens only. */

body { background: var(--lavender-soft); }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--wrap); margin: 0 auto; padding: 22px 24px 0; }
.demo-top .logo { text-decoration: none; }
.demo-tag { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--violet); background: var(--white); border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); padding: 6px 14px; }
.demo-wrap { max-width: var(--wrap); margin: 0 auto; padding: 22px 24px 48px; }
.demo-wrap .section-head h2 { font-size: var(--h3); }

.fc__new { border-style: dashed !important; }

/* builder */
.fb { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--lavender-soft); padding: 22px 26px; display: grid; gap: 18px; }
.fb__head { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 12px; }
.fb__head label { display: grid; gap: 6px; font-size: .76rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fb input, .fb select { font: inherit; font-size: .92rem; color: var(--navy); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
  text-transform: none; letter-spacing: 0; font-weight: 600; }
.fb__group { display: grid; gap: 8px; }
.fb__title { font-size: .8rem; font-weight: 800; color: var(--navy); letter-spacing: .04em; text-transform: uppercase; }
.fb__row { display: grid; grid-template-columns: 22px 34px 1fr 150px 190px; gap: 12px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  cursor: pointer; opacity: .55; transition: opacity .2s var(--ease), border-color .2s var(--ease); }
.fb__row.is-on { opacity: 1; border-color: var(--line-strong); }
.fb__row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--violet); padding: 0; }
.fb__id { font-family: var(--font-mono); font-size: .82rem; color: var(--violet); font-weight: 700; }
.fb__label { font-size: .94rem; color: var(--navy); font-weight: 600; }
.fb__label select { margin-left: 6px; padding: 4px 8px; }
.fb__days { width: 64px; margin: 0 4px; padding: 4px 8px !important; }
.fb__src { font-size: .82rem; color: var(--muted); }
.fb__hard { font-size: .76rem; font-weight: 700; border-radius: var(--radius-pill); padding: 4px 10px;
  justify-self: start; }
.fb__hard--hard { background: var(--lavender); color: var(--navy); }
.fb__hard--soft { background: var(--cream); color: var(--near); }
.fb__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.fb__foot p { font-size: .84rem; color: var(--muted); max-width: 640px; }
.fb__run { font: inherit; font-weight: 700; color: var(--white); background: var(--gradient); border: 0;
  border-radius: var(--radius-pill); padding: 12px 22px; cursor: pointer; box-shadow: var(--shadow-sm); }

/* near-miss buckets */
.fc__buckets { display: grid; gap: 8px; margin-top: 10px; }
.fc__bucket { font: inherit; font-size: .88rem; display: flex; justify-content: space-between; gap: 10px;
  text-align: left; color: var(--navy); background: var(--white); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.fc__bucket b { color: var(--near); font-variant-numeric: tabular-nums; }
.fc__bucket[aria-pressed="true"] { border-color: var(--near); background: var(--cream); }

/* who: expandable record */
.fc__patient--click { cursor: pointer; }
.fc__patient.is-open { border-color: var(--violet); background: var(--white); }
.fc__ev { grid-column: 1 / -1; margin-top: 10px; cursor: default; }
.fc__ev table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.fc__ev th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.fc__ev td { padding: 6px 4px; color: var(--navy); border-bottom: 1px solid var(--line); vertical-align: top; }
.fc__ev em { font-style: normal; font-family: var(--font-mono); font-size: .8rem; color: var(--violet); }
.fc__evnote { font-size: .86rem; color: var(--body); background: var(--lavender-soft); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; }
.fc__evnote span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fc__filter { font-size: .86rem; color: var(--muted); margin-bottom: 10px; }
.fc__filter button { font: inherit; font-size: .8rem; color: var(--violet); background: none; border: 0;
  cursor: pointer; text-decoration: underline; }
.fc__picker { display: grid; gap: 6px; font-size: .76rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.fc__picker select { font: inherit; font-size: .9rem; color: var(--navy); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 7px 9px; text-transform: none; letter-spacing: 0; }
.fc__list { max-height: 560px; }

/* structured patient profile */
.fp { display: grid; gap: 8px; }
.fp__row { display: grid; grid-template-columns: 90px 1fr 130px; gap: 12px; align-items: center;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; opacity: .7; }
.fp__row.is-on { opacity: 1; border-color: var(--line-strong); }
.fp__name { font-size: .94rem; font-weight: 700; color: var(--navy); }
.fp__range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fp__range input[type=range] { width: 150px; accent-color: var(--violet); padding: 0; }
.fp__val { font-size: .86rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.fp__row select[multiple] { min-width: 240px; padding: 4px; }
.fp__sex { display: flex; gap: 18px; font-size: .9rem; }
.fp__any { font-size: .86rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fp__any input, .fp__sex input { accent-color: var(--violet); padding: 0; width: auto; }
.fp__row :disabled { opacity: .45; }

.fb[hidden] { display: none !important; }
