*,
*::before,
*::after {
  box-sizing: border-box;
}

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --brand-navy: #002d62;
  --brand-green: #589442;
  --bg: #0c0f14;
  --bg-elevated: #121821;
  --surface: #161d27;
  --surface-hover: #1a2330;
  --border: #2d3a4d;
  --text: #eef2f7;
  --muted: #8b99ab;
  --accent: #4f8ff7;
  --accent-soft: rgba(79, 143, 247, 0.14);
  --sidebar-bg: #0e131a;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --content-max: 920px;
  --code-bg: #080b10;
  --mermaid-bg: #080b10;
  --topbar-bg-fallback: #061018;
  --topbar-bg-image: url("assets/header-bg-dataflow.png");
}

html[data-theme="light"] {
  color-scheme: light;
  --brand-navy: #002d62;
  --brand-green: #589442;
  --bg: #e8ecf2;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f4f8;
  --border: #c9d2df;
  --text: #131820;
  --muted: #5c6778;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --sidebar-bg: #dfe5ee;
  --shadow: 0 10px 36px rgba(15, 23, 42, 0.1);
  --code-bg: #f4f6fa;
  --mermaid-bg: #f8fafc;
  --topbar-bg-fallback: #e2e8f1;
  --topbar-bg-image: url("assets/header-bg-hex.png");
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  overflow: visible;
  background: var(--topbar-bg-fallback);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--topbar-bg-fallback);
  background-image: var(--topbar-bg-image);
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(0, 45, 98, 0.88) 0%,
    rgba(6, 16, 24, 0.82) 42%,
    rgba(6, 16, 24, 0.5) 100%
  );
}

html[data-theme="light"] .topbar::after {
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(232, 236, 242, 0.88) 42%,
    rgba(232, 236, 242, 0.72) 100%
  );
}

