:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647184;
  --line: #d8dee8;
  --paper: #f6f8fb;
  --white: #ffffff;
  --blue: #1769aa;
  --teal: #0c7c7a;
  --green: #2f7d4f;
  --red: #b42331;
  --amber: #b76e00;
  --violet: #6046a7;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

body.locked {
  overflow: hidden;
}

body.locked .topbar,
body.locked main,
body.locked footer {
  display: none;
}

body:not(.locked) .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #eef7f6, #ffffff);
}

.auth-card {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 6px 0 10px;
  font-size: 30px;
}

.auth-card p {
  color: var(--muted);
}

.auth-card label,
.auth-card label span {
  display: block;
}

.auth-card label {
  margin: 22px 0 14px;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.auth-card button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.eyebrow, .status {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a, nav button, .primary, .secondary, .filter, .risk-filter {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

nav a:hover, nav button:hover, .filter:hover { border-color: var(--blue); }

.special-link-card {
  margin-top: 14px;
  padding: 14px;
  border: 2px solid rgba(12, 124, 122, .55);
  border-radius: 8px;
  background: #f0fbfa;
}

.special-link-card.dashboard-highlight {
  border-color: rgba(196, 58, 58, .7);
  background: #fff5f5;
}

.special-link-card p,
.special-link-card strong,
.special-link-card span,
.special-link-card a {
  display: block;
}

.special-link-card p {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.special-link-card strong {
  color: var(--ink);
  font-size: 17px;
}

.special-link-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.special-link-card a {
  width: fit-content;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  text-decoration: none;
  font-weight: 800;
}

.special-link-card.dashboard-highlight p {
  color: #b42318;
}

.special-link-card.dashboard-highlight a {
  background: #d92d20;
}

.special-link-card.dashboard-highlight a:hover {
  background: #b42318;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 32px;
  align-items: stretch;
  padding: 38px 48px 34px;
  max-width: 1440px;
  margin: 0 auto;
}

.hero-copy, .command-panel, .story-block, .flow-card, .arch-group, .gap-row, .risk-card, .scenario, .timeline > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
}

.hero h2 {
  margin: 0 0 14px;
  max-width: 720px;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero p {
  max-width: 900px;
  font-size: 16px;
  color: #344053;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.secondary {
  background: #eef6fb;
}

.command-panel {
  padding: 28px;
  background: linear-gradient(180deg, #ffffff, #eef7f6);
}

.panel-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid div {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.metric-grid strong {
  display: block;
  font-size: 28px;
  color: var(--blue);
}

.metric-grid span, .signal-list span, footer span {
  color: var(--muted);
  font-size: 13px;
}

.signal-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.signal-list span {
  padding: 7px 10px;
  border: 1px solid #c9d8e8;
  border-radius: 999px;
  background: #f8fbff;
}

.section-band {
  padding: 54px 48px;
  border-top: 1px solid var(--line);
  background: var(--white);
  scroll-margin-top: 140px;
}

.section-band.light {
  background: #eef3f8;
}

.section-head {
  max-width: 1280px;
  margin: 0 auto 24px;
}

.section-head.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: end;
}

.section-head.split > :first-child {
  min-width: 0;
}

.section-head.split .filters,
.section-head.split .search-box,
.section-head.split .readiness-score {
  grid-column: 2;
  grid-row: 1;
}

.section-toggle {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.section-head:not(.split) .section-toggle {
  margin-top: 12px;
}

.section-head.split .section-toggle {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.section-toggle:hover {
  border-color: var(--blue);
}

.section-band.collapsed > :not(.section-head) {
  display: none;
}

.section-band.collapsed {
  padding-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.section-note {
  max-width: 820px;
  margin: 10px 0 0;
  color: var(--muted);
}

.two-col, .module-grid, .architecture, .insight-strip, .legacy-contract, .gap-table, .risk-board, .scenario-list, .timeline, .glossary-grid, .risk-controls, .readiness-grid, .recommendation-panel, .module-intro, .reference-layout, .prototype-tabs, .prototype-view, .sandbox-layout, .scorecard-grid, .data-map-grid, .uat-output, .comparison-panel, .ho-lesson-grid {
  max-width: 1280px;
  margin: 0 auto;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.story-block, .flow-card {
  padding: 26px;
}

.story-block h3, .arch-group h3, .timeline h3 {
  margin-top: 0;
}

.story-block h4 {
  margin: 0 0 8px;
}

.explain-list {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.explain-list ul,
.current-detail-grid ul {
  margin: 0;
  padding-left: 20px;
}

.explain-list li,
.current-detail-grid li {
  margin: 7px 0;
}

.flow-card {
  display: grid;
  gap: 16px;
  align-content: center;
}

.flow-note {
  padding: 14px;
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  background: #f8fbff;
}

.flow-note p {
  margin: 6px 0 0;
  color: var(--muted);
}

.flow-row {
  display: grid;
  grid-template-columns: 1fr 30px 1fr 30px 1fr;
  align-items: center;
  gap: 8px;
}

.flow-row span {
  padding: 16px 10px;
  text-align: center;
  background: #f3f7fb;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  font-weight: 700;
}

.flow-row b {
  height: 2px;
  background: var(--teal);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 22px;
}

.current-detail-grid {
  max-width: 1280px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.current-detail-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.current-detail-grid h3 {
  margin: 0 0 8px;
  color: var(--blue);
}

.current-detail-grid p {
  color: var(--muted);
}

.prototype-status {
  min-width: 240px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.prototype-status strong,
.prototype-status span {
  display: block;
}

.prototype-status strong {
  color: var(--teal);
  font-size: 24px;
}

.prototype-status span {
  color: var(--muted);
}

.reference-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
}

.reference-panel,
.prototype-summary,
.prototype-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.reference-panel h3,
.prototype-summary h3,
.prototype-card h4 {
  margin: 0 0 10px;
}

.reference-panel p,
.prototype-summary p,
.prototype-card p {
  color: var(--muted);
}

.kernel-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.kernel-map span {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid #c9d8e8;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.check-list {
  margin: 0;
  padding-left: 20px;
}

.check-list li {
  margin: 8px 0;
  color: #344053;
}

.nontech-brief {
  max-width: 1280px;
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.nontech-brief article,
.plain-explain {
  padding: 18px;
  border: 1px solid rgba(12, 124, 122, .28);
  border-radius: 8px;
  background: #f8fffe;
}

.nontech-brief h3 {
  margin: 0 0 8px;
  color: var(--blue);
}

.nontech-brief p,
.plain-explain {
  color: #344053;
}

.nontech-brief p {
  margin: 0;
}

.plain-explain {
  max-width: 1280px;
  margin: 0 auto 16px;
}

.plain-explain strong {
  color: var(--teal);
}

.ho-lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ho-lesson-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.ho-lesson-grid h3 {
  margin: 0 0 10px;
  color: var(--blue);
}

.ho-lesson-grid ul {
  margin: 0;
  padding-left: 20px;
}

.ho-lesson-grid li {
  margin: 8px 0;
  color: #344053;
}

.function-map {
  display: grid;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
}

.function-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.function-group-toggle {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 0;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.function-group-toggle span {
  display: grid;
  gap: 4px;
}

.function-group-toggle strong {
  color: var(--blue);
  font-size: 22px;
}

.function-group-toggle em {
  color: var(--muted);
  font-style: normal;
}

.function-group-toggle b {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #eef6fb;
  color: var(--teal);
  text-align: center;
}

.function-group.open .function-group-toggle {
  border-bottom: 1px solid var(--line);
}

.function-group.open .function-group-toggle b {
  background: var(--teal);
  color: #fff;
}

.function-group-body {
  display: none;
  padding: 18px 20px 20px;
}

.function-group.open .function-group-body {
  display: grid;
  gap: 16px;
}

.function-group-body > p {
  margin: 0;
  color: #344053;
}

.function-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.function-item {
  padding: 16px;
  border: 1px solid rgba(12, 124, 122, .22);
  border-radius: 8px;
  background: #fbfefe;
}

.function-item h3 {
  margin: 0 0 8px;
  color: var(--blue);
}

.function-item p {
  margin: 8px 0 0;
  color: #344053;
}

.function-item strong {
  color: var(--teal);
}

.prototype-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.prototype-tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  cursor: pointer;
}

.prototype-tab.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.prototype-view {
  margin-top: 16px;
}

.prototype-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.prototype-card {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.prototype-card:hover,
.prototype-card.open {
  border-color: var(--teal);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
  transform: translateY(-1px);
}

.prototype-card h4 {
  color: var(--blue);
  font-size: 18px;
}

.prototype-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.prototype-card.open .prototype-detail {
  display: grid;
  gap: 6px;
}

.prototype-detail strong {
  color: var(--teal);
}

.prototype-detail span {
  color: var(--ink);
}

.data-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.data-map-card,
.uat-card,
.comparison-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.data-map-card h3 {
  margin: 0 0 12px;
  color: var(--blue);
}

.data-map-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.data-map-card div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.data-map-card dt {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.data-map-card dd {
  margin: 2px 0 0;
  color: var(--muted);
}

.db-review-metrics {
  max-width: 1280px;
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#db-review {
  overflow-x: hidden;
}

#db-review h2,
#db-review h3,
#db-review p,
#db-review li,
#db-review strong,
#db-review span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#db-review article,
#db-review div {
  min-width: 0;
}

.db-review-metrics article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.db-review-metrics strong {
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}

.db-review-metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.db-review-grid,
.db-tor-strip {
  max-width: 1280px;
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.db-review-grid article,
.db-tor-strip article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.db-review-grid h3,
.db-tor-strip h3 {
  margin: 0 0 10px;
  color: var(--blue);
}

.db-review-grid ul {
  margin: 0;
  padding-left: 20px;
}

.db-review-grid li {
  margin: 8px 0;
  color: #344053;
}

.db-domain-table {
  max-width: 1280px;
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.db-domain-table div {
  min-height: 70px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(12, 124, 122, .24);
  border-radius: 8px;
  background: #fbfefe;
}

.db-domain-table strong {
  color: var(--ink);
  font-size: 14px;
}

.db-domain-table span {
  color: var(--teal);
  font-weight: 800;
}

.db-tor-strip p {
  margin: 0;
  color: var(--muted);
}

.uat-output {
  margin-top: 16px;
}

.uat-card h3 {
  margin: 0 0 8px;
}

.uat-card p {
  color: var(--muted);
}

.uat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.uat-grid section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.uat-grid h4 {
  margin: 0 0 8px;
  color: var(--blue);
}

.uat-grid ul,
.uat-grid ol {
  margin: 0;
  padding-left: 20px;
}

.uat-grid li {
  margin: 6px 0;
}

.sandbox-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.scenario-menu {
  display: grid;
  gap: 10px;
  align-content: start;
}

.scenario-choice {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scenario-choice.active {
  border-color: var(--teal);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.1);
}

.scenario-choice strong,
.scenario-choice span {
  display: block;
}

.scenario-choice strong {
  color: var(--blue);
}

.scenario-choice span {
  color: var(--muted);
  font-size: 13px;
}

.clinical-screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.voice-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.voice-flow article,
.voice-detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
}

.voice-flow article {
  position: relative;
  min-height: 210px;
  padding: 16px;
}

.voice-flow span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.voice-flow h3,
.voice-detail-grid h3 {
  margin: 12px 0 8px;
  color: var(--blue);
}

.voice-flow p,
.voice-detail-grid li {
  color: var(--muted);
}

.voice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.voice-detail-grid article {
  padding: 20px;
}

.screen-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  color: #d8dee8;
  background: #172033;
}

.screen-toolbar strong {
  color: #fff;
}

.screen-patient {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.screen-patient small,
.screen-patient strong {
  display: block;
}

.screen-patient small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.screen-summary {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

.workflow-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.workflow-step {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  background: #fbfcfe;
}

.workflow-step b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
}

.workflow-step span {
  font-size: 13px;
  font-weight: 800;
}

.screen-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.screen-columns article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.screen-columns h4 {
  margin: 0 0 8px;
  color: var(--blue);
}

.screen-columns ul {
  margin: 0;
  padding-left: 20px;
}

.screen-columns li {
  margin: 6px 0;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scorecard-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.scorecard-item label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.scorecard-item output {
  color: var(--teal);
}

.scorecard-item input {
  width: 100%;
  margin: 14px 0 8px;
  accent-color: var(--teal);
}

.scorecard-item p {
  margin: 0;
  color: var(--muted);
}

.comparison-panel {
  margin-top: 22px;
}

.comparison-panel .section-head {
  margin-bottom: 16px;
}

.comparison-table {
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  color: var(--ink);
  background: #f8fbff;
}

.score-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.score-3 { background: var(--green); }
.score-2 { background: var(--teal); }
.score-1 { background: var(--amber); }
.score-0 { background: var(--red); }

.module-category {
  max-width: 1280px;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.module-category-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.module-category-header strong {
  display: block;
  color: var(--blue);
  font-size: 20px;
}

.module-category-header span {
  color: var(--muted);
}

.module-category-header b {
  color: var(--teal);
}

.module-category-body {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.module-category.open .module-category-body {
  display: grid;
}

.module-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.module-intro h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.module-intro p {
  margin: 0;
  color: var(--muted);
}

.legend {
  display: grid;
  gap: 8px;
  min-width: 280px;
  color: var(--muted);
  font-size: 13px;
}

.legend span, .module-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.current { background: var(--blue); }
.dot.supporting { background: var(--violet); }
.dot.target { background: var(--teal); }

.module-badge {
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.module-badge.supporting {
  background: var(--violet);
}

.module {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.module:hover, .module.open {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.1);
  transform: translateY(-2px);
}

.module strong {
  display: block;
  color: var(--blue);
}

.module span {
  color: var(--muted);
  font-size: 13px;
}

.module-detail {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.module.open .module-detail {
  display: block;
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: min(420px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box input {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.glossary-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.glossary-card h3 {
  margin: 0 0 8px;
  color: var(--blue);
}

.glossary-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.glossary-card small {
  display: block;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.architecture {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  gap: 10px;
  align-items: stretch;
}

.architecture.erp-row {
  grid-template-columns: 1fr 34px 1fr 34px 1fr;
  margin-top: 14px;
}

.arch-group {
  padding: 18px;
  min-height: 220px;
}

.arch-group.accent {
  border-color: rgba(12, 124, 122, .45);
  background: #f0fbfa;
}

.arch-group span {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5f7fa;
  border: 1px solid #dce3ec;
}

.arch-arrow {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 28px;
  font-weight: 800;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.insight-strip div {
  padding: 16px;
  border-left: 5px solid var(--teal);
  background: var(--white);
  border-radius: 6px;
}

.insight-strip strong, .insight-strip span {
  display: block;
}

.insight-strip span {
  color: var(--muted);
}

.legacy-contract {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.legacy-contract h3 {
  margin: 0 0 10px;
}

.legacy-contract p {
  margin: 0;
  color: var(--muted);
}

.contract-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.contract-summary article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.contract-summary span,
.contract-summary strong {
  display: block;
}

.contract-summary span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.contract-summary strong {
  margin-top: 8px;
  color: var(--blue);
  font-size: 20px;
}

.contract-summary p {
  margin-top: 10px;
  font-size: 14px;
}

.contract-timeline {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-left: 18px;
  border-left: 4px solid var(--teal);
}

.contract-timeline article {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.contract-timeline article::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 22px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.contract-timeline span,
.contract-timeline strong {
  display: block;
}

.contract-timeline span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.contract-timeline strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.contract-timeline p {
  margin-top: 6px;
  font-size: 14px;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legacy-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.legacy-grid strong, .legacy-grid span {
  display: block;
}

.legacy-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.gap-table {
  display: grid;
  gap: 10px;
}

.gap-row {
  display: grid;
  grid-template-columns: 90px 1.1fr 1.2fr 1.1fr 88px;
  gap: 12px;
  padding: 16px;
  align-items: start;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.gap-row:hover, .gap-row.open {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
}

.gap-row.open {
  transform: translateY(-1px);
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.tag.JCI { background: var(--blue); }
.tag.HA-IT { background: var(--green); }
.tag.Data { background: var(--violet); }
.tag.Integration { background: var(--amber); }

.priority {
  color: #fff;
  background: var(--red);
  padding: 7px 10px;
  border-radius: 6px;
  font-weight: 800;
  text-align: center;
  font-size: 13px;
}

.priority.medium {
  background: var(--amber);
}

.priority.high {
  background: var(--red);
}

.gap-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.gap-detail {
  display: none;
  grid-column: 2 / -1;
  padding: 16px;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  background: #f8fbff;
}

.gap-row.open .gap-detail {
  display: block;
}

.gap-detail strong {
  display: block;
  margin-bottom: 8px;
}

.gap-detail ul {
  margin: 0;
  padding-left: 20px;
}

.gap-detail li {
  margin: 6px 0;
  color: #344053;
}

.gap-detail span {
  display: inline-block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.risk-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.risk-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.risk-filter.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.risk-card {
  padding: 18px;
  border-top: 5px solid var(--red);
}

.risk-card.medium { border-top-color: var(--amber); }
.risk-card h3 { margin: 0 0 8px; }
.risk-card p { color: var(--muted); margin-bottom: 0; }

.scenario-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.scenario {
  padding: 20px;
  cursor: pointer;
}

.scenario h3 {
  margin-top: 0;
}

.scenario ol {
  display: none;
  margin: 0;
  padding-left: 20px;
}

.scenario.open ol {
  display: block;
}

.scenario::after {
  content: "Click to expand scenario";
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.scenario.open::after {
  content: "Click to collapse";
}

.readiness-score {
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.readiness-score strong {
  display: block;
  font-size: 36px;
  color: var(--teal);
  line-height: 1;
}

.readiness-score span {
  color: var(--muted);
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.readiness-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.readiness-item:hover, .readiness-item.open {
  border-color: var(--teal);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
}

.readiness-item.open {
  transform: translateY(-1px);
}

.readiness-item label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.readiness-item input {
  width: 100%;
  margin: 14px 0 8px;
  accent-color: var(--teal);
}

.readiness-item p {
  margin: 0;
  color: var(--muted);
}

.readiness-detail {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.readiness-item.open .readiness-detail {
  display: block;
}

.readiness-detail strong {
  display: block;
  margin-bottom: 8px;
}

.readiness-detail ul {
  margin: 0;
  padding-left: 20px;
}

.readiness-detail li {
  margin: 6px 0;
  color: #344053;
}

.recommendation-panel {
  margin-top: 16px;
  padding: 18px;
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.recommendation-panel h3 {
  margin: 0 0 8px;
}

.recommendation-panel ul {
  margin: 0;
  padding-left: 20px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.timeline > div {
  padding: 22px;
  border-top: 6px solid var(--blue);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 48px;
  background: #111827;
}

footer span {
  color: #d8dee8;
}

@media (max-width: 960px) {
  .topbar, .section-head.split, footer {
    align-items: stretch;
    flex-direction: column;
  }
  .section-head.split {
    display: flex;
  }
  .section-head.split .section-toggle {
    align-self: flex-start;
  }
  .module-intro {
    align-items: stretch;
    flex-direction: column;
  }
  .hero, .two-col, .architecture, .insight-strip, .contract-summary, .legacy-grid, .risk-board, .scenario-list, .timeline, .glossary-grid, .readiness-grid, .current-detail-grid, .reference-layout, .prototype-grid, .sandbox-layout, .screen-patient, .screen-columns, .scorecard-grid, .data-map-grid, .uat-grid, .nontech-brief, .ho-lesson-grid, .function-items, .voice-detail-grid, .db-review-grid, .db-tor-strip {
    grid-template-columns: 1fr;
  }
  .db-review-metrics,
  .db-domain-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .voice-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workflow-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kernel-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .arch-arrow {
    min-height: 24px;
    transform: rotate(90deg);
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-category-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gap-row {
    grid-template-columns: 1fr;
  }
  .gap-detail {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .topbar, .hero, .section-band, footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero-copy {
    padding: 24px;
  }
  .metric-grid, .module-grid, .voice-flow, .db-review-metrics, .db-domain-table {
    grid-template-columns: 1fr;
  }
  .workflow-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-category-body {
    grid-template-columns: 1fr;
  }
  .flow-row {
    grid-template-columns: 1fr;
  }
  .flow-row b {
    display: none;
  }
}

@media print {
  .topbar, .hero-actions, .filters, footer { display: none; }
  body { background: #fff; }
  .section-band, .hero { padding: 18px 0; }
  .hero-copy, .command-panel, .story-block, .flow-card, .arch-group, .gap-row, .risk-card, .scenario, .timeline > div {
    box-shadow: none;
    break-inside: avoid;
  }
}
