:root {
  --bg: #f4f7fa;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, .88);
  --panel-strong: rgba(255, 255, 255, .96);
  --ink: #071126;
  --text: #26364f;
  --muted: #66758f;
  --faint: #94a3b8;
  --line: #dfe7f1;
  --line-strong: #cdd8e6;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --blue-soft: #eaf2ff;
  --green: #16a34a;
  --green-soft: #e8f8ef;
  --amber: #f59e0b;
  --amber-soft: #fff4dd;
  --red: #ef4444;
  --red-soft: #feecec;
  --violet: #7c3aed;
  --violet-soft: #f0e9ff;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .07), 0 6px 18px rgba(30, 41, 59, .05);
  --shadow-md: 0 18px 44px rgba(30, 41, 59, .12);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, .24);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --rail: 238px;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 55% -12%, rgba(37, 99, 235, .10), transparent 34%),
    linear-gradient(180deg, #fbfdff 0, var(--bg) 280px, #eef3f8 100%);
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-heading.sr-only * {
  width: 1px;
  max-width: 1px;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  height: 100vh;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  box-shadow: 10px 0 32px rgba(15, 23, 42, .05);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 4px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 14px 28px rgba(37, 99, 235, .28);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.brand strong,
.brand span {
  display: block;
  min-width: 0;
}

.brand strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
}

.brand div span {
  margin-top: 3px;
  color: #50617c;
  font-size: 12px;
}

nav {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.nav-group {
  margin: 20px 10px 6px;
  color: #74829b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-group:first-child {
  margin-top: 0;
}

nav a {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 11px;
  color: #465a78;
  text-decoration: none;
  transition: color .22s var(--ease), background .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}

nav a::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  opacity: .72;
  mask: var(--nav-mask) center / contain no-repeat;
  -webkit-mask: var(--nav-mask) center / contain no-repeat;
}

nav a[data-nav-icon="grid"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="briefcase"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 5h8v3h4v12H4V8h4zm2 3h4V7h-4zM6 10v8h12v-8z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="network"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 9a3 3 0 1 1 2.8 1.9l5.1 3.1a3 3 0 1 1-.9 1.8L7.9 12.7a3 3 0 0 1 0-1.4L13 8.2a3 3 0 1 1 .9 1.8L8.8 13.1A3 3 0 0 1 6 15a3 3 0 0 1 0-6z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="map"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m4 5 5-2 6 2 5-2v16l-5 2-6-2-5 2zm6 .6v11.8l4 1V6.6zm-4 1.1v11.4l2-.8V5.9zm10 0v11.4l2-.8V5.9z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="building"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h11v7h3v11H5zm3 4v2h2V7zm5 0v2h2V7zm-5 5v2h2v-2zm5 0v2h2v-2zm-5 5v2h2v-2zm5 0v2h2v-2z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="shield"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 8 3v7c0 5.5-3.8 8.8-8 10-4.2-1.2-8-4.5-8-10V5zm0 3.2L6 7.4V12c0 3.9 2.5 6.2 6 7.4 3.5-1.2 6-3.5 6-7.4V7.4z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="clipboard"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 2h6l1 2h3v18H5V4h3zm1.2 3-.5 1h4.6l-.5-1zM8 10h8v2H8zm0 4h8v2H8z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="chart"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 20V4h2v14h14v2zm4-4 3-5 4 3 4-8 2 1-5 11-4-3-3 5z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="database"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3c4.4 0 8 1.3 8 3v12c0 1.7-3.6 3-8 3s-8-1.3-8-3V6c0-1.7 3.6-3 8-3zm0 2c-3.3 0-5.6.7-6 1 .4.3 2.7 1 6 1s5.6-.7 6-1c-.4-.3-2.7-1-6-1zM6 9v2c.8.5 3 1 6 1s5.2-.5 6-1V9c-1.5.7-3.7 1-6 1s-4.5-.3-6-1zm0 5v3.8c.4.3 2.7 1.2 6 1.2s5.6-.9 6-1.2V14c-1.5.7-3.7 1-6 1s-4.5-.3-6-1z'/%3E%3C/svg%3E"); }
nav a[data-nav-icon="code"] { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m8 7 1.4 1.4L5.8 12l3.6 3.6L8 17l-5-5zm8 0 5 5-5 5-1.4-1.4 3.6-3.6-3.6-3.6zm-2.2-3 .9.4L10.2 20l-.9-.4z'/%3E%3C/svg%3E"); }

nav a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav a:hover,
nav a.active {
  color: var(--blue);
  background: linear-gradient(90deg, rgba(37, 99, 235, .10), rgba(37, 99, 235, .04));
  transform: translateX(2px);
}

nav a.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.rail-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(248, 251, 255, .96);
  box-shadow: var(--shadow-sm);
}

.rail-status strong,
.rail-status small {
  display: block;
}

.rail-status strong {
  font-size: 12px;
}

.rail-status small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rail-sparkline {
  grid-column: 1 / -1;
  width: 100%;
  height: 34px;
  color: var(--green);
}

.rail-sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(780px, 840px);
  gap: 24px;
  align-items: center;
  min-height: 78px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(223, 231, 241, .9);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

h3 {
  font-size: 14px;
  line-height: 1.25;
}

.executive-subtitle {
  max-width: 760px;
  margin: 6px 0 0;
  color: #526482;
  font-size: 13px;
  line-height: 1.35;
}

.topbar-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(136px, 1fr)) minmax(180px, 1.1fr) 40px auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.account-control,
.global-search {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.account-control span,
.table-controls span,
.metric-label,
.legend,
.row-count,
.portfolio-actions span,
.section-actions label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.account-control select,
.section-actions select,
.global-search input,
.table-controls input,
.table-controls select {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.global-search input::placeholder {
  color: #9aa8bb;
}

.icon-link,
.primary-export,
.ghost-action,
.icon-segment,
.filter-btn,
.copy-btn,
.open-detail,
.icon-button,
.action-tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.icon-link {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #53657f;
}

.icon-link::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 22zm7-6v-5a7 7 0 0 0-5-6.7V3a2 2 0 1 0-4 0v1.3A7 7 0 0 0 5 11v5l-2 2v1h18v-1z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 22zm7-6v-5a7 7 0 0 0-5-6.7V3a2 2 0 1 0-4 0v1.3A7 7 0 0 0 5 11v5l-2 2v1h18v-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
}

.primary-export {
  min-height: 38px;
  min-width: 128px;
  padding: 0 14px;
  color: #fff;
  border-color: var(--blue);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
  white-space: nowrap;
}

.primary-export::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.ghost-action,
.copy-btn,
.open-detail {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  padding: 7px 11px;
  color: var(--blue);
  background: rgba(255, 255, 255, .96);
}

.icon-segment {
  width: 34px;
  height: 34px;
  color: #617089;
}

.icon-segment::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  margin: auto;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.icon-segment:nth-of-type(2)::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5h16v3H4zm0 6h16v3H4zm0 6h16v3H4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5h16v3H4zm0 6h16v3H4zm0 6h16v3H4z'/%3E%3C/svg%3E");
}

.icon-link:hover,
.primary-export:hover,
.ghost-action:hover,
.copy-btn:hover,
.open-detail:hover,
.icon-segment:hover,
.action-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .34);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.executive-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 16px;
  align-items: start;
  padding: 20px 18px 46px;
}