.topbar > * {
  position: relative;
  z-index: 2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.48rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.topbar .btn {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(22, 29, 39, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="light"] .topbar .btn {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.14);
}

.topbar .persona-trigger {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(22, 29, 39, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.topbar .persona-trigger:hover {
  background: rgba(26, 35, 48, 0.82);
}

html[data-theme="light"] .topbar .persona-trigger {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .topbar .persona-trigger:hover {
  background: rgba(255, 255, 255, 0.94);
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--muted);
}

.btn.theme-toggle {
  min-width: 4.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.brand-logo-frame {
  flex-shrink: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 45, 98, 0.14);
  background: #ffffff;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.38),
    0 2px 10px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

html[data-theme="light"] .brand-logo-frame {
  border: 1px solid rgba(0, 45, 98, 0.16);
  background: #ffffff;
  box-shadow:
    0 6px 20px rgba(15, 23, 42, 0.1),
    0 2px 6px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.brand-logo {
  height: clamp(48px, 9vw, 72px);
  width: auto;
  max-width: min(188px, 40vw);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

html[data-theme="light"] .brand-logo {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.brand-title {
  display: block;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .brand-title {
  text-shadow: none;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] .brand-sub {
  text-shadow: none;
}

p.scenario-hint {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface-2, var(--surface));
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

/* Shown at top of “Screens for this persona” views — who this workflow slice represents */
.persona-scenario-chip-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin-bottom: 1rem;
}

.persona-scenario-chip-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.persona-scenario-chip-name {
  display: inline-block;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.persona-scenario-chip-role {
  font-size: 0.82rem;
  color: var(--muted);
}

.form-stack label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.form-stack input[type="text"],
.form-stack input[type="date"],
.form-stack textarea,
.form-stack select {
  width: 100%;
  max-width: 42rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}

.form-stack textarea {
  min-height: 5rem;
  resize: vertical;
}

.form-stack p {
  margin: 0 0 0.85rem;
}

.checkbox-row label {
  display: inline;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.brand-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-green);
  margin-top: 0.15rem;
}

html[data-theme="light"] .brand-role {
  color: var(--brand-green);
}

/* Persona switcher (NVPDR-style categorized menu) */
.persona-switcher {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

.persona-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(280px, 56vw);
  max-width: min(340px, 72vw);
  padding: 0.42rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.persona-trigger:hover {
  background: var(--surface-hover);
  border-color: var(--muted);
}

.persona-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.persona-trigger.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.persona-trigger-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.persona-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1;
}

.persona-trigger-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-trigger-role {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.persona-trigger-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  margin-left: 0.15rem;
  transition: transform 0.18s ease;
}

.persona-trigger.is-open .persona-trigger-chevron {
  transform: rotate(180deg);
}

.persona-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: min(100%, 360px);
  max-width: min(420px, calc(100vw - 2rem));
  max-height: min(72vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.65rem 0 0.55rem;
  background: #1c2636;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  z-index: 100;
}

html[data-theme="light"] .persona-panel {
  background: #ffffff;
  border: 1px solid rgba(0, 45, 98, 0.18);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.18),
    0 8px 20px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.persona-section-title {
  padding: 0.65rem 0.85rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.persona-section-rows {
  padding: 0 0.35rem 0.45rem;
}

.persona-panel > .persona-section:first-child .persona-section-title {
  padding-top: 0.45rem;
}

.persona-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.48rem 0.55rem;
  margin: 0.12rem 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.persona-option:hover {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="light"] .persona-option:hover {
  background: var(--surface-hover);
}

.persona-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.persona-option.is-active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.persona-option.is-active:hover {
  background: var(--accent);
  filter: brightness(1.06);
}

.persona-option-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  width: 1.5rem;
  text-align: center;
}

.persona-option-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

html[data-theme="light"] .persona-option.is-active {
  color: #ffffff;
}

/* Flex keeps sidebar and main side-by-side; min-width:0 on main prevents overflow from breaking the row. */
.app-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 120px);
}

.sidebar {
  flex: 0 0 clamp(220px, 26vw, 260px);
  width: clamp(220px, 26vw, 260px);
  max-width: 100%;
  border-right: 1px solid var(--border);
  padding: 1.1rem 0.85rem 2rem;
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: 1.35rem;
}

.nav-section:last-child {
  margin-bottom: 0;
}

.nav-section-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
  padding-left: 0.35rem;
}

.sidebar button {
  width: 100%;
  text-align: left;
  padding: 0.52rem 0.65rem;
  margin-bottom: 0.28rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.sidebar button:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.sidebar button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 143, 247, 0.07), transparent 50%);
}

html[data-theme="light"] .main {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.07), transparent 50%);
}

.view-root {
  min-height: 100%;
}

.content-area {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.35rem 1.5rem 3rem;
}

.page-main {
  max-width: none;
}

.footer {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--sidebar-bg);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--text);
}

.card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.card > p:first-of-type {
  margin-top: 0;
}

.panel-muted {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

html[data-theme="light"] .panel-muted {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--border);
}

.grid-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.pillar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  background: linear-gradient(165deg, rgba(79, 143, 247, 0.08) 0%, var(--surface) 55%);
}

html[data-theme="light"] .pillar {
  background: linear-gradient(165deg, rgba(37, 99, 235, 0.06) 0%, var(--surface) 55%);
}

