/* =====================================================================
   Health Continuum Space · Clinical Demo Portal
   Light clinical enterprise visual language
   ===================================================================== */

/* ------------------------------ tokens ------------------------------ */
:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #edf1f7;
  --border: #e5e7eb;
  --border-strong: #c9cfd8;
  --ink: #0b1f33;
  --ink-soft: #33475b;
  --ink-muted: #5a6b7b;

  --primary: #0b5ed7;
  --primary-deep: #005cb9;
  --primary-soft: #e8f1fc;
  --accent: #00b6f1;

  --critical: #c8102e;
  --critical-soft: #fdecef;
  --advisory: #b25e00;
  --advisory-soft: #fdf3e6;
  --positive: #0e7c5a;
  --positive-soft: #e9f5f0;

  --radius: 8px;
  --radius-lg: 12px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  --max: 1280px;
  --gutter: 24px;
  --header-h: 68px;

  --font: "Segoe UI", "Noto Sans", "Microsoft YaHei", "Malgun Gothic",
    "Leelawadee UI", "Apple SD Gothic Neo", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;

  --shadow-hover: 0 6px 20px rgba(11, 31, 51, 0.08);
  --focus: 0 0 0 2px #ffffff, 0 0 0 4px var(--primary);
}

/* ------------------------------ reset ------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

.sprite { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ------------------------------ icons ------------------------------- */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------ buttons ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); }

.btn--ghost {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}
.btn--ghost:hover { background: var(--primary-soft); }

.btn--quiet {
  border-color: var(--border);
  color: var(--ink-soft);
  background: #fff;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
}
.btn--quiet:hover { border-color: var(--border-strong); background: var(--surface); }

.btn:disabled,
.btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}
.btn:disabled:hover { background: #fff; }

/* ------------------------------ header ------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.topbar.is-stuck { box-shadow: 0 1px 12px rgba(11, 31, 51, .07); }

.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  flex: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--primary);
  line-height: 1;
}
.brand__rule { width: 1px; height: 26px; background: var(--border); flex: none; }
.brand__text { min-width: 0; display: flex; flex-direction: column; }
.brand__text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__text small {
  font-size: 11.5px;
  color: var(--ink-muted);
  letter-spacing: .01em;
  white-space: nowrap;
}

.topbar__nav {
  display: flex;
  gap: var(--s5);
  margin-left: auto;
}
.topbar__nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.topbar__nav a:hover { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-left: var(--s4);
}

.env-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
}
.lang .icon { font-size: 15px; }
.lang select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 26px 7px 8px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lang select:hover { border-color: var(--border-strong); }

/* --------------------------- quick launch --------------------------- */
.quicklaunch {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.quicklaunch__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s4);
  overflow: hidden;
}
.quicklaunch__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  flex: none;
}
.quicklaunch__track {
  display: flex;
  align-items: center;
  gap: var(--s2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}
.quicklaunch__track::-webkit-scrollbar { display: none; }

.launch-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  flex: none;
  padding: 6px 10px 6px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color .16s ease, color .16s ease;
}
.launch-pill:hover { border-color: var(--primary); }
.launch-pill__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.launch-pill:hover .launch-pill__btn { color: var(--primary); }
.launch-pill__badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-muted);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 5px;
}
.launch-pill__direct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--ink-muted);
  border-left: 1px solid var(--border);
  padding-left: 6px;
  border-radius: 0;
}
.launch-pill__direct .icon { font-size: 12px; }
.launch-pill__direct:hover { color: var(--primary); }

/* ------------------------------- hero ------------------------------- */
.hero {
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--s8) var(--gutter) var(--s8);
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  gap: var(--s7);
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s4);
}

.hero h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 700;
}
.hero h1 span { display: block; }