.main-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.band {
  min-width: 0;
  scroll-margin-top: 96px;
}

.board-band {
  display: grid;
  gap: 14px;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.section-heading p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #526482;
  font-size: 13px;
  line-height: 1.4;
}

.section-actions,
.portfolio-actions {
  display: flex;
  align-items: end;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-actions label {
  display: block;
  width: 100%;
  text-align: left;
}

.section-actions select {
  width: 178px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(72px, 1fr) auto;
  gap: 12px;
  min-height: 208px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .88)),
    var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% 12%, currentColor, transparent 26%);
  opacity: .055;
  pointer-events: none;
}

.metric:hover,
.metric:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, .28);
  box-shadow: var(--shadow-md);
}

.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.metric-main {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 72px;
  padding-right: 88px;
}

.metric strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.metric p {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.metric.ok {
  color: var(--green);
}

.metric.warn {
  color: var(--amber);
}

.metric.bad {
  color: var(--red);
}

.metric.neutral {
  color: var(--blue);
}

.metric.ok .metric-icon {
  color: var(--green);
  background: var(--green-soft);
}

.metric.warn .metric-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.metric.bad .metric-icon {
  color: var(--red);
  background: var(--red-soft);
}

.metric > .mini-chart,
.metric > .mini-bars {
  position: absolute;
  z-index: 1;
  right: 18px;
  top: 96px;
  width: 90px;
  height: 54px;
}

.mini-chart polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.mini-bars rect {
  fill: currentColor;
  opacity: .34;
}

.progress-track {
  position: relative;
  height: 9px;
  margin: 7px 0 17px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress-track span,
.progress-track b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: currentColor;
}

.progress-track b {
  background: var(--amber);
}

.executive-brief {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #53657f;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-xs);
}

.executive-brief > span {
  width: 17px;
  height: 17px;
  color: #64748b;
}

.executive-brief svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.executive-brief p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.executive-scope {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.executive-scope span,
.tag {
  display: inline-flex;
  max-width: 240px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #2d4767;
  background: #f8fbff;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.signature-card,
.portfolio-card,
.action-rail,
.advanced-details,
.raw-details,
.evidence-panel,
.confidence-column {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
}

.signature-card,
.portfolio-card {
  padding: 16px;
}

.ledger-stage {
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.ledger-labels {
  display: grid;
  grid-template-columns: 1.15fr repeat(6, minmax(100px, 1fr));
  gap: 12px;
  padding: 0 10px;
  color: #14213a;
  font-size: 11px;
  font-weight: 800;
}

.relationship-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr repeat(6, minmax(100px, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  padding: 8px 4px;
}

.relationship-row::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .72), transparent);
  transform: translateY(-50%);
  pointer-events: none;
}

.relationship-node {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}

.relationship-node:hover,
.relationship-node:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, .42);
  box-shadow: var(--shadow-md);
}