.pillar h3 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.pillar p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.intro-lead {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.hero {
  padding: 0.25rem 0 1rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero .lead {
  font-size: 1.02rem;
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
}

.hero .muted {
  margin: 0.35rem 0 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* Differentiators narrative pages */
.diff-split-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.15rem;
}

.diff-card-priority {
  border-left: 4px solid var(--accent);
  padding-left: 1.15rem;
}

.diff-card-priority h2 {
  margin-top: 0;
  font-size: 1.12rem;
  color: var(--text);
}

.diff-tech-columns .diff-tech-card h2 {
  margin-top: 0.35rem;
  font-size: 1.08rem;
}

.diff-tech-badge {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.diff-tech-logo-wrap {
  margin: 0 0 0.85rem;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
}

.diff-tech-logo-img {
  max-height: 42px;
  max-width: min(200px, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
}

.diff-page-list {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.diff-page-list li {
  margin-bottom: 0.45rem;
}

.diff-page-list li:last-child {
  margin-bottom: 0;
}

.diff-numbered-list {
  margin: 0.65rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.diff-numbered-list li {
  margin-bottom: 0.55rem;
}

.diff-numbered-list li:last-child {
  margin-bottom: 0;
}

.diff-callout {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 48%);
}

.tag {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tag.ok {
  border-color: rgba(62, 207, 142, 0.45);
  color: #9ae9c9;
  background: rgba(62, 207, 142, 0.08);
}

.tag.warn {
  border-color: rgba(244, 191, 80, 0.45);
  color: #fde19a;
  background: rgba(244, 191, 80, 0.08);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: middle;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

button.primary,
button.ghost {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.48rem 0.85rem;
  font-size: 0.88rem;
}

button.primary {
  background: var(--accent);
  color: #061018;
  border: none;
  font-weight: 600;
}

button.primary:hover {
  filter: brightness(1.08);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.ghost:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  overflow: auto;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}

.mermaid-wrap {
  overflow: auto;
  max-height: min(85vh, 960px);
  background: var(--mermaid-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 120px;
}

.mermaid {
  display: flex;
  justify-content: center;
}

.mermaid svg {
  max-width: 100%;
  height: auto !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.section-heading {
  margin: 1.35rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
}

.steps li {
  margin-bottom: 0.45rem;
}

.theme-patient .brand-title {
  color: #7dd3fc;
}
.theme-provider .brand-title {
  color: #6ee7b7;
}
.theme-cms .brand-title {
  color: #93c5fd;
}
.theme-plan .brand-title {
  color: #c4b5fd;
}
.theme-system .brand-title {
  color: #fcd34d;
}
.theme-hospital .brand-title {
  color: #fb923c;
}
.theme-directory .brand-title {
  color: #5eead4;
}

body.theme-patient {
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
}
body.theme-provider {
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.14);
}
body.theme-cms {
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
}
body.theme-plan {
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.14);
}
body.theme-system {
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.14);
}
body.theme-hospital {
  --accent: #fb923c;
  --accent-soft: rgba(251, 146, 60, 0.14);
}
body.theme-directory {
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
}

/* Verifiable credential preview cards & full VC modal */
.vc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.vc-card:last-child {
  margin-bottom: 0;
}

.vc-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.vc-card-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.vc-card-issuer {
  font-size: 0.88rem;
  color: var(--muted);
}

.vc-card-claims {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vc-claim-pill {
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

.vc-card-actions {
  margin-top: 0.85rem;
}

.vc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.vc-modal-dialog {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.vc-modal-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.vc-modal-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.vc-modal-pre {
  margin: 0;
  padding: 0.85rem;
  border-radius: 8px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.vc-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Subtle product marks (FHIR · 4L) next to FHIR surfaces & Integrity features */
.heading-inline-mark {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hero-brandmarks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
}

.brand-mark-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  vertical-align: middle;
  opacity: 0.92;
}

.brand-mark-wrap:hover {
  opacity: 1;
}

.brand-mark-img {
  display: block;
  height: 18px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.brand-mark-fhir {
  background: #0a0a0a;
  border-radius: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .brand-mark-fhir {
  border-color: rgba(0, 0, 0, 0.2);
}

.brand-mark-4l .brand-mark-img {
  height: 22px;
  max-width: 72px;
}

.patient-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.patient-search-toolbar p {
  margin: 0;
  flex: 1 1 180px;
}

.patient-search-toolbar label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.patient-search-toolbar input[type="search"],
.patient-search-toolbar input[type="text"],
.patient-search-toolbar select {
  width: 100%;
  max-width: none;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}

.pagination-bar-meta {
  font-size: 0.88rem;
}

.pagination-bar button:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.cms-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(280px, 34%);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 960px) {
  .cms-two-col {
    grid-template-columns: 1fr;
  }

  .steward-aside {
    position: static;
  }
}

.steward-aside {
  position: sticky;
  top: 5.5rem;
}

.steward-aside-title {
  margin-top: 0;
  font-size: 1rem;
}

.steward-aside-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.steward-flash {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.propagation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.propagation-pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  font-size: 0.82rem;
  opacity: 0.45;
  transition:
    opacity 0.35s ease,
    border-color 0.35s ease,
    background 0.35s ease;
}

.propagation-pill--sent {
  opacity: 1;
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hospital-kpi-strip {
  padding: 0.85rem 1rem;
}

.hospital-kpi-values {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.hospital-kpi-num {
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}

.hospital-kpi-num-accent {
  color: var(--accent);
}

.hospital-kpi-arrow {
  font-size: 1.25rem;
  color: var(--muted);
}

.demo-dialog {
  max-width: min(560px, 92vw);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
}

.demo-dialog--wide {
  max-width: min(960px, 96vw);
}

.demo-dialog-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
}

.demo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.demo-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.demo-dialog-body {
  padding: 1rem;
  max-height: min(70vh, 520px);
  overflow: auto;
}

.plan-cms-provider-dl {
  display: grid;
  grid-template-columns: minmax(7.5rem, auto) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.92rem;
}

.plan-cms-provider-dl dt {
  color: var(--muted);
  font-weight: 500;
}

.plan-cms-provider-dl dd {
  margin: 0;
}

button.plan-cms-npi-detail {
  padding: 0 0.1rem;
  min-height: unset;
  font: inherit;
  font-weight: 600;
  border: none;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}

button.plan-cms-npi-detail.plan-cms-npi-detail--inactive {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  cursor: not-allowed;
}

button.plan-cms-npi-detail.plan-cms-npi-detail--active {
  color: var(--accent);
}

.tag.lite {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  margin: 0 0.25rem 0.15rem 0;
}

.sys-arch-plan-tier {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  vertical-align: middle;
}

.sys-arch-card {
  overflow: hidden;
  background-image:
    linear-gradient(rgba(79, 143, 247, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 143, 247, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.sys-arch-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.sys-arch-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sys-arch-updated {
  font-size: 0.85rem;
}

.sys-arch-canvas {
  position: relative;
  min-height: 320px;
  margin-top: 0.25rem;
}

.sys-arch-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.42;
  pointer-events: none;
}

.sys-arch-svg-label {
  fill: var(--muted);
}

.sys-arch-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 820px) {
  .sys-arch-columns {
    grid-template-columns: 1fr;
  }

  .sys-arch-svg {
    opacity: 0.22;
  }
}

.sys-arch-column-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.sys-arch-node-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sys-arch-node {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(4px);
}

.sys-arch-node-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.sys-arch-node-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}

.sys-arch-node-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.sys-arch-lat {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(88, 148, 66, 0.22);
  color: var(--text);
  border: 1px solid rgba(88, 148, 66, 0.35);
}

html[data-theme="light"] .sys-arch-lat {
  background: rgba(88, 148, 66, 0.15);
}

.sys-arch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sys-arch-dot--ok {
  background: #589442;
  box-shadow: 0 0 0 3px rgba(88, 148, 66, 0.25);
}

.sys-arch-dot--warn {
  background: #e9a23b;
  box-shadow: 0 0 0 3px rgba(233, 162, 59, 0.22);
}

.sys-arch-dot--down {
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.22);
}

.sys-arch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.sys-arch-legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  vertical-align: middle;
  margin-right: 0.35rem;
  border-top: 2px solid #4f8ff7;
}

.sys-arch-legend-line--dash {
  border-top-style: dashed;
}

.sys-arch-legend-line--gold {
  border-top-color: #e9b949;
  border-top-style: dashed;
}

.sys-arch-footer {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.15rem;
}

.sys-arch-foot-sep {
  margin: 0 0.35rem;
  opacity: 0.45;
}

.plan-directory-mode.main {
  background: radial-gradient(ellipse 70% 45% at 50% -15%, rgba(167, 139, 250, 0.12), transparent 55%);
}

html[data-theme="light"] .plan-directory-mode.main {
  background: radial-gradient(ellipse 70% 45% at 50% -15%, rgba(139, 92, 246, 0.1), transparent 55%);
}

/* Do not stack sidebar above main: that read as “broken” with Cursor panel / narrow windows.
   On very small screens, shrink sidebar slightly; content scrolls horizontally only if needed. */
@media (max-width: 520px) {
  .sidebar {
    flex: 0 0 200px;
    width: 200px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .content-area {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .user-select-wrap select {
    min-width: min(260px, 85vw);
  }
}