.hero__lead {
  margin-top: var(--s4);
  max-width: 54ch;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero__actions {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.hero__stats {
  margin-top: var(--s6);
  display: flex;
  gap: var(--s6);
  border-top: 1px solid var(--border);
  padding-top: var(--s4);
}
.hero__stats > div { display: flex; flex-direction: column-reverse; }
.hero__stats dd {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.hero__stats dt {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: .01em;
}

.hero__note {
  margin-top: var(--s4);
  font-size: 12px;
  color: var(--ink-muted);
  max-width: 60ch;
}

.hero__media { display: flex; flex-direction: column; gap: var(--s2); }
.hero__media figcaption {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* --------------------------- media frames --------------------------- */
.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--hero {
  aspect-ratio: 16 / 9;
  border-top: 3px solid var(--primary);
}

/* ------------------------------ sections ---------------------------- */
.section { padding: var(--s8) 0; scroll-margin-top: calc(var(--header-h) + 24px); }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); }
.section__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s5);
  margin-bottom: var(--s5);
}
.section__head h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -.015em;
  font-weight: 700;
}
.section__lead {
  margin-top: var(--s2);
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 15px;
}
.section__count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-muted);
  padding-bottom: 4px;
}

/* ------------------------------ filters ----------------------------- */
.filters {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s5);
}
.filters__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.filters__chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ------------------------------- cards ------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
}

.scenario-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.scenario-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}
.scenario-card[aria-expanded="true"] {
  border-left-color: var(--primary);
  border-color: var(--border-strong);
}

.scenario-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}
.scenario-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--critical { color: var(--critical); }
.badge--advisory { color: var(--advisory); }
.badge--normal { color: var(--positive); }
.scenario-card__badge { position: absolute; top: 10px; left: 10px; }

.scenario-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s4) var(--s3);
  flex: 1;
}
.card-unit {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.scenario-card__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scenario-card__objective {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.device-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--s2);
}
.device-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}
.device-chip--more { color: var(--ink-muted); }

.scenario-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.scenario-card__open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--primary);
}
.scenario-card__open .icon { font-size: 13px; transition: transform .16s ease; }
.scenario-card:hover .scenario-card__open .icon { transform: translateX(2px); }

/* --------------------------- empty state ---------------------------- */
.empty-state {
  padding: var(--s8) var(--s5);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: #fff;
}
.empty-state__title { font-size: 18px; font-weight: 700; }
.empty-state__body { margin: var(--s2) 0 var(--s4); color: var(--ink-muted); font-size: 14px; }

/* ---------------------------- workspace ----------------------------- */
.workspace {
  margin-top: var(--s6);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.ws-head {
  padding: var(--s5);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4);
  align-items: start;
}
.ws-head__meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.ws-head__meta .badge { background: var(--surface); }
.ws-head h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.25;
  letter-spacing: -.015em;
  font-weight: 700;
}
.ws-head__objective {
  margin-top: var(--s2);
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 78ch;
}
.ws-head__actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }

/* stepper */
.stepper {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.step-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: var(--s3) var(--s4);
  border: 0;
  border-right: 1px solid var(--border);
  border-top: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color .16s ease;
}
.step-tab:last-child { border-right: 0; }
.step-tab:hover { background: #fff; }
.step-tab[aria-selected="true"] {
  background: #fff;
  border-top-color: var(--primary);
}
.step-tab__num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink-muted);
}
.step-tab[aria-selected="true"] .step-tab__num { color: var(--primary); }
.step-tab__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
}
.step-tab[aria-selected="true"] .step-tab__name { color: var(--ink); }

/* workspace body */
.ws-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 0;
}
.ws-script { padding: var(--s5); border-right: 1px solid var(--border); }
.ws-context { padding: var(--s5); background: var(--surface); }

.ws-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s3);
}

.script-list { display: flex; flex-direction: column; gap: var(--s3); }
.script-list li {
  list-style: none;
  padding-left: var(--s5);
  position: relative;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.script-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.script-callout {
  margin-top: var(--s5);
  display: flex;
  gap: var(--s3);
  padding: var(--s4);
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.script-callout .icon { font-size: 18px; color: var(--primary); margin-top: 2px; }
.script-callout__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary-deep);
  margin-bottom: 2px;
}
.script-callout__text { font-size: 14px; color: var(--ink); line-height: 1.55; }

.stage-systems { margin-top: var(--s5); }
.stage-systems__empty { font-size: 13px; color: var(--ink-muted); }