.relationship-node i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--blue);
}

.relationship-node i svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.relationship-node span,
.relationship-node small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.relationship-node strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.relationship-node.app-node {
  border-color: rgba(37, 99, 235, .64);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12), var(--shadow-sm);
}

.relationship-node.critical {
  border-color: rgba(239, 68, 68, .44);
}

.ledger-confidence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #526482;
  font-size: 12px;
}

.portfolio-table-wrap,
.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.portfolio-table {
  min-width: 920px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f6fb;
  color: #14213a;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

th button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-weight: 900;
}

tr:last-child td {
  border-bottom: 0;
}

td {
  color: #33435a;
  overflow-wrap: anywhere;
}

td small,
.portfolio-row small {
  display: block;
  margin-top: 3px;
  color: #718099;
  font-size: 11px;
  line-height: 1.25;
}

td.num {
  font-variant-numeric: tabular-nums;
}

.clickable-row,
.clickable-card,
.clickable-table-row,
.relationship-node {
  cursor: pointer;
}

.clickable-table-row {
  transition: background .18s var(--ease), box-shadow .18s var(--ease);
}

.clickable-table-row:hover td,
.clickable-table-row:focus-visible td {
  background: #f8fbff;
}

.app-name-cell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.app-avatar,
.action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--blue);
  background: var(--blue-soft);
}

.app-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.app-avatar svg,
.action-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.app-avatar.bad,
.action-icon.bad {
  color: var(--red);
  background: var(--red-soft);
}

.app-avatar.warn,
.action-icon.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.app-avatar.ok,
.action-icon.ok {
  color: var(--green);
  background: var(--green-soft);
}

.app-name-cell strong {
  display: block;
  overflow-wrap: anywhere;
}

.health-meter {
  display: grid;
  grid-template-columns: minmax(66px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.health-line {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.health-line b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.risk-chip {
  display: inline-flex;
  margin-right: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.risk-chip.ok { color: #087337; background: var(--green-soft); }
.risk-chip.warn { color: #9a5805; background: var(--amber-soft); }
.risk-chip.bad { color: #b91c1c; background: var(--red-soft); }

.success-text {
  color: #087337;
}

.danger-text {
  color: #dc2626;
}

.mobile-app-cards {
  display: none;
}

.portfolio-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #526482;
  font-size: 12px;
}

.action-rail {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 116px);
  padding: 16px;
  overflow: auto;
}

.action-room-head {
  margin-bottom: 0;
}

.view-all-link {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.action-tab {
  min-height: 28px;
  padding: 5px 9px;
  color: #35506f;
  font-size: 12px;
}

.action-tab span {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}

.action-tab.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.action-tab.active span {
  background: rgba(255, 255, 255, .18);
}

.action-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.action-card[open],
.action-card:hover {
  border-color: rgba(37, 99, 235, .22);
  box-shadow: var(--shadow-sm);
}

.action-card summary,
.advanced-details summary,
.raw-details summary,
.evidence-panel summary {
  cursor: pointer;
  list-style: none;
}

.action-card summary::-webkit-details-marker,
.advanced-details summary::-webkit-details-marker,
.raw-details summary::-webkit-details-marker,
.evidence-panel summary::-webkit-details-marker {
  display: none;
}

.action-card summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px;
}

.action-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.action-card strong,
.action-card small,
.action-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-card summary strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.action-card summary small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: #66758f;
  font-size: 11px;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.action-body {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px 56px;
}

.action-body p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.action-unlock {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  color: #1d4ed8;
  background: linear-gradient(180deg, #f7fbff, #eef5ff);
  font-size: 12px;
}

.action-unlock span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 10px;
  margin-right: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.cost-reconciliation-panel {
  display: grid;
  gap: 18px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .92)),
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .08), transparent 28%);
  box-shadow: var(--shadow-sm);
}

.reconciliation-head,
.reconciliation-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reconciliation-head h3 {
  margin: 3px 0 6px;
  font-size: 22px;
  line-height: 1.1;
}

.reconciliation-head p,
.reconciliation-note {
  margin: 0;
  color: var(--muted);
}

.reconciliation-note {
  padding-top: 4px;
  font-size: 12px;
}

.finance-equation {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.finance-term {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .76);
}

.finance-term span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.finance-term strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  line-height: 1;
}

.finance-operator {
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 24px;
  font-weight: 800;
}

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

.scope-reconciliation-grid article,
.attribution-card,
.context-callout {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.scope-reconciliation-grid article {
  padding: 14px;
}

.scope-reconciliation-grid span,
.attribution-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.scope-reconciliation-grid strong,
.attribution-total strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.scope-reconciliation-grid p,
.context-callout p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.attribution-gaps-panel {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(245, 158, 11, .32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 251, 235, .68)),
    radial-gradient(circle at 100% 0, rgba(245, 158, 11, .12), transparent 28%);
  box-shadow: var(--shadow-sm);
}

.attribution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.attribution-head h3 {
  margin: 3px 0 6px;
  font-size: 21px;
}

.attribution-head p {
  margin: 0;
  color: var(--muted);
}

.attribution-total {
  min-width: 180px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
}

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

.attribution-card {
  cursor: pointer;
  padding: 14px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.attribution-card:hover,
.attribution-card:focus-visible {
  border-color: rgba(245, 158, 11, .45);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .10);
  transform: translateY(-2px);
}

.attribution-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attribution-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
}