.launch-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.launch-btn:hover { background: var(--primary); color: #fff; }
.launch-btn__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-muted);
}
.launch-btn:hover .launch-btn__badge { background: rgba(255, 255, 255, .22); color: #fff; }
.launch-btn .icon { font-size: 12px; }

.ctx-block + .ctx-block { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.ctx-block p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill--static { cursor: default; }
.pill--static:hover { border-color: var(--border); color: var(--ink-soft); }

/* workspace footer */
.ws-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--border);
  background: #fff;
}
.ws-foot__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --------------------------- module cards --------------------------- */
.module-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.module-card.is-highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.module-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  background: linear-gradient(140deg, #E8F2FF 0%, #F7F8FA 55%, #E4F7FE 100%);
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}
.module-card__icon .icon { font-size: 42px; stroke-width: 1.4; }
.module-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
  flex: 1;
}
.module-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.module-card__sub { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.module-card__utility { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.module-card__body .card-unit { margin-bottom: -6px; }
.module-card__used .card-unit { margin-bottom: 2px; }

.ifu {
  margin-top: var(--s2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: ifu;
}
.ifu li {
  list-style: none;
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  counter-increment: ifu;
}
.ifu li::before {
  content: counter(ifu);
  position: absolute;
  left: 0;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary-deep);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.module-card__used { margin-top: var(--s3); }
.module-card__used .ws-label { margin-bottom: 6px; }

.module-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.module-card__note { font-size: 11.5px; color: var(--ink-muted); }

/* ------------------------------ footer ------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--s6) 0;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s6);
  flex-wrap: wrap;
}
.footer__brand { display: flex; flex-direction: column; gap: var(--s3); max-width: 52ch; }
.footer__name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.footer__disclaimer { font-size: 12px; color: var(--ink-muted); line-height: 1.55; }
.footer__meta {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

/* ------------------------------- toast ------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 8px 28px rgba(11, 31, 51, .22);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------- breakpoints ---------------------------- */
@media (max-width: 1200px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s6);
    padding-top: var(--s6);
  }
  .hero__media { order: -1; }
  .media-frame--hero { max-height: 280px; }
  .brand__text small { display: none; }
  .topbar__nav { display: none; }
  .ws-head { grid-template-columns: minmax(0, 1fr); }
  .ws-head__actions { justify-content: flex-start; }
  .ws-body { grid-template-columns: minmax(0, 1fr); }
  .ws-script { border-right: 0; border-bottom: 1px solid var(--border); }
  .stepper { grid-auto-columns: minmax(180px, 1fr); overflow-x: auto; }
}

@media (max-width: 768px) {
  :root { --gutter: 18px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .section { padding: var(--s7) 0; }
  .section__head { flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .hero__stats { gap: var(--s5); }
  .footer__meta { text-align: left; }
}

@media (max-width: 560px) {
  .topbar__inner { gap: var(--s3); height: 60px; }
  .brand__rule, .brand__text { display: none; }
  .env-pill { display: none; }
  .quicklaunch__label { display: none; }
  .hero h1 { font-size: 30px; }
  .hero__stats { flex-wrap: wrap; }
  .hero__actions .btn { flex: 1 1 auto; }
  .ws-head, .ws-script, .ws-context { padding: var(--s4); }
  .ws-foot { padding: var(--s3) var(--s4); flex-wrap: wrap; }
}

/* ------------------------- reduced motion --------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
  .scenario-card:hover { transform: none; }
  .scenario-card:hover .scenario-card__open .icon { transform: none; }
}

/* ------------------------------- print ------------------------------ */
@media print {
  .topbar__actions,
  .topbar__nav,
  .quicklaunch,
  .filters,
  .hero__actions,
  .hero__media,
  .scenario-card__media,
  .scenario-card__foot .scenario-card__open,
  .ws-head__actions,
  .ws-foot,
  .module-card__icon,
  .footer__name,
  .toast { display: none !important; }

  body { background: #fff; font-size: 11pt; }
  .topbar { position: static; box-shadow: none; }
  .section, .hero__inner { padding: 12pt 0; }
  .section--alt { background: #fff; }
  .card-grid { display: block; }
  .scenario-card, .module-card, .workspace {
    border: 1px solid #999;
    border-radius: 0;
    page-break-inside: avoid;
    margin-bottom: 12pt;
  }
  .scenario-card[aria-expanded="false"] { display: none; }
  .ws-body { display: block; }
  .ws-script, .ws-context { border: 0; background: #fff; }
  .step-tab:not([aria-selected="true"]) { display: none; }
  a { color: #000; text-decoration: none; }
}