.attribution-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.context-callout {
  margin-top: 12px;
  padding: 14px;
}

.context-callout.warn {
  border-color: rgba(245, 158, 11, .32);
  background: rgba(255, 251, 235, .74);
}

.reconciliation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr) minmax(220px, .8fr);
  gap: 14px;
}

.mini-chart-panel,
.top-cost-list {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}

.mini-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mini-chart-head strong,
.top-cost-list > strong {
  color: var(--ink);
}

.daily-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  align-items: end;
  gap: 8px;
  min-height: 150px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.daily-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  min-width: 0;
  height: 136px;
}

.daily-bar i {
  display: block;
  height: var(--bar-h);
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--blue-2), #1d4ed8);
  box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}

.daily-bar:hover i {
  transform: translateY(-3px);
}

.daily-bar small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.cost-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.cost-line span,
.cost-line small {
  min-width: 0;
}

.cost-line small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.cost-line:hover {
  color: var(--blue);
}

.empty.compact {
  padding: 12px;
  font-size: 12px;
}

.notice {
  min-width: 0;
  min-height: 110px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.notice.critical,
.notice.warning,
.notice.bad {
  border-left-color: var(--red);
}

.notice.info {
  border-left-color: var(--blue);
}

.notice strong,
.notice span,
.notice small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.notice span,
.notice small {
  color: var(--muted);
  font-size: 12px;
}

.notice p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.fix-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.approval-row {
  display: grid;
  gap: 6px;
  color: #526482;
  font-size: 12px;
}

.table-block {
  margin-top: 16px;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0 0 10px;
}

.table-controls label {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.row-count {
  margin-left: auto;
  padding: 10px 0;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #26384f;
  background: #f7fafc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.status-pill {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.status-pill.ok,
.mini-pill.ok {
  color: #087337;
  background: var(--green-soft);
}

.status-pill.warn,
.mini-pill.warn {
  color: #9a5805;
  background: var(--amber-soft);
}

.status-pill.bad,
.mini-pill.bad {
  color: #b91c1c;
  background: var(--red-soft);
}

.status-pill.neutral,
.mini-pill.neutral {
  color: #2559b8;
  background: var(--blue-soft);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, .76);
}

.muted {
  color: var(--muted);
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.confidence-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.confidence-column {
  padding: 15px;
}

.confidence-column ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.evidence-panel,
.advanced-details,
.raw-details {
  margin-top: 18px;
  overflow: hidden;
}

.advanced-details summary,
.raw-details summary,
.evidence-panel summary {
  padding: 15px 16px;
  font-weight: 800;
}

.advanced-details > div {
  margin: 0 14px 14px;
}

.status-grid-section {
  padding: 0 15px 15px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.status-strip div {
  min-height: 78px;
  padding: 13px 14px;
  background: #fff;
}

.status-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ledger-wrap table {
  min-width: 1100px;
}

.ledger-table td {
  min-width: 104px;
}

.ledger-table td span:not(.ledger-dot),
.ledger-table td small {
  display: block;
}

.ledger-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ledger-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.ledger-dot.visible {
  background: var(--green);
}

.ledger-dot.partial {
  background: var(--amber);
}

.ledger-dot.blocked {
  background: var(--red);
}

.ledger-dot.empty {
  background: var(--line-strong);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 0;
}

.compact-facts,
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.compact-facts div,
.detail-list div,
.drawer-node {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.compact-facts dt,
.detail-list dt,
.drawer-node span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-facts dd,
.detail-list dd,
.drawer-node strong,
.drawer-node small {
  display: block;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.detail-list dd {
  margin-left: 0;
  color: var(--text);
}

.app-health-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.app-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.app-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.app-card-head strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.app-card p,
.mapping-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.risk-ring {
  flex: 0 0 auto;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.risk-ring.ok { border-color: rgba(22, 163, 74, .65); color: var(--green); }
.risk-ring.warn { border-color: rgba(245, 158, 11, .62); color: var(--amber); }
.risk-ring.bad { border-color: rgba(239, 68, 68, .62); color: var(--red); }

pre {
  max-height: 620px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #1d3344;
  background: #f6f8fa;
  font-size: 12px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 20, 38, .24);
  backdrop-filter: blur(4px);
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 90;
  width: min(660px, 100vw);
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255, 255, 255, .98);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: drawer-in .28s var(--ease);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin-top: 5px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 24px;
}

.drawer-content {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px 22px 28px;
  overflow-y: auto;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drawer-grid .metric {
  min-height: 132px;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.drawer-finance {
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.microcopy {
  color: var(--muted) !important;
  font-size: 12px;
}

.drawer-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.mini-rows {
  display: grid;
  gap: 8px;
}

.mini-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  text-align: left;
}

button.mini-row {
  cursor: pointer;
}

.blocker-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: #fff;
}

.blocker-card.critical,
.blocker-card.bad {
  border-left-color: var(--red);
}

.blocker-card p,
.blocker-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

@keyframes drawer-in {
  from {
    opacity: .4;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-controls {
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(220px, 1fr) 40px auto;
  }

  .executive-page {
    grid-template-columns: 1fr;
  }

  .action-rail {
    position: relative;
    top: auto;
    max-height: none;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: relative;
    height: auto;
    grid-template-rows: auto auto auto;
    gap: 14px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-group {
    display: none;
  }

  nav a {
    grid-template-columns: 18px auto;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 10px;
  }

  .rail-status {
    max-width: 360px;
  }

  .metric-grid,
  .quality-grid,
  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-equation,
  .scope-reconciliation-grid,
  .reconciliation-grid,
  .attribution-cards {
    grid-template-columns: 1fr 1fr;
  }

  .finance-operator {
    display: none;
  }

  .ledger-labels {
    display: none;
  }

  .relationship-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relationship-row::before,
  .relationship-node::before,
  .relationship-node::after {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .rail {
    padding: 12px 14px;
  }

  .brand div span {
    display: none;
  }

  .rail-status {
    display: none;
  }

  nav {
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding-bottom: 6px;
    overscroll-behavior-inline: contain;
  }

  nav a span {
    max-width: 132px;
  }

  .topbar {
    position: relative;
    min-height: 0;
    padding: 16px 14px;
    gap: 14px;
  }

  h1 {
    font-size: 22px;
  }

  .executive-subtitle {
    margin-top: 5px;
    font-size: 12px;
  }

  .topbar-controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .account-control span {
    font-size: 9px;
  }

  .account-control select,
  .global-search input {
    min-height: 36px;
    padding: 7px 10px;
  }

  .account-control:nth-of-type(3),
  .global-search {
    grid-column: 1 / -1;
  }

  .icon-link,
  .primary-export {
    width: 100%;
  }

  .icon-link {
    height: 38px;
  }

  .executive-page {
    padding: 14px;
    width: 100%;
    min-width: 0;
  }

  .metric-grid,
  .notice-grid,
  .quality-grid,
  .status-strip,
  .confidence-columns,
  .finance-equation,
  .scope-reconciliation-grid,
  .reconciliation-grid,
  .attribution-cards,
  .drawer-grid,
  .drawer-path,
  .compact-facts,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .reconciliation-head,
  .reconciliation-note,
  .attribution-head {
    display: grid;
  }

  .daily-bars {
    grid-auto-columns: minmax(14px, 1fr);
    gap: 5px;
    overflow-x: auto;
  }

  .metric {
    min-height: 150px;
  }

  .executive-brief {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .executive-scope {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .section-toolbar {
    display: grid;
  }

  .section-actions,
  .portfolio-actions {
    justify-content: flex-start;
  }

  .section-actions select {
    width: 100%;
  }

  .relationship-row {
    grid-template-columns: 1fr;
  }

  .portfolio-table-wrap {
    display: none;
  }

  .table-wrap {
    max-width: calc(100vw - 28px);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-app-cards {
    display: grid;
    gap: 12px;
  }

  .portfolio-footer {
    display: grid;
  }

  .action-card summary {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .action-card summary .status-pill {
    grid-column: 2;
    width: max-content;
  }

  .action-body {
    padding-left: 12px;
  }

  .detail-drawer {
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  body {
    background: white;
  }

  .rail,
  .topbar,
  .action-rail,
  .status-grid-section,
  #relationshipMap,
  #project360,
  #costExposureCenter,
  #dataConfidence,
  #advancedInventory,
  #rawSection,
  .drawer-backdrop,
  .detail-drawer {
    display: none !important;
  }

  .app-shell,
  .executive-page {
    display: block;
  }

  .workspace,
  .main-stack {
    display: block;
    padding: 0;
  }

  .portfolio-card,
  .signature-card {
    box-shadow: none;
  }
}

/* Nilhan Cloud Ledger visual system: quiet white surfaces, ledger rules, one blue spine. */
:root {
  --bg: #f6f7f9;
  --paper: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #161a22;
  --text: #33415c;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --blue: #246bce;
  --blue-2: #4b89e8;
  --blue-soft: #edf4ff;
  --green: #2e8064;
  --green-soft: #eaf6f1;
  --amber: #c47a1b;
  --amber-soft: #fff5e5;
  --red: #c94a4a;
  --red-soft: #fff0f0;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .03);
  --shadow-md: 0 14px 32px rgba(16, 24, 40, .09);
  --radius: 10px;
  --radius-sm: 8px;
  --rail: 278px;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

.app-shell {
  grid-template-columns: var(--rail) minmax(0, 1fr);
}

.rail {
  position: sticky;
  padding: 26px 22px 20px;
  border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  gap: 11px;
  padding: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--blue);
  box-shadow: none;
}

.brand-mark svg { width: 25px; height: 25px; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand div span { color: var(--muted); font-size: 11px; }

nav { gap: 5px; }
.nav-group { margin: 22px 10px 7px; color: var(--faint); }
nav a {
  min-height: 42px;
  padding: 10px 11px;
  border-radius: 8px;
  color: #344054;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
nav a:hover { color: var(--blue); background: #f8faff; transform: none; }
nav a.active,
nav a[aria-current="page"] {
  color: var(--blue);
  background: #f2f6fd;
  box-shadow: inset 4px 0 0 var(--blue);
}
nav a::before { opacity: .92; }

.rail-status {
  padding: 12px 4px 0;
  border-top: 1px solid var(--line);
}
.rail-status strong { color: var(--ink); font-size: 12px; }
.rail-status small { color: var(--muted); }

.topbar {
  position: sticky;
  grid-template-columns: 1fr;
  gap: 18px;
  min-height: 0;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

h1 { font-size: 26px; letter-spacing: -.035em; }
.executive-subtitle { margin-top: 6px; color: var(--muted); font-size: 12px; }
.topbar-heading-row { display: flex; align-items: center; gap: 12px; }
.privacy-mode {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.topbar-controls {
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(200px, 1.2fr) 40px auto;
  gap: 12px;
  align-items: end;
}
.account-control span,
.table-controls span,
.metric-label,
.legend,
.row-count,
.portfolio-actions span,
.section-actions label {
  color: #475467;
  font-size: 10px;
  letter-spacing: .06em;
}
.account-control select,
.global-search input,
.section-actions select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}
.global-search input::placeholder { color: #98a2b3; }
.primary-export {
  min-height: 40px;
  min-width: 150px;
  border-color: var(--blue);
  border-radius: 7px;
  background: var(--blue);
  box-shadow: none;
  text-transform: none;
}
.primary-export:hover { background: #185bb7; }

.executive-page {
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
  padding: 20px 28px 52px;
}
.main-stack { gap: 16px; }
.board-band { gap: 16px; }
.section-toolbar { margin-bottom: 14px; }
.section-heading h2 { font-size: 17px; letter-spacing: -.02em; }
.section-heading p { color: var(--muted); font-size: 12px; }
.section-actions select { width: 198px; }

#executiveKpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
#executiveKpis .metric {
  min-height: 136px;
  padding: 0 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  grid-template-rows: auto auto auto;
  gap: 10px;
}
#executiveKpis .metric:first-child { padding-left: 0; }
#executiveKpis .metric:last-child { padding-right: 0; }
#executiveKpis .metric:not(:first-child) { border-left: 1px solid var(--line-strong); }
#executiveKpis .metric::before,
#executiveKpis .metric:hover,
#executiveKpis .metric:focus-visible { transform: none; border-color: inherit; box-shadow: none; }
#executiveKpis .metric-top { display: block; min-height: 0; }
#executiveKpis .metric-top .metric-icon,
#executiveKpis .metric-top .status-pill { display: none; }
#executiveKpis .metric-main {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  padding: 0;
}
#executiveKpis .metric strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.04em;
}
#executiveKpis .metric.ok strong { color: var(--green); }
#executiveKpis .metric.warn strong { color: var(--amber); }
#executiveKpis .metric.bad strong { color: var(--red); }
#executiveKpis .metric p {
  max-width: 235px;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}
#executiveKpis .metric > .mini-chart { display: none; }
#executiveKpis .metric:last-child > .mini-bars {
  top: 27px;
  right: 22px;
  width: 72px;
  height: 40px;
  color: var(--amber);
}
#executiveKpis .metric:last-child .metric-main { padding-right: 78px; }
#executiveKpis .progress-track { display: none; }

.executive-brief {
  min-height: 42px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.executive-brief p { color: var(--muted); font-size: 11px; }
.executive-scope span { color: #475467; background: #f8fafc; }

.signature-card,
.portfolio-card,
.action-rail {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.signature-card,
.portfolio-card { padding: 16px; }
.ledger-stage { gap: 16px; }
.ledger-labels,
.relationship-row {
  grid-template-columns: 1.1fr repeat(6, minmax(76px, 1fr));
  gap: 10px;
}
.ledger-labels { padding: 0 8px; color: #344054; font-size: 10px; }
.relationship-row { padding: 10px 4px; }
.relationship-row::before {
  left: 7%;
  right: 7%;
  height: 3px;
  background: var(--blue);
}
.relationship-node {
  min-height: 110px;
  padding: 12px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}
.relationship-node.app-node,
.relationship-node.critical {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.relationship-node:hover,
.relationship-node:focus-visible { transform: translateY(-2px); border-color: transparent; box-shadow: none; background: #f8faff; }
.relationship-node i {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #344054;
  background: #fff;
}
.relationship-node i svg { width: 22px; height: 22px; }
.relationship-node.app-node i {
  border: 2px solid var(--blue);
  color: var(--blue);
  background: #f8fbff;
}
.relationship-node.app-node.critical i { border-color: var(--blue); color: var(--blue); }
.relationship-node.critical i { border-color: var(--red); color: var(--red); }
.relationship-node span,
.relationship-node small { color: #667085; font-size: 10px; }
.relationship-node strong { color: var(--ink); font-size: 13px; }
.relationship-node.app-node strong { color: var(--blue); }
.relationship-row::before { top: 83px; transform: translateY(-50%); }
.ledger-confidence { padding: 2px 8px 0; color: var(--muted); font-size: 11px; }

.portfolio-card .section-toolbar { align-items: center; }
.portfolio-card .section-heading p { display: none; }
.portfolio-actions { align-items: center; }
.portfolio-actions span { text-transform: uppercase; }
.portfolio-table-wrap { border-radius: 7px; box-shadow: none; }
.portfolio-table { min-width: 760px; }
.portfolio-table th { background: #fafbfc; color: #344054; }
.portfolio-table th,
.portfolio-table td { padding: 11px 13px; border-color: var(--line); }
.portfolio-table td { color: #344054; }
.portfolio-table td:nth-child(3) strong { font-variant-numeric: tabular-nums; }
.portfolio-health { display: grid; grid-template-columns: 9px auto; gap: 7px; align-items: center; }
.portfolio-health small { grid-column: 2; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.health-dot.warn { background: var(--amber); }
.health-dot.bad { background: var(--red); }
.app-avatar { border-radius: 50%; }
.risk-chip { padding: 4px 10px; border-radius: 999px; }
.portfolio-footer { color: var(--muted); font-size: 11px; }

.action-rail {
  top: 98px;
  align-self: start;
  margin-top: 173px;
  max-height: calc(100vh - 120px);
  padding: 16px 18px;
}
.action-room-head { margin-bottom: 2px; }
.action-room-head h2 { font-size: 17px; }
.action-room-head p { font-size: 11px; }
.view-all-link { color: var(--blue); }
.action-list { gap: 0; }
.action-tabs { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.action-tab { border: 0; border-radius: 999px; background: #f8fafc; color: #475467; }
.action-tab.active { background: var(--blue); box-shadow: none; }
.action-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.action-card[open], .action-card:hover { border-color: var(--line); box-shadow: none; }
.action-card summary { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 13px 0; }
.action-icon { width: 22px; height: 22px; border-radius: 50%; }
.action-icon svg { width: 14px; height: 14px; }
.action-card summary strong { font-size: 12px; }
.action-card summary small { color: var(--muted); font-size: 11px; }
.action-body { padding: 0 0 14px 34px; }
.action-unlock { margin-top: 14px; padding: 12px; border: 0; border-radius: 7px; background: #f7f9fc; color: #475467; }
.grouped-action-note { padding: 9px 10px; border-left: 3px solid var(--blue); background: #f5f8ff; }

@media (min-width: 1281px) {
  .main-stack { display: contents; }
  #boardOverview { grid-column: 1 / -1; grid-row: 1; }
  #relationshipMap { grid-column: 1; grid-row: 2; }
  #actionRoom { grid-column: 2; grid-row: 2; margin-top: 0; }
  #applicationPortfolio { grid-column: 1 / -1; grid-row: 3; }
  #project360, #costExposureCenter, #dataConfidence, #advancedInventory, #rawSection { grid-column: 1 / -1; }
}

@media (max-width: 1280px) {
  .executive-page { grid-template-columns: minmax(0, 1fr); }
  .main-stack { display: contents; }
  #boardOverview { order: 1; }
  #relationshipMap { order: 2; }
  #actionRoom { order: 3; }
  #applicationPortfolio { order: 4; }
  #project360 { order: 5; }
  #costExposureCenter { order: 6; }
  #dataConfidence { order: 7; }
  #advancedInventory { order: 8; }
  #rawSection { order: 9; }
  .action-rail { position: relative; top: auto; margin-top: 0; max-height: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .rail {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    padding: 18px 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail nav {
    display: flex;
    gap: 4px;
    margin: 18px -20px 0;
    padding: 0 20px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
  }
  nav a { min-width: max-content; min-height: 47px; border-radius: 0; }
  nav a.active, nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--blue); }
  .rail-status { display: none; }
  .topbar { position: relative; padding: 26px 20px 18px; }
  h1 { font-size: 28px; }
  .topbar-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .global-search { grid-column: 1 / -1; }
  .topbar-controls .icon-link { display: none; }
  .primary-export { grid-column: 2; min-width: 0; }
  .executive-page { padding: 16px 14px 42px; }
  .signature-card, .portfolio-card { padding: 14px; }
  #executiveKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 22px 16px; gap: 0; }
  #executiveKpis .metric { min-height: 150px; padding: 0 14px 18px; }
  #executiveKpis .metric:first-child { padding-left: 0; }
  #executiveKpis .metric:last-child { padding-right: 0; }
  #executiveKpis .metric:nth-child(3), #executiveKpis .metric:nth-child(4) { padding-top: 18px; border-top: 1px solid var(--line-strong); }
  #executiveKpis .metric:nth-child(odd) { border-left: 0; }
  #executiveKpis .metric:nth-child(even) { border-left: 1px solid var(--line-strong); }
  #executiveKpis .metric strong { font-size: 30px; }
  #executiveKpis .metric p { max-width: none; }
  #executiveKpis .metric:last-child > .mini-bars { right: 0; top: 43px; width: 60px; }
  #executiveKpis .metric:last-child .metric-main { padding-right: 62px; }
  .executive-brief { display: block; padding: 12px; }
  .executive-brief > span { display: none; }
  .executive-scope { justify-content: flex-start; margin-top: 10px; }
  .section-toolbar { display: block; }
  .section-actions, .portfolio-actions { justify-content: flex-start; margin-top: 13px; }
  .section-actions select { width: 100%; }
  .ledger-labels { display: none; }
  .relationship-row { grid-template-columns: 1fr; gap: 0; padding: 12px 0; }
  .relationship-row::before { left: 28px; right: auto; top: 28px; bottom: 28px; width: 2px; height: auto; background: var(--blue); transform: none; }
  .relationship-node { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; min-height: 76px; padding: 10px 2px; text-align: left; }
  .relationship-node i { grid-row: 1 / 3; width: 44px; height: 44px; margin: 0; }
  .relationship-node span, .relationship-node strong, .relationship-node small { grid-column: 2; }
  .relationship-node span { grid-row: 1; }
  .relationship-node strong { grid-row: 2; }
  .relationship-node small { grid-row: 1 / 3; justify-self: end; align-self: center; max-width: 42%; text-align: right; }
  .relationship-node.app-node strong { grid-row: 1; align-self: end; }
  .relationship-node.app-node small { grid-row: 2; justify-self: start; align-self: start; max-width: none; text-align: left; }
  .ledger-confidence { display: grid; gap: 7px; margin-left: 52px; padding: 6px 0 0; }
  .portfolio-table-wrap { overflow-x: auto; }
  .portfolio-table { min-width: 720px; }
  .portfolio-actions .icon-segment { display: none; }
  .portfolio-footer { display: block; line-height: 1.5; }
}

@media print {
  .rail, .topbar, .action-rail { display: none !important; }
  .app-shell, .executive-page, .main-stack { display: block; }
  .executive-page { padding: 0; }
  #executiveKpis, .signature-card, .portfolio-card { box-shadow: none; }
}
