@charset "UTF-8";

:root {
  --ink: #192523;
  --muted: #566660;
  --subtle: #63716c;
  --line: #dce3df;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --green: #096b53;
  --green-light: #e9f5ef;
  --blue: #365bae;
  --blue-light: #eef2fc;
  --amber: #95500d;
  --amber-light: #fff4e3;
  --red: #b03339;
  --radius: 6px;
  --sidebar: 264px;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; line-height: 1.5; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
input, select, textarea { min-width: 0; border: 1px solid #aebcb5; border-radius: var(--radius); background: white; outline: none; }
input, select { height: 44px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; min-height: 94px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #096b531a; }
:focus-visible { outline: 3px solid #366cc4; outline-offset: 3px; }
::placeholder { color: #62716b; opacity: 1; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; font-weight: 650; line-height: 1.25; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { font-size: 19px; font-weight: 650; line-height: 1.4; }
h3 { font-size: 16px; font-weight: 650; margin: 24px 0 14px; }
strong { font-weight: 650; }
small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid #bac7c0; background: white; border-radius: var(--radius); padding: 9px 14px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.35; transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover { background: #f1f5f3; border-color: #819b8d; }
.button.primary { color: white; background: var(--green); border-color: var(--green); box-shadow: 0 2px 3px #173b2314; }
.button.primary:hover { background: #07573f; border-color: #07573f; }
.button.selected { color: var(--green); background: var(--green-light); border-color: #70a88f; }
.button svg { width: 18px; height: 18px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-width: 40px; border-radius: 6px; color: #485f54; flex-shrink: 0; }
.icon-button:hover { background: #e8f0ec; color: #17482f; }
.text-button { padding: 0; text-align: left; color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 14px; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.help-trigger { width: 28px; height: 28px; min-width: 28px; padding: 4px; color: #546e62; border-radius: 50%; display: inline-grid; place-items: center; vertical-align: middle; }
.help-trigger svg { width: 16px; height: 16px; }
.help-trigger:hover, .help-trigger:focus { background: #e0eee6; color: #174b33; }
.context-help { position: fixed; inset: auto; margin: 0; width: 360px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 16px 18px; background: #11281e; color: #f0fdf4; border: 1px solid #2d6a50; border-radius: 8px; font-size: 13.5px; line-height: 1.55; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(52, 211, 153, 0.25); z-index: 2500; }

#app { display: flex; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 25; display: flex; flex-direction: column; padding: 26px 16px 0; background: #ffffff; border-right: 1px solid var(--line); }
.sidebar-backdrop { display: none; }
.mobile-sidebar-close { display: none; }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 29px; }
.sidebar-brand-row .brand { margin-bottom: 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 0 10px; margin-bottom: 29px; line-height: 1; }
.brand-text {
  display: inline-flex;
  align-items: baseline;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 21.5px;
  line-height: 1;
  letter-spacing: -0.035em;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  user-select: none;
}
.brand-name {
  display: inline-flex;
  align-items: baseline;
}
.brand-true {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.025em;
}
.brand-stock {
  font-weight: 800;
  color: #047857;
  letter-spacing: -0.036em;
  transition: color 0.2s ease;
}
.brand-tld {
  display: inline-flex;
  align-items: baseline;
  color: #10b981;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.brand-dot {
  color: #10b981;
  font-weight: 800;
  margin: 0 0.5px;
  transition: color 0.2s ease;
}
.brand-mark { display: grid; place-items: center; width: 34px; height: 36px; flex-shrink: 0; }
.brand-mark svg, .brand-symbol-svg { width: 34px; height: 34px; display: block; transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease; }
.brand:hover .brand-symbol-svg { transform: translateY(-1.5px) scale(1.05); filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.42)); }
.brand:hover .brand-stock { color: #022c22; }
.brand:hover .brand-tld { color: #059669; }
.brand:hover .brand-dot { color: #34d399; }
.workspace-switch { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 12px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9f8; margin-bottom: 26px; }
.workspace-switch > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-switch strong { font-size: 14px; line-height: 1.3; display: block; overflow-wrap: anywhere; }
.workspace-switch small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.workspace-switch > svg { width: 16px; height: 16px; color: #586c61; }
.company-avatar { display: grid; place-items: center; width: 34px; height: 36px; min-width: 34px; background: #e4ece8; color: #215b43; border-radius: 6px; font-size: 15px; font-weight: 650; }
.sidebar nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-caption { color: #576b60; font-size: 12px; text-transform: uppercase; font-weight: 650; padding: 0 12px; margin: 0 0 10px; }
nav .nav-caption { margin-top: 22px; }
nav .nav-caption:first-child { margin-top: 0; }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; font-size: 14px; color: #43574c; border-radius: 6px; position: relative; }
.nav-item > svg { width: 20px; height: 20px; color: #63776c; flex-shrink: 0; }
.nav-item > span:first-of-type { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.nav-item:hover { color: #153c29; background: #f0f5f2; }
.nav-item.active { color: #075b43; background: #e6f3eb; font-weight: 650; }
.nav-item.active::before { content: ""; width: 3px; height: 24px; border-radius: 2px; background: var(--green); position: absolute; left: 0; top: calc(50% - 12px); }
.nav-item.active > svg { color: var(--green); }
.nav-tag { font-size: 10.5px; font-weight: 700; color: #4a5568; background: #edf2f7; border: 1px solid #cbd5e0; border-radius: 4px; padding: 1px 5px; line-height: 1.2; flex-shrink: 0; margin-left: auto; letter-spacing: 0.03em; }
.nav-count { font-size: 12px; font-weight: 650; background: #cce8d9; color: #145b3b; border-radius: 4px; min-width: 23px; text-align: center; padding: 1px 5px; flex-shrink: 0; margin-left: auto; }
.nav-separator { height: 1px; background: var(--line); margin: 22px 10px 14px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.database-status { font-size: 12px; color: #476453; display: flex; gap: 8px; align-items: center; margin: 14px 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.database-status .status-dot { background: #18815c; }
.sidebar-version-badge { border-top: 1px solid var(--line); display: flex; align-items: center; padding: 14px 10px; }
.sidebar-version-badge .version-label { font-size: 11.5px; font-weight: 650; color: #476453; background: #eef4f1; border: 1px solid #d4e2da; border-radius: 5px; padding: 3px 8px; letter-spacing: 0.02em; display: inline-block; }
.user-profile { border-top: 1px solid var(--line); display: flex; gap: 11px; align-items: center; padding: 17px 10px; }
.user-avatar { background: #ebeff6; width: 38px; height: 38px; border: 2px solid #fff; display: grid; place-items: center; border-radius: 50%; color: #385d92; font-weight: 650; }
.user-profile strong { display: block; font-size: 14px; }
.user-profile small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.app-body { margin-left: var(--sidebar); min-width: 0; flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.topbar { height: 72px; min-height: 72px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.breadcrumb > span { color: var(--muted); }
.breadcrumb strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb svg { width: 14px; height: 14px; color: #75887c; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.global-search { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #53695d; background: #f5f7f6; border: 1px solid #e0e6e2; border-radius: 6px; min-height: 38px; padding: 0 12px; }
.global-search svg { width: 17px; height: 17px; }
#language { font-size: 13px; font-weight: 600; height: 38px; border-color: transparent; padding: 0 6px; }
.copilot-toggle { background: #f3f6fe; color: #334f99; border-color: #cdd8ee; }
#mobile-menu { display: none; }
.workspace-body { display: flex; flex: 1; align-items: stretch; min-width: 0; }
main { min-width: 0; flex: 1; padding: 30px 28px 34px; container-type: inline-size; }
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 24px;
  margin-bottom: 28px;
  padding: 24px 28px;
  border: 1px solid #e0e7e3;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(20, 47, 34, .035), 0 1px 2px rgba(20, 47, 34, .025);
}
.page-heading > div:first-child { min-width: 0; }
.page-heading .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #47705d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: 9px;
}
.page-heading .eyebrow::before { content: ""; width: 18px; height: 2px; background: #248366; }
.page-heading h1 { margin: 0; color: #172e24; font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
/* One continuous explanation, with a comfortable reading width. */
.page-purpose {
  grid-column: 1 / -1;
  min-width: 0;
  position: relative;
  padding: 20px 24px 20px 28px;
  border: 1px solid #e6eee9;
  border-radius: 10px;
  background: linear-gradient(110deg, #f2f7f4, #f8faf9);
}
.page-purpose::before {
  content: "";
  position: absolute;
  inset: 20px auto 20px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #37836a;
}
.purpose-text {
  margin: 0;
  max-width: 90ch;
  color: #34483d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: normal;
  text-wrap: pretty;
}
.page-purpose--dark {
  margin: 24px 0 28px;
  border-color: rgba(167, 213, 192, .16);
  background: rgba(255, 255, 255, .045);
}
.page-purpose--dark::before { background: #7bb99d; }
.page-purpose--dark .purpose-text { color: #deebe3; }
@container (max-width: 720px) {
  .page-heading { padding: 24px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .page-heading .heading-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .page-heading { padding: 22px 20px; border-radius: 12px; }
  .page-purpose { padding: 16px 18px 16px 22px; border-radius: 8px; }
  .page-purpose::before { top: 16px; bottom: 16px; }
  .purpose-text { font-size: 14px; line-height: 1.65; }
}
.heading-actions { flex-shrink: 0; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 7px; text-transform: uppercase; line-height: 1.5; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--line); font-size: 12px; color: #526759; background: #fff; }
.app-footer > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.app-footer svg { width: 15px; height: 15px; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #4b6cb7; }

/* Comparison Sub-Tab Segment Switcher (Bestandsabgleich vs. Warenbewegungsabgleich) */
.comparison-mode-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  background: #edf3ef;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #d4dfd8;
  max-width: 100%;
  box-sizing: border-box;
}

.comp-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  color: #385244;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  min-width: 0;
  box-sizing: border-box;
}

.comp-mode-btn:hover {
  color: #096b53;
  background: rgba(255, 255, 255, 0.65);
}

.comp-mode-btn.active {
  color: #096b53;
  background: #ffffff;
  border-color: #c7d8ce;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.comp-mode-btn svg {
  width: 17px;
  height: 17px;
}

.mode-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  line-height: 1.3;
}

.mode-badge.green {
  background: #dcfce7;
  color: #15803d;
}

.mode-badge.amber {
  background: #fef3c7;
  color: #b45309;
}

.transaction-ref-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transaction-ref-cell strong {
  font-size: 13px;
  color: #172c21;
}

.transaction-kind-badge {
  font-size: 12px;
  width: fit-content;
}

.movement-locations-path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.movement-locations-path .location-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #315140;
}

.movement-locations-path .path-arrow {
  color: #8da497;
  display: inline-flex;
}

.movement-locations-path .path-arrow svg {
  width: 13px;
  height: 13px;
}

.metrics-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; background: #fff; min-width: 0; }
.metric { position: relative; min-width: 0; padding: 20px 22px 22px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-top { display: flex; align-items: center; justify-content: space-between; min-height: 38px; margin-bottom: 13px; }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; color: var(--blue); background: var(--blue-light); }
.metric-icon.green { color: var(--green); background: var(--green-light); }
.metric-icon.amber { color: var(--amber); background: var(--amber-light); }
.metric-icon.muted { color: #536979; background: #edf1f5; }
.metric-label { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 20px; color: #465c50; }
.metric-value { font-size: 34px; font-weight: 650; line-height: 1.2; margin: 6px 0 9px; font-variant-numeric: tabular-nums; color: #1b2921; }
.metric-value.amber { color: var(--amber); }
.metric-value.green { color: var(--green); }
.metric-value.muted { color: #4c6272; }
.metric-note { color: var(--muted); font-size: 12px; line-height: 1.5; }

.table-section { background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; max-width: 100%; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 20px 18px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.section-heading h2 > svg { color: #536f5e; }
.section-heading > div { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.section-title > div { min-width: 0; }
.section-meta { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.section-symbol { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green); background: var(--green-light); border-radius: 6px; }
.section-count { font-size: 12px; color: #476151; background: #edf2ee; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.comparison-context { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 22px; }
.context-systems { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.context-system { display: flex; gap: 10px; align-items: center; min-width: 0; }
.context-system strong { font-size: 14px; display: block; max-width: 225px; overflow-wrap: anywhere; }
.context-system small { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }
.context-arrow { color: #718778; width: 18px; height: 18px; margin-left: 14px; }
.system-avatar { width: 40px; height: 42px; min-width: 40px; border: 1px solid #c5dfd3; background: #eaf5ee; border-radius: 6px; display: grid; place-items: center; color: #276b4b; font-size: 15px; font-weight: 650; }
.system-1 { background: #edf2fc; color: #385fb0; border-color: #d3ddf1; }
.system-2 { background: #f5eff9; color: #795395; border-color: #e2d7eb; }
.comparison-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 20px 18px; gap: 16px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.filter-tab { display: flex; gap: 8px; align-items: center; padding: 9px 12px; min-height: 42px; color: #506658; font-size: 14px; border: 1px solid transparent; border-radius: 5px; line-height: 1.4; font-weight: 600; }
.filter-tab.active { background: #eaf4ee; color: #0a6447; border-color: #c8dfd0; }
.filter-tab span { font-size: 12px; background: #eff3f0; color: #4d6757; min-width: 22px; text-align: center; padding: 1px 4px; border-radius: 4px; }
.filter-tab.active span { background: #cfe7da; color: #125735; }
.filter-tab:hover { background: #f0f5f2; }
.search-field { display: flex; align-items: center; gap: 9px; border: 1px solid #bfcac3; background: #fff; border-radius: 6px; min-width: 150px; width: 250px; max-width: 100%; padding-left: 12px; height: 42px; }
.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #096b5314; }
.search-field svg { width: 18px; height: 18px; color: #5a7564; }
.search-field input { border: 0; background: none; box-shadow: none; height: 38px; padding: 0 9px 0 0; font-size: 14px; width: 100%; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar > select { height: 42px; font-size: 14px; max-width: 290px; }
.table-scroll { overflow-x: auto; width: 100%; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #92ab9c #f0f4f1; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table th { font-size: 13px; font-weight: 600; color: #475f50; text-align: left; background: #f1f5f2; border-top: 1px solid #e0e7e1; border-bottom: 1px solid #d7e1d9; padding: 14px 16px; line-height: 1.5; }
.data-table td { padding: 15px 16px; border-bottom: 1px solid #e5ebe6; vertical-align: middle; line-height: 1.5; background: #fff; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f1f7f3; }
.data-table tbody tr.different td:first-child { border-left: 3px solid #c07925; padding-left: 13px; }
.data-table td:first-child, .data-table th:first-child { padding-left: 20px; }
.data-table td:last-child, .data-table th:last-child { padding-right: 20px; }

/* Table Column Alignments */
.data-table th.numeric,
.data-table th.text-right,
.data-table th.quantity-cell,
.data-table th.system-col {
  text-align: right;
}
.data-table td.numeric,
.data-table td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table td.numeric .cell-sub,
.data-table td.numeric small {
  text-align: right;
  margin-left: auto;
}
.data-table th.text-center,
.data-table td.text-center {
  text-align: center;
}

/* Arrow Column between From and To */
.data-table th.arrow-col,
.data-table td.arrow-col {
  text-align: center;
  width: 32px;
  min-width: 32px;
  max-width: 36px;
  padding: 14px 4px;
}
.data-table td.arrow-col svg.table-arrow {
  display: inline-block;
  vertical-align: middle;
  margin: 0 auto;
}

/* Action Column on far right */
.data-table th.actions-col,
.data-table td.actions-col {
  text-align: right;
  width: 56px;
  min-width: 56px;
  padding-right: 20px;
}
.data-table td.actions-col .icon-button,
.data-table td.actions-col button {
  margin-left: auto;
}
.comparison-table { min-width: 1040px; }
.comparison-table th:first-child { width: 22%; min-width: 200px; }
.comparison-table th:nth-child(2) { min-width: 100px; }
.comparison-table th:nth-child(3) { min-width: 110px; }
.comparison-table td:first-child, .comparison-table th:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 #e3e9e5; }
.comparison-table th:has(.system-column) { text-align: right; min-width: 114px; }
.comparison-table th.status-col,
.comparison-table td.status-cell {
  width: 135px;
  min-width: 135px;
  text-align: left;
  white-space: nowrap;
}
.comparison-table th.comparison-actions-col,
.comparison-table td.comparison-actions-cell {
  width: 130px;
  min-width: 130px;
  text-align: right;
  padding-right: 20px;
  white-space: nowrap;
}
.system-column span { display: block; max-width: 180px; overflow-wrap: anywhere; margin-left: auto; color: #334f3e; }
.system-column small { font-size: 12px; color: #5c7063; font-weight: 400; display: block; margin-top: 4px; }
.article-cell { display: flex; align-items: center; gap: 12px; padding: 0; text-align: left; min-width: 0; color: inherit; max-width: 300px; }
.article-cell > span:last-child { min-width: 0; }
.article-cell strong { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.article-cell small { display: block; color: #526b5b; font-size: 13px; line-height: 1.4; margin-top: 4px; max-width: 220px; overflow-wrap: anywhere; }
.article-cell:hover strong { color: var(--green); text-decoration: underline; }
.article-thumb { width: 40px; height: 42px; min-width: 40px; border: 1px solid #d5e0d8; border-radius: 6px; display: grid; place-items: center; background: #f0f5f1; color: #496e55; }
.article-thumb svg { width: 23px; height: 23px; stroke-width: 1.6; }
.article-thumb.motor, .article-thumb.module { color: #386b7c; background: #edf5f7; }
.article-thumb.case, .article-thumb.thermal { color: #845a31; background: #f9f3e9; }
.article-thumb.battery, .article-thumb.connector { color: #3b754f; background: #edf7ef; }
.article-thumb.sensor, .article-thumb.valve { color: #496ba6; background: #f0f4fc; }
.location-code { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #496253; white-space: nowrap; }
.location-code svg { width: 15px; height: 15px; }
.stock-type { font-size: 13px; color: #475f50; }
.cell-sub { display: block; font-size: 12px; color: #58705f; margin-top: 5px; max-width: 250px; overflow-wrap: anywhere; }
.quantity-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quantity-cell > span { font-size: 16px; font-weight: 650; }
.cell-unit { font-size: 12px; color: #526b5a; margin-left: 4px; }
.delta { display: block; color: #5e7565; font-size: 12px; margin-top: 4px; line-height: 1.35; }
.delta.nonzero { color: #965212; font-weight: 650; }
.missing-value { color: #5b7163; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.4; border-radius: 4px; padding: 5px 8px; background: #edf2ee; color: #4c6353; white-space: nowrap; font-weight: 600; }
.badge svg { width: 14px; height: 14px; }
.badge.different, .badge.amber, .badge.conditional, .badge.incomplete, .badge.timing_lag { background: #fff1dd; color: #8d4d0f; }
.badge.equal, .badge.complete, .badge.allowed { background: #e7f5ec; color: #176342; }
.badge.missing, .badge.missing_counterpart, .badge.incomparable, .badge.unknown, .badge.preview, .badge.duplicate { background: #edf1f6; color: #4c6279; }
.badge.invalid, .badge.prohibited { background: #fdecee; color: #a32d36; }
.badge.value { background: #edf1fd; color: #36559c; }
.badge.demo { background: #f0edf9; color: #694f92; border: 1px solid #dfd8ef; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 14px 20px; color: #506959; font-size: 13px; }
.table-footer > div { display: flex; align-items: center; gap: 8px; }
.table-footer .icon-button { width: 34px; height: 34px; min-width: 34px; border: 1px solid #cedbd0; background: white; }
.table-footer .icon-button svg { width: 18px; height: 18px; }
.comparison-footnote { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: #536a5b; margin-top: 14px; }
.comparison-footnote > span { display: flex; align-items: center; gap: 7px; }
.comparison-footnote > span > svg { width: 16px; height: 16px; }
.comparison-legend { margin-top: 18px; border-top: 1px solid var(--line); }
.legend-definitions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 12px 0 8px; }
.legend-definitions p { margin: 10px 0 0; font-size: 13px; color: #4d6655; }
.mobile-comparison-list { display: none; }

.reconciliation-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; margin-bottom: 26px; }
.reconciliation-body { display: grid; grid-template-columns: minmax(180px,1fr) minmax(0,2.4fr); gap: 32px; padding: 4px 22px 24px; align-items: center; }
.match-ratio { border-right: 1px solid var(--line); padding-right: 22px; min-width: 0; }
.ratio-label { color: #4b6454; font-size: 13px; }
.match-ratio > div { display: flex; gap: 10px; align-items: baseline; margin: 6px 0 5px; }
.match-ratio strong { font-size: 32px; color: var(--green); line-height: 1.1; }
.match-ratio > div > span { font-size: 20px; color: #5a6f61; }
.scope-label { display: block; color: #596e60; font-size: 12px; overflow-wrap: anywhere; }
.result-distribution { min-width: 0; }
.distribution-bar { display: flex; gap: 4px; height: 24px; overflow: hidden; border-radius: 4px; background: #edf1ee; }
.distribution-segment { min-width: 8px; padding: 0; transition: filter .15s; }
.distribution-segment:hover { filter: brightness(.9); }
.distribution-segment.equal { background: #228162; }
.distribution-segment.different { background: #db9a42; }
.distribution-segment.gaps { background: #879ab5; }
.distribution-legend { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.distribution-label { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 4px 6px; padding: 0; text-align: left; font-size: 13px; color: #465e4f; }
.distribution-label svg { width: 17px; height: 17px; }
.distribution-label strong { grid-column: 2; font-size: 19px; color: #243c2c; }
.distribution-label.equal svg { color: var(--green); }
.distribution-label.different svg { color: var(--amber); }
.distribution-label.gaps svg { color: #4f678b; }
.distribution-label:hover > span { text-decoration: underline; }
.no-comparison-state { display: flex; align-items: center; gap: 14px; color: #546b5c; padding: 10px 22px 28px; }
.systems-section { margin-bottom: 28px; min-width: 0; }
.systems-section .section-heading { padding: 0 0 16px; }
.systems-section .section-title { gap: 12px; }
.system-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.system-card { border: 1px solid #d6e0d9; border-radius: 6px; background: #fff; padding: 18px; min-width: 0; }
.system-card > header { display: flex; align-items: center; gap: 11px; }
.system-card > header > div { flex: 1; min-width: 0; }
.system-card h3 { font-size: 15px; overflow-wrap: anywhere; margin: 0 0 2px; }
.system-role { color: #5e7264; font-size: 12px; }
.system-card .icon-button { width: 30px; min-width: 30px; height: 34px; }
.system-state { margin: 17px 0 16px; }
.system-card dl { margin: 0 0 15px; }
.system-card dt { font-size: 12px; color: #617469; margin-bottom: 3px; }
.system-card dd { font-size: 14px; font-weight: 600; margin: 0; color: #2b4534; }
.system-card footer { padding-top: 14px; border-top: 1px solid #e2e9e3; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #4b6654; }
.system-card footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.system-card footer svg { width: 16px; height: 16px; }
.file-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #5a7061; }
.overview-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(245px,1fr); gap: 28px; }
.activity-section { padding: 18px 0 0 22px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.activity-section h2 { display: flex; gap: 9px; align-items: center; font-size: 18px; margin-bottom: 22px; }
.activity-section h2 > svg { color: #587365; }
.activity-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.activity-icon { width: 32px; height: 34px; min-width: 32px; display: grid; place-items: center; border: 1px solid #d5e1d8; background: #f2f6f3; border-radius: 6px; color: #396d4e; }
.activity-icon svg { width: 17px; height: 17px; }
.activity-item strong { font-size: 14px; display: block; }
.activity-item small, .activity-source { display: block; font-size: 12px; color: #566e5d; margin-top: 4px; }

.view-tabs { display: flex; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow: auto; scrollbar-width: thin; }
.view-tabs button { padding: 12px 0 14px; border-bottom: 3px solid transparent; color: #556c5c; font-size: 14px; font-weight: 600; white-space: nowrap; }
.view-tabs button.active { color: var(--green); border-bottom-color: var(--green); }
.projection-bar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 4px 0 24px; }
.projection-bar .field { min-width: 220px; max-width: 370px; }
.projection-bar > div { display: flex; flex-direction: column; gap: 7px; }
.projection-bar small { font-size: 12px; color: var(--muted); }
.source-cell { display: flex; align-items: center; gap: 10px; }
.source-cell strong { font-size: 14px; overflow-wrap: anywhere; }
.file-name { display: flex; gap: 9px; align-items: center; font-size: 14px; overflow-wrap: anywhere; max-width: 300px; }
.file-name svg { color: #34724f; width: 19px; height: 19px; }
.table-arrow { width: 18px; height: 18px; color: #64806e; }
.version-label { display: inline-block; font-size: 12px; color: #365f49; background: #edf5ef; border: 1px solid #cbdcce; padding: 2px 7px; border-radius: 4px; }
.empty-state, .loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 220px; padding: 32px; text-align: center; color: #526e5b; font-size: 15px; }
.empty-state > svg { width: 36px; height: 36px; stroke-width: 1.5; color: #558066; }
.empty-state p { margin: 0; }
.blank-workspace { min-height: 380px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border-top: 1px solid var(--line); gap: 16px; }
.blank-workspace > svg { width: 44px; height: 44px; color: #418364; }
.blank-workspace h2, .blank-workspace p { margin: 0; }
.blank-workspace p { color: var(--muted); }
.spinner { display: block; width: 26px; height: 26px; border: 3px solid #dce8df; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border: 1px solid #cfddd1; background: #f1f7f2; margin-bottom: 22px; border-radius: 6px; font-size: 14px; line-height: 1.6; }
.notice.warning { background: #fff6e8; border-color: #e5cb9e; color: #7d501d; }
.notice.danger { background: #fff0f0; border-color: #ebc1c4; color: #992b36; }
.demo-notice { background: #f2effa; border-color: #dcd5ef; color: #604789; align-items: center; }
.demo-notice strong, .demo-notice span { display: block; }
.demo-notice strong { font-size: 14px; }
.demo-notice span { font-size: 13px; color: #635877; margin-top: 3px; }
.demo-notice > svg { width: 26px; height: 26px; }

.analysis-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 28px; }
.scenario-list { padding: 6px 0; }
.scenario-list h2 { font-size: 14px; color: #4c6756; margin-bottom: 16px; }
.scenario { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 16px 12px; margin-bottom: 8px; border-bottom: 1px solid #dce5de; border-radius: 6px; color: #455f4e; }
.scenario.active { background: #e5f2ea; color: #145b3a; }
.scenario > span:nth-child(2) { flex: 1; min-width: 0; }
.scenario strong { display: block; font-size: 14px; }
.scenario small { display: block; font-size: 12px; color: #4c6f57; margin-top: 6px; }
.scenario > svg { width: 18px; height: 18px; }
.scenario-number { font-size: 12px; align-self: flex-start; padding-top: 2px; color: #637c69; }
.analysis-content { background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px; min-width: 0; }
.analysis-case-header h2 { font-size: 24px; margin: 4px 0 10px; }
.analysis-case-header .mono { font-size: 13px; color: #546e5c; }
.evidence-quantities { display: flex; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; margin: 25px 0; gap: 24px; flex-wrap: wrap; }
.evidence-quantities > div { flex: 1; min-width: 75px; }
.evidence-quantities span { font-size: 13px; color: #516d59; display: block; }
.evidence-quantities strong { display: block; font-size: 30px; font-weight: 650; margin-top: 7px; white-space: nowrap; }
.evidence-quantities small { margin-left: 6px; font-size: 13px; font-weight: 400; color: #526d5a; }
.evidence-delta { border-left: 1px solid var(--line); padding-left: 24px; color: #955419; }
.analysis-explanation { display: flex; gap: 14px; background: #edf6f1; padding: 20px; border-left: 3px solid #3d936c; margin: 20px 0 28px; }
.analysis-icon { color: #276944; }
.analysis-explanation p { font-size: 16px; line-height: 1.65; margin: 7px 0 12px; color: #234b34; }
.small-label { font-size: 12px; color: #466b52; }
.evidence-timeline { margin-top: 22px; padding-left: 10px; }
.evidence-timeline > div { position: relative; padding: 0 0 26px 25px; border-left: 2px solid #d1dfd3; }
.evidence-timeline > div:last-child { border: 0; }
.evidence-timeline time { display: block; font-size: 12px; color: #567460; margin-bottom: 5px; }
.evidence-timeline strong { display: block; font-size: 14px; color: #31573c; }
.evidence-timeline small { display: block; font-size: 13px; color: #526f5a; margin-top: 5px; }
.timeline-dot { position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #348761; outline: 3px solid white; }
.timeline-dot.outlined { background: white; border: 2px solid #4e8060; }
.next-check { display: flex; gap: 12px; padding: 20px 0 0; border-top: 1px solid var(--line); color: #375e42; }
.next-check strong { font-size: 14px; }
.next-check p { font-size: 14px; line-height: 1.65; margin: 7px 0 0; color: #4d6c55; }
.interpretation { display: flex; align-items: flex-start; gap: 12px; padding: 18px; margin: 16px 0; background: #eef3f8; border-left: 3px solid #657b97; color: #3c5473; }
.interpretation.different { background: #fff5e7; border-color: #bf8032; color: #80511c; }
.interpretation.equal { background: #eaf5ee; border-color: #29865e; color: #205e3b; }
.interpretation strong { font-size: 14px; }
.interpretation p { font-size: 14px; margin: 5px 0 0; }
.detail-time-zone { display: flex; align-items: center; gap: 7px; color: #546f5c; font-size: 12px; margin: 18px 0; }

.copilot-panel { display: none; width: 360px; flex: 0 0 360px; border-left: 1px solid var(--line); background: white; flex-direction: column; height: calc(100dvh - 72px); position: sticky; top: 0; min-width: 0; }
.copilot-panel.open { display: flex; }
.copilot-header { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; border-bottom: 1px solid #e4e9ee; }
.copilot-header > div { flex: 1; }
.copilot-header strong { font-size: 17px; display: block; }
.copilot-header small { font-size: 12px; color: #55657f; display: block; margin-top: 3px; }
.copilot-symbol { width: 40px; height: 42px; background: #edf1fc; color: #3c5da4; display: grid; place-items: center; border-radius: 6px; }
.copilot-context { display: flex; gap: 8px; align-items: center; margin: 16px 20px; padding: 10px; background: #f2f5fa; border-radius: 4px; font-size: 13px; color: #47617c; }
.copilot-context svg { width: 16px; height: 16px; }
.chat-messages { padding: 0 20px; overflow-y: auto; flex: 1; min-height: 110px; scrollbar-width: thin; }
.assistant-message, .user-message { font-size: 15px; line-height: 1.7; margin-bottom: 20px; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-message { color: #354e42; }
.user-message { background: #edf2fa; padding: 13px; border-radius: 6px; color: #344d75; }
.action-draft { border: 1px solid #c9d7ed; background: #f5f8fd; border-radius: 6px; padding: 15px; margin-bottom: 18px; }
.action-draft .eyebrow { font-size: 12px; text-transform: none; color: #4b6188; }
.action-draft strong { display: block; font-size: 14px; margin-bottom: 12px; }
.action-draft .button { font-size: 13px; margin-top: 5px; }
.copilot-suggestions { display: grid; gap: 7px; padding: 16px 20px; }
.copilot-suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: 1px solid #d7e0ea; border-radius: 5px; font-size: 13px; color: #435f80; padding: 10px; min-height: 40px; }
.copilot-suggestions button:hover { background: #f0f5fd; }
.copilot-suggestions svg { width: 16px; height: 16px; }
#copilot-form { display: flex; border: 1px solid #aabbd5; border-radius: 6px; margin: 0 20px; align-items: flex-end; background: #fff; padding: 9px; }
#copilot-form:focus-within { border-color: #416cb6; box-shadow: 0 0 0 3px #416cb617; }
#copilot-form textarea { border: 0; background: none; box-shadow: none; width: 100%; min-height: 50px; max-height: 110px; resize: none; padding: 2px; font-size: 14px; line-height: 1.7; }
#copilot-form .icon-button { background: #365fab; color: white; width: 34px; height: 34px; min-width: 34px; }
.copilot-disclosure { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 13px; font-size: 12px; color: #526684; }
.copilot-disclosure svg { width: 14px; height: 14px; }

dialog { padding: 0; border: 1px solid #b8cbbc; border-radius: 8px; max-height: 90dvh; width: 590px; max-width: calc(100% - 28px); color: var(--ink); box-shadow: 0 24px 85px #15292040; overflow: auto; }
dialog::backdrop { background: #142a244a; backdrop-filter: blur(3px); }
dialog.wide-dialog { width: 1050px; }
#auth-dialog { width: 440px; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white; z-index: 3; }
.dialog-header h2 { margin: 0; font-size: 20px; }
.dialog-body { padding: 24px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: #f5f8f6; position: sticky; bottom: 0; z-index: 3; }
.form-grid, .mapping-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 22px; }
.mapping-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 26px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span, .field-caption { font-size: 14px; color: #3f5b49; line-height: 1.4; overflow-wrap: anywhere; font-weight: 600; }
.field-caption { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 28px; }
.field-caption label { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; font-size: 15px; }
.field select { padding-right: 24px; text-overflow: ellipsis; }
.wide { grid-column: 1 / -1; }
.form-section-title { font-size: 16px; margin: 28px 0 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-note { font-size: 13px; line-height: 1.65; color: #4d6a55; margin: 16px 0 0; }
.form-error { padding: 14px; background: #fff0f0; color: #9e2c37; border: 1px solid #edc9cc; border-radius: 5px; margin-top: 18px; font-size: 14px; overflow-wrap: anywhere; }
.upload-zone { padding: 28px; border: 1px dashed #80a992; background: #f1f8f4; border-radius: 6px; display: flex; flex-direction: column; gap: 12px; align-items: center; color: #306546; text-align: center; }
.upload-zone > svg { width: 34px; height: 34px; }
.upload-zone strong { font-size: 16px; }
.upload-zone > span { font-size: 13px; color: #4b6d56; }
.upload-zone input { border: 0; max-width: 100%; height: auto; font-size: 13px; }
.import-summary { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.import-summary > svg { width: 32px; height: 32px; color: #35734e; }
.import-summary > div { flex: 1; min-width: 0; }
.import-summary strong { font-size: 16px; overflow-wrap: anywhere; }
.import-summary small { display: block; margin-top: 5px; color: #56745e; font-size: 13px; }
.validation-error { font-size: 13px; color: #a12c36; overflow-wrap: anywhere; }
.compare-picker { display: grid; gap: 20px; margin-bottom: 20px; }
.comparison-choice { display: grid; grid-template-columns: minmax(0,1fr) 40px; align-items: end; gap: 9px; }
.package-row { position: relative; margin: 0 0 20px; padding: 18px; border: 1px solid #ceddd1; border-radius: 6px; min-width: 0; }
.package-row legend { padding: 0 7px; font-size: 14px; font-weight: 600; color: #415e4a; }
.remove-package { position: absolute; right: 6px; top: -27px; background: white; }
.facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 24px; margin: 20px 0 26px; }
.facts > div { min-width: 0; }
.facts dt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #506e59; margin-bottom: 6px; overflow-wrap: anywhere; }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; color: #203f2b; font-weight: 500; }
.detail-identity { display: flex; align-items: center; gap: 15px; padding: 0 0 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.detail-identity > .article-thumb { width: 52px; height: 54px; }
.detail-identity > .article-thumb svg { width: 30px; height: 30px; }
.detail-identity > div { flex: 1; min-width: 0; }
.detail-identity h2 { margin: 0; font-size: 23px; overflow-wrap: anywhere; }
.source-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.source-detail-grid h3 { overflow-wrap: anywhere; color: #355a40; }
.source-detail-grid .facts { grid-template-columns: 1fr; gap: 16px; }
.detail-quantity { font-size: 32px; font-weight: 650; color: #225937; }
.detail-quantity small { font-size: 14px; margin-left: 6px; color: #506f59; font-weight: 400; }
.version-list details { border-bottom: 1px solid var(--line); }
details summary { padding: 16px 0; display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; color: #375c44; }
details summary > svg:last-child { margin-left: auto; width: 18px; height: 18px; }
details summary > span:last-of-type { color: #55745e; overflow-wrap: anywhere; }
.company-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.company-choice { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); padding: 14px; border-radius: 6px; text-align: left; }
.company-choice > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.company-choice:hover { background: #edf6f0; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%,20px); z-index: 100; max-width: calc(100% - 36px); padding: 14px 20px; background: #173d2b; color: white; border: 1px solid #426c50; border-radius: 6px; box-shadow: 0 4px 20px #1f372b30; opacity: 0; pointer-events: none; transition: .15s; font-size: 14px; }
#toast.visible { opacity: 1; transform: translate(-50%,0); }
#toast.error { background: #96333b; border-color: #c7777d; }
.startup-error { padding: 60px; margin: auto; text-align: center; }
.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; }

@container (max-width: 900px) {
  .metrics-band { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); min-width: 0; }
  .page-heading { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
  .heading-actions { justify-content: flex-start; }
  .context-systems { gap: 16px; }
  .context-arrow { display: none; }
  .comparison-toolbar { align-items: flex-start; flex-direction: column; }
  .metric { padding: 14px 12px; }
  .metric-label { min-height: 40px; }
  .analysis-layout, .overview-grid { grid-template-columns: 1fr; }
  .activity-section { border-left: 0; padding-left: 0; }
  .scenario-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .scenario-list h2 { width: 100%; }
  .scenario { flex: 1; min-width: 170px; }
  .system-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .legend-definitions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@container (max-width: 650px) {
  .metrics-band { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { display: flex; flex-direction: column; padding: 14px 14px 16px; min-width: 0; }
  .metric-top { display: flex; align-items: center; justify-content: space-between; min-height: auto; margin-bottom: 8px; }
  .metric-icon { width: 32px; height: 32px; border-radius: 6px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .metric-label { font-size: 12.5px; font-weight: 600; color: #465c50; line-height: 1.3; margin-bottom: 4px; word-break: break-word; hyphens: auto; }
  .metric-value { font-size: clamp(16px, 5vw, 28px); font-weight: 750; line-height: 1.2; margin: 0; word-break: break-word; overflow-wrap: anywhere; }
  .metric:nth-child(2n+1) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric-note { display: none; }
  .system-grid { grid-template-columns: 1fr; }
  .reconciliation-body { grid-template-columns: 1fr; gap: 20px; }
  .match-ratio { border-right: 0; padding: 0; }
  .match-ratio .scope-label { margin-top: 8px; }
  .distribution-legend { gap: 10px; }
  .distribution-label { font-size: 12px; }
  .comparison-mode-nav { width: 100%; flex-direction: column; box-sizing: border-box; }
  .comp-mode-btn { width: 100%; justify-content: flex-start; box-sizing: border-box; }
  .comparison-context { align-items: flex-start; }
  .context-systems { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .table-scroll:has(.comparison-table) { display: none; }
  .mobile-comparison-list { display: grid; gap: 14px; padding: 0 16px 18px; }
  .mobile-stock { min-width: 0; border: 1px solid #d7e3d9; border-radius: 6px; padding: 16px; background: white; }
  .mobile-stock.different { border-left: 3px solid #c17e2c; padding-left: 14px; }
  .mobile-stock > header { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
  .mobile-stock > header .article-cell { flex: 1; }
  .mobile-stock-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 12px; font-size: 12px; color: #526e5b; }
  .mobile-stock-meta > span { display: flex; align-items: center; gap: 5px; }
  .mobile-stock-meta svg { width: 14px; height: 14px; }
  .mobile-stock-values { margin: 0; }
  .mobile-stock-values > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(70px,auto); gap: 12px; padding: 11px 0; border-top: 1px solid #e3ebe5; align-items: center; }
  .mobile-stock-values dt { font-size: 13px; overflow-wrap: anywhere; }
  .mobile-stock-values dt small { font-size: 12px; color: #557260; display: block; margin-top: 3px; }
  .mobile-stock-values dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
  .mobile-stock-values dd strong { font-size: 16px; }
  .mobile-stock-values dd > small { margin-left: 5px; font-size: 12px; color: #577160; }
  .mobile-stock footer { margin-top: 12px; }
  .comparison-footnote { flex-direction: column; }
}
@media (min-width: 1700px) {
  main { padding-left: 42px; padding-right: 42px; }
}
@media (max-width: 1250px) {
  .global-search { display: none; }
  .copilot-panel { position: fixed; right: 0; top: 72px; bottom: 0; height: calc(100dvh - 72px); z-index: 30; box-shadow: -12px 0 35px #1a342b26; }
}
@media (max-width: 1050px) {
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 18, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 285px;
    max-width: 85vw;
    height: 100dvh;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 35px rgba(10, 25, 18, 0.25);
    background: #ffffff;
    padding: 20px 16px env(safe-area-inset-bottom, 16px);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 4px;
  }
  .mobile-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #4b6656;
    border-radius: 6px;
  }
  .mobile-sidebar-close:hover {
    background: #f0f4f2;
    color: #173b27;
  }
  .app-body { margin-left: 0; }
  #mobile-menu { display: inline-flex; }
  .breadcrumb { flex: 1; }
  .breadcrumb > span, .breadcrumb > svg { display: none; }
  .source-detail-grid { grid-template-columns: 1fr; }
  .source-detail-grid section { border-bottom: 1px solid var(--line); }
  .source-detail-grid .facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
  .table-section {
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: contain;
    position: relative;
    scrollbar-width: thin;
  }
  .data-table {
    min-width: 650px;
    width: 100%;
  }
  .data-table th, .data-table td {
    padding: 12px 10px;
  }
  .data-table th:first-child, .data-table td:first-child {
    padding-left: 14px;
  }
  .data-table th:last-child, .data-table td:last-child {
    padding-right: 14px;
  }
  .article-cell {
    min-width: 160px;
    max-width: none;
  }
  .article-cell strong {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .article-cell small {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .mono-coords {
    white-space: nowrap;
    font-size: 11.5px;
  }
}
@media (max-width: 640px) {
  .topbar { height: 60px; min-height: 60px; padding: 0 12px; gap: 8px; }
  .breadcrumb { font-size: 13px; }
  .topbar-right { gap: 6px; }
  .copilot-toggle span { display: none; }
  .copilot-toggle { padding: 9px; min-width: 40px; }
  main { padding: 20px 14px 28px; }
  .page-heading { margin-bottom: 20px; gap: 12px; }
  .page-heading h1 { font-size: 24px; line-height: 1.25; }
  .heading-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
  .heading-actions .button, .heading-actions button { flex: 1 1 auto; min-height: 42px; justify-content: center; font-size: 13.5px; }

  /* Executive Dark Hero & Cockpits on Mobile */
  .executive-dark-hero,
  .confidence-hero { padding: 16px 14px; gap: 14px; flex-direction: column; align-items: stretch; border-radius: 8px; margin-bottom: 20px; }
  .hero-left, .confidence-left { gap: 12px; }
  .hero-badge-icon, .confidence-badge-icon { width: 40px; height: 40px; border-radius: 8px; }
  .hero-badge-icon svg, .confidence-badge-icon svg { width: 20px; height: 20px; }
  .hero-titles h3, .confidence-titles h3 { font-size: 16px; line-height: 1.3; }
  .hero-titles p, .confidence-titles p { font-size: 12px; line-height: 1.35; }
  .hero-right { width: 100%; flex-direction: column; align-items: stretch; gap: 14px; }
  .hero-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; border-right: none; padding-right: 0; }
  .hero-kpi-item { min-width: 0; text-align: left; }
  .hero-kpi-item small { font-size: 12px; line-height: 1.2; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #a7c5b6; }
  .hero-kpi-item strong { font-size: 17px; line-height: 1.25; margin: 2px 0 1px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-kpi-item .kpi-sub { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #82a895; }
  .hero-score-box { width: 100%; align-items: stretch; }
  .hero-score-box .hero-score-val { font-size: 24px; }
  .hero-score-box .hero-score-label { font-size: 12px; }
  .hero-bar-track { width: 100%; }

  .executive-cockpit-grid { grid-template-columns: minmax(0, 1fr); }
  .cockpit-card { padding: 16px 14px; }
  .cockpit-card + .cockpit-card { border-left: none; border-top: 1px solid var(--line); }
  .readiness-matrix { grid-template-columns: minmax(0, 1fr); }
  .analysis-content { padding: 16px 14px; min-width: 0; }
  .dual-timeline-card { padding: 16px 12px; min-width: 0; }
  .dual-timeline-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .timeline-lane { flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
  .lane-system-badge { width: auto; align-self: flex-start; }
  .lane-track { min-width: 0; width: 100%; }
  .action-box { flex-direction: column; align-items: stretch; padding: 16px 14px; }
  .action-box-right { flex-direction: column; width: 100%; }
  .action-box-right .button, .action-box-right button { width: 100%; justify-content: center; }
  .spectrum-kpis { gap: 16px; width: 100%; justify-content: space-between; }
  .spectrum-kpi { text-align: left; }
  .donut-widget { flex-direction: column; align-items: stretch; }
  .donut-svg-wrap { margin: 0 auto; }
  .section-heading { padding: 16px 14px; gap: 12px; }
  .section-heading h2 { font-size: 17px; }
  .section-heading > div { gap: 8px; }
  .comparison-toolbar { padding: 0 14px 14px; gap: 12px; }
  .filter-tab { padding: 8px; font-size: 13px; gap: 5px; }
  .table-toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .table-toolbar input, .table-toolbar select { width: 100%; min-height: 42px; }
  .table-footer { padding: 12px 14px; font-size: 12px; flex-wrap: wrap; gap: 8px; }
  .table-footer > div { gap: 6px; }
  .app-footer { padding: 14px 16px; }
  .sidebar { top: 0; }
  .copilot-panel { top: 60px; height: calc(100dvh - 60px); width: 100%; max-width: 400px; }
  .dialog-body { padding: 16px; }
  .dialog-header { padding: 14px 16px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-footer { padding: 14px 16px; flex-direction: column-reverse; gap: 8px; }
  .dialog-footer .button, .dialog-footer button { width: 100%; min-height: 44px; justify-content: center; }
  .form-grid, .mapping-grid { grid-template-columns: 1fr; gap: 16px; }
  .facts { grid-template-columns: 1fr; gap: 16px; }
  .analysis-content { padding: 16px; }
  .analysis-case-header h2 { font-size: 22px; }
  .evidence-quantities { gap: 12px; }
  .evidence-delta { padding-left: 14px; }
  .scenario { min-width: 100%; }
  .detail-identity h2 { font-size: 20px; }
  .source-detail-grid .facts { grid-template-columns: 1fr; }
  .source-detail-grid { gap: 8px; }
  .legend-definitions { grid-template-columns: 1fr; gap: 16px; }

  /* Market Map & Details */
  .market-osm-container { height: 340px; }
  .market-legend { gap: 10px; }
  .market-map-header { padding: 12px 14px; }

  /* Business Mining & Controls */
  .mining-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .mining-controls .view-tabs { display: flex; flex-wrap: wrap; width: 100%; }
  .mining-controls .view-tabs button { flex: 1 1 140px; font-size: 12.5px; text-align: center; justify-content: center; }
  .deviation-card { flex-wrap: wrap; }
  .mining-view-switch { width: 100%; justify-content: space-between; }
  .mining-tab-btn { flex: 1; text-align: center; justify-content: center; min-height: 40px; font-size: 13px; }
}

/* --- Business Mining & Process Flow --- */
.mining-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; width: 100%; max-width: 100%; min-width: 0; }
.mining-controls .view-tabs { margin-bottom: 0; max-width: 100%; min-width: 0; }
.mining-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 100%; min-width: 0; }
.mining-graph-section { background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.03); min-width: 0; max-width: 100%; }
.mining-cases-panel { min-width: 0; max-width: 100%; overflow: hidden; }
.sop-pipeline-flow { display: flex; align-items: center; gap: 12px; padding: 28px 24px; overflow-x: auto; background: #fafcfb; }
.sop-node-card { display: flex; align-items: center; gap: 12px; background: white; border: 1.5px solid #c2d1c9; border-radius: 8px; padding: 14px 18px; min-width: 180px; box-shadow: 0 2px 5px rgba(0,0,0,0.04); }
.sop-step-number { font-size: 16px; font-weight: 700; color: var(--green); background: var(--green-light); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sop-node-body { display: flex; flex-direction: column; }
.sop-node-title { font-size: 15px; font-weight: 650; }
.sop-node-sub { font-size: 12px; color: var(--muted); }
.sop-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #8fa198; flex-shrink: 0; }
.sop-arrow small { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Interactive Process Flow Diagram --- */
.interactive-diagram-container { background: #ffffff; border-radius: var(--radius); max-width: 100%; min-width: 0; overflow: hidden; }
.diagram-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 14px; background: #fafcfb; }
.diagram-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.diagram-title-wrap h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.diagram-hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.diagram-hint svg { width: 14px; height: 14px; color: #3d8065; }

.diagram-metric-switch { display: inline-flex; background: #eaeff0; padding: 3px; border-radius: 6px; gap: 2px; }
.metric-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 6px 13px; font-size: 12px; font-weight: 650; color: #435e50; border-radius: 5px; cursor: pointer; transition: all .15s; }
.metric-btn:hover { color: var(--ink); background: rgba(255,255,255,0.6); }
.metric-btn.active { background: white; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,0.08); font-weight: 700; }
.metric-btn svg { width: 15px; height: 15px; }

.diagram-scroll-viewport { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 20px; background: #f8faf9; scrollbar-width: thin; }
.diagram-canvas-scaler { transform-origin: top left; transition: transform .2s ease-out; margin: 0 auto; display: block; }
.diagram-canvas { position: relative; margin: 0 auto; background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%); border-radius: 12px; border: 1.5px solid #dce6e1; box-shadow: inset 0 1px 4px rgba(0,0,0,0.03); width: 1260px; min-width: 1260px; height: 520px; min-height: 520px; }

.stage-column-guide { position: absolute; top: 12px; bottom: 12px; border-radius: 10px; border: 1px dashed #d5e3dc; background: rgba(246, 250, 248, 0.45); pointer-events: none; z-index: 0; }
.stage-guide-header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; color: #4b6656; font-weight: 700; letter-spacing: 0.2px; border-bottom: 1px solid rgba(213, 227, 220, 0.5); }
.stage-guide-header strong { white-space: normal; line-height: 1.2; }
.guide-bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.diagram-svg-overlay { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; min-width: 1260px; min-height: 520px; pointer-events: none; z-index: 3; overflow: visible; }
.flow-edge-group { pointer-events: auto; cursor: pointer; }
.flow-edge { fill: none; transition: stroke .2s ease, stroke-width .2s ease, opacity .2s ease; }
.flow-edge.planned-edge { stroke: #096b53; stroke-linecap: round; }
.flow-edge.deviation-edge { stroke: #d97706; stroke-dasharray: 6 5; stroke-linecap: round; }
.flow-edge.dimmed { opacity: 0.16; stroke: #94a3b8; }
.flow-edge.highlighted { stroke: #10b981; opacity: 1; filter: drop-shadow(0 0 6px rgba(16,185,129,0.5)); }
.flow-edge-group:hover .base-line { stroke: #047857; stroke-width: 4.5px; filter: drop-shadow(0 0 5px rgba(4,120,87,0.35)); }

.edge-badge-group { pointer-events: auto; cursor: pointer; transition: transform .15s ease-out; }
.edge-badge-bg { fill: #ffffff; stroke: #d1fae5; stroke-width: 1.2; filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.08)); transition: stroke .15s ease, stroke-width .15s ease, filter .15s ease; }
.edge-badge-dot.dot-planned { fill: #10b981; }
.edge-badge-dot.dot-dev { fill: #f59e0b; }
.edge-badge-text { font-size: 12px; font-weight: 700; fill: #064e3b; font-family: inherit; letter-spacing: -0.01em; transition: fill .15s ease; }
.edge-badge-group.dev-badge .edge-badge-bg { stroke: #fed7aa; fill: #fffdfa; }
.edge-badge-group.dev-badge .edge-badge-text { fill: #9a3412; }
.edge-badge-group:hover,
.flow-edge-group:hover .edge-badge-group { transform: translateY(-1px); }
.edge-badge-group:hover .edge-badge-bg,
.flow-edge-group:hover .edge-badge-bg { stroke: #096b53; stroke-width: 1.8; filter: drop-shadow(0 4px 10px rgba(9,107,83,0.25)); }
.edge-badge-group:hover .edge-badge-text,
.flow-edge-group:hover .edge-badge-text { fill: #044e3a; }
.edge-badge-group.dev-badge:hover .edge-badge-bg,
.flow-edge-group:hover .dev-badge .edge-badge-bg { stroke: #d97706; stroke-width: 1.8; filter: drop-shadow(0 4px 10px rgba(217,119,6,0.25)); }
.edge-badge-group.dev-badge:hover .edge-badge-text,
.flow-edge-group:hover .dev-badge .edge-badge-text { fill: #7c2d12; }

.mining-node-card { z-index: 2; background: white; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, opacity .2s; box-shadow: 0 2px 6px rgba(0,0,0,0.04); box-sizing: border-box; }
.mining-node-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,0.08); border-color: #82a092; }
.mining-node-card.dimmed { opacity: 0.25; filter: grayscale(45%); }
.mining-node-card.bottleneck-node { border-color: #e59844; background: linear-gradient(180deg, #fffcf7 0%, white 100%); box-shadow: 0 0 0 1px #e59844, 0 4px 12px rgba(229,152,68,0.18); }
.node-card-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.node-icon { width: 26px; height: 26px; border-radius: 6px; background: var(--blue-light); color: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.node-icon svg { width: 15px; height: 15px; }
.mining-node-card.quality .node-icon { background: #eef8f5; color: var(--green); }
.mining-node-card.deviation .node-icon { background: var(--amber-light); color: var(--amber); }
.bottleneck-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #a35205; background: #ffeacc; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.deviation-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #b03339; background: #fde8e8; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.node-card-body { display: flex; flex-direction: column; gap: 3px; }
.node-card-body strong { font-size: 12.5px; font-weight: 700; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px; }
.node-metrics { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.node-metrics > div { display: flex; flex-direction: column; }
.node-metrics span { color: var(--muted); font-size: 12px; }
.node-metrics strong { font-size: 12px; margin-bottom: 0; line-height: 1.2; }
.metric-active { color: var(--green); font-weight: 800; }
.node-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0f3f2; padding-top: 5px; font-size: 12px; color: var(--subtle); }
.node-qty { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.node-qty svg { width: 14px; height: 14px; }

.diagram-legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 24px; padding: 14px 24px; background: white; border-top: 1px solid var(--line); font-size: 13px; color: #435e50; font-weight: 600; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.legend-line.planned { background: #1b4d3e; }
.legend-line.deviation { background: #c47a23; border-top: 1px dashed #c47a23; }
.legend-line.loop { background: #2563eb; }
.legend-symbol.bottleneck { color: #d97706; display: inline-flex; align-items: center; }
.legend-symbol.bottleneck svg { width: 16px; height: 16px; }

.mining-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; margin-bottom: 24px; }
.mining-panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); min-width: 0; max-width: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-header h2 { font-size: 17px; margin-bottom: 0; display: flex; align-items: center; gap: 8px; }

.conformance-bar-wrap { margin-bottom: 20px; }
.conformance-meter { height: 16px; border-radius: 8px; background: #eee; display: flex; overflow: hidden; margin-bottom: 8px; }
.meter-fill.conformant { background: var(--green); }
.meter-fill.deviating { background: #e05d5d; }
.meter-legend { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend-dot.green { background: var(--green); }
.legend-dot.red { background: #e05d5d; }

.deviation-cards-list { display: flex; flex-direction: column; gap: 10px; }
.deviation-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fdfaf7; border: 1px solid #f1ded0; border-radius: 6px; }
.deviation-icon { width: 32px; height: 32px; border-radius: 6px; background: #fde8e8; color: var(--red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.deviation-card.booking_lag .deviation-icon { background: var(--blue-light); color: var(--blue); }
.deviation-card.skipped_quality .deviation-icon { background: var(--amber-light); color: var(--amber); }
.deviation-info { display: flex; flex-direction: column; flex: 1; }
.deviation-info strong { font-size: 14px; }
.deviation-info small { color: var(--muted); }
.deviation-badge { font-weight: 700; font-size: 13px; color: var(--ink); background: #eee; padding: 3px 8px; border-radius: 12px; }
.empty-deviations { text-align: center; padding: 24px; color: var(--green); display: flex; flex-direction: column; align-items: center; gap: 8px; }

.variants-list { display: flex; flex-direction: column; gap: 12px; max-height: 750px; overflow-y: auto; }
.variant-card { border: 1.5px solid var(--line); border-radius: 8px; padding: 14px; background: white; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.variant-card:hover { border-color: #8fa89b; }
.variant-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px #096b5322; background: #fafdfc; }
.variant-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.variant-tag-wrap { display: flex; align-items: center; gap: 8px; }
.variant-tag { font-size: 12px; font-weight: 700; background: #e8eee9; padding: 2px 7px; border-radius: 4px; }
.variant-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.variant-toggle-btn { background: #f0f4f2; border: 1px solid var(--line); border-radius: 6px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--green); cursor: pointer; transition: background .15s; padding: 0; }
.variant-toggle-btn:hover { background: #dce7e1; }
.variant-toggle-btn svg { width: 16px; height: 16px; }
.variant-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.variant-step-pill { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; background: #f0f4f2; color: #233b30; }
.variant-step-pill.quality_inspection, .variant-step-pill.quarantine_block { background: #fff1e3; color: #7a3e05; }
.step-arrow { width: 14px; height: 14px; color: #a4b3ac; }
.variant-dev-notes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dev-note { font-size: 12px; font-weight: 600; color: #a34c06; display: inline-flex; align-items: center; gap: 4px; background: #fff5eb; padding: 2px 6px; border-radius: 4px; }

/* Variant Drawer Accordion */
.variant-drawer { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); animation: drawerSlide .2s ease-out; }
.variant-drawer.open, .variant-card.expanded .variant-drawer { display: block; }
@keyframes drawerSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.variant-drawer-inner { background: #f8faf9; border-radius: 6px; padding: 12px; border: 1px solid #e2ece7; }
.variant-drawer-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: var(--green); }
.variant-drawer-title strong { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.variant-drawer-title strong svg { width: 15px; height: 15px; }
.variant-cases-table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; background: white; border: 1px solid #e2ece7; border-radius: 6px; -webkit-overflow-scrolling: touch; }
.variant-cases-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 12px; text-align: left; }
.variant-cases-table th { background: #f0f4f2; padding: 6px 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #435e50; border-bottom: 1px solid #e2ece7; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.variant-cases-table td { padding: 6px 8px; border-bottom: 1px solid #edf2f0; vertical-align: middle; font-size: 12px; }
.variant-cases-table td.step-time { white-space: nowrap; font-size: 11.5px; }
.variant-cases-table td.numeric { white-space: nowrap; text-align: right; }
.variant-case-row { cursor: pointer; transition: background .12s; }
.variant-case-row:hover { background: #f4f8f6; }
.case-business-title { display: block; font-size: 13px; font-weight: 700; color: #0c4334; white-space: nowrap; }
.article-bold-name { display: block; font-size: 13.5px; font-weight: 700; color: #0e2b20; line-height: 1.35; white-space: nowrap; }
.stock-article-cell strong { font-weight: 700; font-size: 13.5px; color: #0e2b20; line-height: 1.35; }
.stock-article-cell .cell-sub { font-size: 12px; color: #526b5b; font-weight: 400; margin-top: 2px; line-height: 1.3; white-space: nowrap; }
.article-cell.stock-article-cell { background: transparent; border: none; cursor: pointer; text-align: left; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.article-cell.stock-article-cell:hover .article-bold-name { color: var(--green); text-decoration: underline; }

.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mining-graph-section, .mining-panel, .mining-cases-panel { min-width: 0; max-width: 100%; }

@media (max-width: 1050px) {
  .mining-dashboard-grid { grid-template-columns: 1fr; }
  .flow-stages-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 640px) {
  .sop-pipeline-flow { flex-direction: column; align-items: stretch; }
  .sop-arrow { transform: rotate(90deg); margin: 4px 0; }
  .flow-stages-row { grid-template-columns: 1fr; }
  .mining-controls { flex-direction: column; align-items: stretch; }
  .flow-transitions-grid { grid-template-columns: 1fr; }
  .mining-panel { padding: 16px; }
}

/* --- Market Overview & OpenStreetMap --- */
.market-controls { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.market-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.market-modes { display: inline-flex; background: #eaeff0; padding: 4px; border-radius: 8px; gap: 4px; }
.market-mode-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 7px 14px; font-size: 13px; font-weight: 650; color: #435e50; border-radius: 6px; cursor: pointer; transition: all .15s; }
.market-mode-btn:hover { color: var(--ink); background: rgba(255,255,255,0.6); }
.market-mode-btn.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-weight: 700; }
.market-mode-btn svg { width: 16px; height: 16px; }

.market-search-box { display: flex; align-items: center; gap: 10px; background: white; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 14px; flex: 1; max-width: 480px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.market-search-box svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.market-search-input { border: 0; outline: none; width: 100%; font-size: 13px; font-family: inherit; background: transparent; }

.market-sku-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.market-sku-chips small { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.sku-chip { display: inline-flex; align-items: center; gap: 6px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; transition: all .15s; }
.sku-chip:hover { border-color: var(--green); background: #f4f9f6; }
.sku-chip.active { background: var(--green); color: white; border-color: var(--green); box-shadow: 0 2px 6px rgba(9,107,83,0.25); }

.market-map-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); scroll-margin-top: 18px; }
.market-map-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fafcfb; flex-wrap: wrap; gap: 12px; }
.market-map-header h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.market-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #435e50; flex-wrap: wrap; }
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #d4dfd8;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334d40;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.legend-chip:hover {
  background: #f0f7f3;
  border-color: #096b53;
  color: #0d281e;
}
.legend-chip.active {
  background: #e6f3eb;
  border-color: #096b53;
  color: #064e3b;
  box-shadow: 0 0 0 2px rgba(9, 107, 83, 0.22);
}
.legend-chip.clear-filter {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
.legend-chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-count {
  background: #f1f5f3;
  color: #1b382b;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}
.row-dimmed {
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.highlighted-col {
  background: #f0fdf4;
}

.market-osm-container { width: 100%; height: 540px; position: relative; background: #e5e9ec; z-index: 1; }

/* Custom Leaflet Pins */
.custom-map-pin { background: transparent; border: none; }
.osm-marker-pin { position: relative; width: 42px; height: 50px; cursor: pointer; transform: translate(-50%, -100%); transition: transform .15s ease-out; }
.osm-marker-pin:hover { transform: translate(-50%, -108%) scale(1.08); z-index: 9999; }
.osm-marker-svg { width: 42px; height: 50px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.28)); }
.osm-marker-body { position: absolute; top: 4px; left: 5px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; }
.osm-marker-badge { position: absolute; top: -6px; right: -10px; background: #1c3d2e; color: #ffffff; border: 1.5px solid #ffffff; font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 10px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.osm-marker-pulse { position: absolute; bottom: -2px; left: 50%; width: 16px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: rgba(0,0,0,0.25); filter: blur(1px); }

/* Custom Leaflet Tooltip */
.leaflet-tooltip.osm-custom-tooltip { background: #ffffff !important; border: 1.5px solid #c2d1c9 !important; border-radius: 10px !important; padding: 12px 16px !important; box-shadow: 0 10px 25px rgba(0,0,0,0.14) !important; color: #1c2b24 !important; font-family: inherit !important; font-size: 13px !important; max-width: 320px; min-width: 240px; opacity: 1 !important; z-index: 10000; }
.leaflet-tooltip.osm-custom-tooltip::before { border-top-color: #c2d1c9 !important; }
.osm-tooltip-card { display: flex; flex-direction: column; gap: 8px; }
.osm-tooltip-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #eef2f0; padding-bottom: 6px; }
.osm-tooltip-header strong { font-size: 14px; font-weight: 750; color: #0d1e17; }
.osm-tooltip-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 8px; }
.osm-tooltip-meta span { display: inline-flex; align-items: center; gap: 4px; }
.osm-tooltip-title { font-size: 12px; font-weight: 700; color: #435e50; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.osm-tooltip-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.osm-tooltip-table tr td { padding: 3px 0; }
.osm-tooltip-table tr td:last-child { text-align: right; }
.osm-tooltip-table tr.total-row { border-top: 1px solid #dce6e1; }
.osm-tooltip-table tr.total-row td { padding-top: 6px; font-size: 13px; }
.osm-tooltip-table .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.osm-tooltip-table .dot.green { background: #10b981; }
.osm-tooltip-table .dot.orange { background: #f59e0b; }
.osm-tooltip-table .dot.red { background: #ef4444; }
.osm-tooltip-table .dot.blue { background: #3b82f6; }

/* ============================================================
   EXECUTIVE COCKPIT & HIGH-IMPACT VISUALIZATIONS
   ============================================================ */

.executive-cockpit-section {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cockpit-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cockpit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.cockpit-pill.green {
  background: #eaf5ee;
  color: #0d6b46;
  border: 1px solid #bce1ce;
}

.cockpit-pill.blue {
  background: #edf3fc;
  color: #2458b2;
  border: 1px solid #c9dcf8;
}

.executive-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: #ffffff;
  min-width: 0;
  max-width: 100%;
}

.cockpit-card {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.cockpit-card + .cockpit-card {
  border-left: 1px solid var(--line);
}

.cockpit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.cockpit-card-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #22372d;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cockpit-card-header .text-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.cockpit-card-header h3 svg {
  width: 17px;
  height: 17px;
  color: #436553;
  flex-shrink: 0;
}

/* Donut Chart Widget */
.donut-widget {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.donut-svg-wrap {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.donut-svg text {
  transform: rotate(90deg);
  transform-origin: 100px 100px;
  font-family: inherit;
}

.donut-total-text {
  font-size: 22px;
  font-weight: 800;
  fill: #142820;
}

.donut-unit-text {
  font-size: 13px;
  font-weight: 600;
  fill: #617369;
}

.donut-sub-text {
  font-size: 12px;
  font-weight: 700;
  fill: #096b53;
  letter-spacing: 0.03em;
}

.donut-slice {
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.donut-slice:hover {
  stroke-width: 25;
  opacity: 0.9;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.legend-name {
  color: #4b6255;
  font-size: 12px;
  font-weight: 600;
}

.legend-val {
  font-size: 13px;
  color: #192721;
}

.legend-val small {
  color: #63776c;
  font-size: 12px;
}

/* Radial Gauge Widget */
.gauge-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.gauge-svg-wrap {
  width: 176px;
  height: 96px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gauge-val-text {
  font-size: 32px;
  font-weight: 850;
  fill: #142820;
  font-family: inherit;
}

.gauge-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.gauge-title {
  font-size: 14px;
  font-weight: 700;
  color: #1c3227;
  letter-spacing: -0.01em;
}

.gauge-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}

.gauge-status-badge.optimal {
  background: #eaf5f0;
  color: #096b53;
  border: 1px solid #bde2d3;
}

.gauge-status-badge.elevated {
  background: #fdf5ea;
  color: #a85f14;
  border: 1px solid #fad9ad;
}

.gauge-status-badge.critical {
  background: #fdf0f0;
  color: #b03339;
  border: 1px solid #f8c9c9;
}

.integrity-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.int-kpi {
  background: #f4f7f5;
  border: 1px solid #e1ebe5;
  border-radius: 6px;
  padding: 8px 3px;
  text-align: center;
  min-width: 0;
}

.int-kpi small {
  display: block;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: #556c60;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.int-kpi strong {
  font-size: 16px;
  font-weight: 750;
  color: #1a2822;
}

.int-kpi.green strong { color: #096b53; }
.int-kpi.amber strong { color: #c07925; }

/* Horizontal Bars */
.hbar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.hbar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.hbar-label {
  font-weight: 600;
  color: #2a4135;
}

.hbar-val strong {
  font-weight: 750;
  color: #12211a;
}

.hbar-track {
  width: 100%;
  height: 9px;
  background: #e6eee9;
  border-radius: 5px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease-out;
}

.depot-summary-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #587163;
  padding-top: 6px;
  border-top: 1px dashed #d8e5df;
}

.depot-summary-note svg {
  width: 15px;
  height: 15px;
  color: #096b53;
}

/* Comparison Discrepancy Spectrum */
.spectrum-bar-card {
  background: linear-gradient(135deg, #183329 0%, #10241c 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  color: #ffffff;
}

.spectrum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.spectrum-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.spectrum-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: grid;
  place-items: center;
  color: #34d399;
  flex-shrink: 0;
}

.spectrum-badge-icon svg {
  width: 22px;
  height: 22px;
}

.spectrum-title strong {
  font-size: 17px;
  font-weight: 750;
  color: #ffffff;
  display: block;
}

.spectrum-sub.muted {
  color: #a7c5b6;
  font-size: 13px;
  margin-top: 2px;
}

.spectrum-kpis {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.spectrum-kpi {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}

.spectrum-kpi small {
  font-size: 12px;
  color: #a7c5b6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spectrum-kpi strong {
  font-size: 20px;
  font-weight: 850;
  color: #ffffff;
}

.spectrum-kpi strong.amber { color: #fbbf24; }
.spectrum-kpi strong.green { color: #34d399; }
.spectrum-kpi strong.muted { color: #cbd5e1; }

.spectrum-kpi .kpi-sub {
  font-size: 12px;
  color: #8faea0;
}

/* Table Delta Bar */
.delta-cell-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 3px;
}

.delta-bar-track {
  position: relative;
  width: 60px;
  height: 8px;
  background: #eef3f0;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.delta-bar-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #a9beaf;
  z-index: 2;
}

.delta-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  z-index: 1;
}

.delta-bar-fill.pos {
  background: #3b82f6;
}

.delta-bar-fill.neg {
  background: #f59e0b;
}

.delta-center-dot {
  position: absolute;
  left: calc(50% - 2px);
  top: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #10b981;
  z-index: 3;
}

/* ============================================================
   ROOT CAUSE INTELLIGENCE & DIFFERENCE ANALYSIS COCKPIT
   ============================================================ */

.intelligence-cockpit {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.executive-dark-hero,
.confidence-hero {
  background: linear-gradient(135deg, #183329 0%, #10241c 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-left,
.confidence-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-badge-icon,
.confidence-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: grid;
  place-items: center;
  color: #34d399;
  flex-shrink: 0;
}

.hero-badge-icon.amber {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.hero-badge-icon.blue {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #38bdf8;
}

.hero-badge-icon svg,
.confidence-badge-icon svg {
  width: 24px;
  height: 24px;
}

.hero-titles h3,
.confidence-titles h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 750;
  color: #ffffff;
}

.hero-titles p,
.confidence-titles p {
  margin: 0;
  font-size: 13px;
  color: #a7c5b6;
}

.hero-right {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-kpis {
  display: flex;
  align-items: center;
  gap: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  padding-right: 24px;
}

.hero-kpi-item {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}

.hero-kpi-item small {
  font-size: 12px;
  color: #a7c5b6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-kpi-item strong {
  font-size: 19px;
  font-weight: 850;
  color: #ffffff;
}

.hero-kpi-item strong.green { color: #34d399; }
.hero-kpi-item strong.amber { color: #fbbf24; }
.hero-kpi-item strong.blue { color: #38bdf8; }

.hero-kpi-item .kpi-sub {
  font-size: 12px;
  color: #8faea0;
}

.hero-score-box,
.confidence-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hero-score-val,
.confidence-score-val {
  font-size: 26px;
  font-weight: 850;
  color: #34d399;
  line-height: 1;
}

.hero-score-val.val-amber { color: #fbbf24; }
.hero-score-val.val-blue { color: #38bdf8; }

.hero-score-label,
.confidence-score-label {
  font-size: 12px;
  color: #a7c5b6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-bar-track,
.confidence-bar-track {
  width: 140px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.hero-bar-fill,
.confidence-bar-fill {
  height: 100%;
  background: #34d399;
  border-radius: 3px;
}

.hero-bar-fill.bar-amber { background: #fbbf24; }
.hero-bar-fill.bar-blue { background: #38bdf8; }


/* Dual System Parallel Timeline (Gantt style) */
.dual-timeline-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.dual-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid #edf2ef;
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.dual-timeline-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #172c22;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-lanes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.timeline-lane {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.lane-system-badge {
  width: 90px;
  font-size: 13px;
  font-weight: 750;
  padding: 5px 10px;
  border-radius: 6px;
  text-align: center;
  flex-shrink: 0;
}

.lane-system-badge.erp {
  background: #e8f5ed;
  color: #0d6b46;
  border: 1px solid #c0e3ce;
}

.lane-system-badge.wms {
  background: #edf3fc;
  color: #2458b2;
  border: 1px solid #c9dcf8;
}

.lane-track {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7faf8;
  border: 1px solid #e3eae6;
  border-radius: 6px;
  padding: 10px 14px;
  position: relative;
  overflow-x: auto;
}

.timeline-node {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #c9ded3;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.timeline-node.active {
  border-color: #096b53;
  background: #edf8f2;
}

.timeline-node.lag {
  border-color: #d97706;
  background: #fffbeb;
  color: #92400e;
}

.timeline-node time {
  font-weight: 750;
  color: #11221a;
  background: #e9f2ec;
  padding: 1px 5px;
  border-radius: 3px;
}

.timeline-lane-arrow {
  color: #799786;
  width: 14px;
  height: 14px;
}

.lag-callout {
  margin-top: 14px;
  background: #fff8eb;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #92400e;
}

.lag-callout svg {
  width: 18px;
  height: 18px;
  color: #d97706;
  flex-shrink: 0;
}

/* Impact & Readiness Matrix */
.readiness-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.readiness-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.readiness-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.readiness-card-top small {
  font-size: 12px;
  color: #556c60;
  font-weight: 600;
  text-transform: uppercase;
}

.readiness-card strong {
  font-size: 15px;
  font-weight: 750;
  color: #172a21;
}

.readiness-card p {
  margin: 0;
  font-size: 12px;
  color: #637a6d;
}

/* Action Simulation Box */
.action-box {
  background: #f0f7f3;
  border: 1.5px solid #a6cfb9;
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.action-box-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-box-left svg {
  width: 24px;
  height: 24px;
  color: #096b53;
  flex-shrink: 0;
}

.action-box-left strong {
  display: block;
  font-size: 14px;
  color: #12281e;
}

.action-box-left span {
  font-size: 13px;
  color: #496355;
}

/* Mining Lead Time Chart */
.mining-lead-time-card {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  margin-top: 20px;
}

.mining-lead-time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mining-lead-time-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a2f24;
  display: flex;
  align-items: center;
  gap: 8px;
}

@container (max-width: 900px) {
  .executive-cockpit-grid {
    grid-template-columns: 1fr;
  }
  .cockpit-card + .cockpit-card {
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .readiness-matrix {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Calculated Stocks: Movement Ledger & Point-in-Time Breakdown */
.calculated-subnav {
  display: flex;
  gap: 10px;
  margin: 18px 0 20px;
}
.subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  color: #4a5c53;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.subnav-btn svg {
  width: 16px;
  height: 16px;
  color: #6a7d74;
}
.subnav-btn:hover {
  background: #f4f8f6;
  border-color: #bcd4c7;
  color: #1a3c2e;
}
.subnav-btn.active {
  background: #096b53;
  border-color: #096b53;
  color: white;
}
.subnav-btn.active svg {
  color: white;
}

.ledger-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.point-in-time-panel {
  background: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 0;
}
.pit-header {
  background: linear-gradient(135deg, #183329 0%, #10241c 100%);
  color: #ffffff;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.pit-badge-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pit-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pit-icon svg {
  width: 22px;
  height: 22px;
}
.pit-badge-title .eyebrow {
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}
.pit-badge-title h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 750;
  color: #ffffff;
}
.pit-badge-title .pit-time-sub {
  color: #a7c5b6;
  font-size: 12.5px;
}
.pit-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mono-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(30, 58, 138, 0.35);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 4px;
  padding: 3px 8px;
}
.mono-badge svg {
  width: 14px;
  height: 14px;
}
.mono-sub {
  font-family: monospace;
  font-size: 11.5px;
  color: #a7c5b6;
}

.pit-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pit-article-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: #f4fbf8;
  border: 1px solid #d1ebd9;
  border-radius: 8px;
  padding: 12px 16px;
  gap: 12px;
}
.pit-article-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pit-article-header strong {
  font-size: 16px;
  color: #096b53;
}
.pit-article-header span {
  font-size: 14px;
  font-weight: 600;
  color: #273e34;
}
.pit-impact-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.impact-label {
  color: #556c60;
  font-weight: 600;
}
.impact-text {
  font-weight: 700;
  color: #17382b;
}

.section-sub {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #597165;
  margin: 0 0 10px;
}
.stock-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.st-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .15s, box-shadow .15s;
}
.st-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.st-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.st-free .st-dot { background: #096b53; box-shadow: 0 0 0 3px #d6f2e7; }
.st-quality .st-dot { background: #d97706; box-shadow: 0 0 0 3px #fef3c7; }
.st-blocked .st-dot { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.st-transit .st-dot { background: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.st-total {
  background: #f0f7f4;
  border-color: #a7d3c0;
}
.st-meta {
  display: flex;
  flex-direction: column;
}
.st-label {
  font-size: 11.5px;
  font-weight: 650;
  color: #576d61;
}
.st-qty {
  font-size: 16px;
  font-weight: 750;
  color: #172d24;
}
.st-qty small {
  font-size: 11px;
  font-weight: 600;
  color: #70847b;
}
.total-qty {
  color: #096b53;
  font-size: 18px;
}

.pit-network-summary {
  font-size: 12.5px;
  color: #4a6155;
  background: #f6f9f7;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pit-network-summary svg {
  width: 15px;
  height: 15px;
  color: #096b53;
}

.ledger-table-wrap {
  padding: 0;
  overflow: hidden;
}
.ledger-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
}
.ledger-table-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #15382b;
}
.section-desc {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #63776c;
}

.ledger-table {
  margin: 0;
  width: 100%;
}
.ledger-table td:nth-child(4), .ledger-table th:nth-child(4) {
  min-width: 190px;
}
.ledger-row {
  cursor: pointer;
  transition: background .12s;
}
.ledger-row:hover {
  background: #f4faf6;
}
.ledger-row-active {
  background: #eaf5ee !important;
  box-shadow: inset 3px 0 0 #096b53;
}
.step-num {
  font-size: 12px;
  color: #60756a;
}
.time-link {
  color: #0c614b;
  font-weight: 650;
  border-bottom: 1px dashed #97cfba;
}
.delta-pill, .delta-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
}
.delta-pos {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.delta-neg {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.delta-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  background: #f8faf9;
  border: 1px solid #e1ebe6;
  border-radius: 4px;
  padding: 3px 8px;
}
.flow-arrow {
  width: 13px;
  height: 13px;
  color: #8da197;
}
.opening-flow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: #096b53;
}
.saldo-cell {
  font-size: 14.5px;
}
.active-icon {
  color: #096b53;
  background: #d5eee2;
}

.movements-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.movements-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.movements-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.movement-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f8f6;
  border: 1px solid #d5e3dc;
  color: #174d3c;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  transition: all .15s ease;
}
.movement-sort-btn:hover {
  background: #e8f3ed;
  border-color: #096b53;
}
.sort-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: #096b53;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sort-header-btn:hover {
  color: #044b39;
}
.sort-header-btn svg {
  width: 14px;
  height: 14px;
}
.sort-dir-icon {
  color: #096b53;
}
.movement-time-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #e6f7ef 100%);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0 18px;
}
.mtb-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #096b53;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mtb-icon svg {
  width: 22px;
  height: 22px;
}
.mtb-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mtb-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
}
.mtb-value {
  font-size: 18px;
  font-weight: 750;
  color: #0f4a38;
}
.mtb-sub {
  font-size: 12px;
  color: #3b745f;
}
.pit-time-sub {
  display: block;
  font-size: 11.5px;
  color: #4b6b5d;
  margin-top: 2px;
}

/* ==========================================================================
   Problem Trace & Evidence Deep-Linking
   ========================================================================== */

.problem-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
  animation: problemBannerSlide 0.3s ease-out;
}

@keyframes problemBannerSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.pfb-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pfb-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f59e0b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pfb-icon svg {
  width: 18px;
  height: 18px;
}

.pfb-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #92400e;
  font-weight: 700;
}

.pfb-title svg {
  width: 15px;
  height: 15px;
  color: #d97706;
}

.pfb-sub {
  font-size: 12.5px;
  color: #78350f;
  margin-top: 2px;
}

.pfb-clear-btn {
  white-space: nowrap;
  font-size: 12px;
  color: #92400e !important;
  background: rgba(254, 243, 199, 0.7) !important;
  border: 1px solid #fcd34d !important;
  padding: 6px 12px !important;
}

.pfb-clear-btn:hover {
  background: #fde68a !important;
}

/* Highlighted Problem Rows */
.problem-highlight-row {
  position: relative;
  animation: problemRowPulse 2.5s ease-in-out infinite alternate;
}

.data-table tr.problem-highlight-row td,
.problem-highlight-row td {
  background: #fefce8 !important;
  border-top: 1px solid #fde047 !important;
  border-bottom: 1px solid #fde047 !important;
}

.data-table tr.problem-highlight-row td:first-child,
.problem-highlight-row td:first-child {
  border-left: 5px solid #d97706 !important;
}

.data-table tr.problem-highlight-row td:last-child,
.problem-highlight-row td:last-child {
  border-right: 1px solid #fde047 !important;
}

@keyframes problemRowPulse {
  0% { opacity: 0.95; }
  100% { opacity: 1; }
}

html[data-theme="dark"] .data-table tr.problem-highlight-row td,
html[data-theme="dark"] .problem-highlight-row td {
  background: rgba(245, 158, 11, 0.18) !important;
  border-top: 1px solid rgba(245, 158, 11, 0.45) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.45) !important;
}

html[data-theme="dark"] .data-table tr.problem-highlight-row td:first-child,
html[data-theme="dark"] .problem-highlight-row td:first-child {
  border-left: 5px solid #f59e0b !important;
}

html[data-theme="dark"] .data-table tr.problem-highlight-row td:last-child,
html[data-theme="dark"] .problem-highlight-row td:last-child {
  border-right: 1px solid rgba(245, 158, 11, 0.45) !important;
}

html[data-theme="dark"] .problem-cause-tag {
  color: #fef08a;
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.5);
}

.problem-cause-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  width: fit-content;
}

.problem-cause-tag svg {
  width: 12px;
  height: 12px;
  color: #d97706;
}

/* Table Quick Action Buttons */
.comparison-actions-cell {
  vertical-align: middle;
  text-align: right;
}

.comparison-actions-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.row-problem-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.problem-btn {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  color: #b45309 !important;
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
}

.problem-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.8;
}

.problem-btn:hover {
  background: #fde68a !important;
  color: #78350f !important;
  border-color: #f59e0b !important;
}

.comparison-actions-wrap > .icon-button:not(.problem-btn) {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.comparison-actions-wrap > .icon-button:not(.problem-btn) svg {
  width: 16px !important;
  height: 16px !important;
}

.drawer-actions-cell {
  vertical-align: middle;
  text-align: right;
  white-space: nowrap;
}

.drawer-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

/* Overview Discrepancy Drilldown Grid */
.discrepancy-drilldown-section {
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.section-symbol-amber {
  color: #d97706 !important;
  background: #fef3c7 !important;
}

.discrepancy-drilldown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.drilldown-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.drilldown-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
  transform: translateY(-1px);
}

.dd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.small-btn {
  font-size: 12px !important;
  padding: 4px 10px !important;
  height: 28px !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Evidence Box in Comparison Detail */
.comparison-evidence-box {
  margin-top: 18px;
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.comparison-evidence-box h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 750;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 7px;
}

.comparison-evidence-box h4 svg {
  color: #d97706;
}

.evidence-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.case-trace-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.cell-drilldown-actions {
  margin-top: 8px;
}

.timeline-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-box-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   AI Control Showcase Page (Closed-Loop Autonomous SCM)
   ========================================================================== */

.ai-control-layout {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Executive Dark Hero */
.ai-control-hero {
  background: linear-gradient(135deg, #10241c 0%, #163628 50%, #0d1e17 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 12px;
  padding: 26px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.ai-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ai-badge-pulse {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.ai-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-tag svg {
  width: 14px;
  height: 14px;
  color: #34d399;
}

.ai-tag-version {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.ai-hero-title {
  margin: 0 0 8px 0;
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
}

.ai-hero-desc {
  margin: 0 0 22px 0;
  font-size: 14.5px;
  color: #cbd5e1;
  max-width: 820px;
  line-height: 1.5;
}

.ai-hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.ai-kpi-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(8px);
}

.ai-kpi-card .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-kpi-card .kpi-icon.emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.ai-kpi-card .kpi-icon.blue {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.ai-kpi-card .kpi-icon.teal {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
}

.ai-kpi-card .kpi-icon.amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.ai-kpi-card .kpi-icon svg {
  width: 22px;
  height: 22px;
}

.ai-kpi-card .kpi-body {
  display: flex;
  flex-direction: column;
}

.ai-kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.ai-kpi-card .kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  margin-top: 2px;
}

.ai-kpi-card .kpi-val.emerald {
  color: #34d399;
}

.ai-kpi-card .kpi-val.teal {
  color: #2dd4bf;
}

.ai-kpi-card .kpi-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Control Toolbar & Autonomy Toggle */
.ai-control-toolbar-bar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.autonomy-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.autonomy-mode-toggle .control-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}

.pill-group {
  display: inline-flex;
  background: #eef2ef;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid #dbe4de;
}

.pill-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4b6354;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pill-btn svg {
  width: 14px;
  height: 14px;
}

.pill-btn:hover {
  color: #11281d;
}

.pill-btn.active {
  background: #11281d;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(17, 40, 29, 0.25);
}

.pill-btn.active svg {
  color: #34d399;
}

.simulation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stepper Navigation */
.ai-stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ai-step-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: left;
  transition: all 0.15s ease;
  flex: 0 1 auto;
}

.ai-step-btn:hover {
  background: #f4f6f4;
}

.ai-step-btn .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ai-step-btn .step-num svg {
  width: 15px;
  height: 15px;
}

.ai-step-btn.active .step-num {
  background: #11281d;
  color: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

.ai-step-btn.completed .step-num {
  background: #10b981;
  color: #ffffff;
}

.ai-step-btn .step-meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.ai-step-btn.active .step-meta strong {
  color: #0d1e17;
}

.ai-step-btn .step-meta small {
  display: block;
  font-size: 11px;
  color: #64748b;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-connector {
  flex: 1;
  min-width: 12px;
  max-width: 32px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 4px;
  transition: background 0.3s ease;
}

.step-connector.filled {
  background: #10b981;
}

/* Active Phase Viewport */
.ai-viewport-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  min-height: 380px;
}

.ai-phase-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.phase-badge-header {
  margin-bottom: 4px;
}

.step-indicator-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 6px;
}

.step-indicator-pill.alert-pill {
  background: #fee2e2;
  color: #b91c1c;
}

.step-indicator-pill.purple-pill {
  background: #ede9fe;
  color: #6d28d9;
}

.step-indicator-pill.emerald-pill {
  background: #d1fae5;
  color: #047857;
}

.phase-badge-header h3 {
  margin: 4px 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.phase-subtext {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
}

/* Phase 1: Focus Article & Nodes */
.focus-article-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.focus-article-bar .fa-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.focus-article-bar .fa-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.focus-article-bar .fa-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.focus-article-bar .fa-sku {
  font-size: 12.5px;
  color: #64748b;
}

.network-nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.node-status-card {
  border-radius: 10px;
  padding: 18px;
  border: 1.5px solid;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.node-card-alert {
  background: #fff5f5;
  border-color: #fca5a5;
}

.node-card-excess {
  background: #f0fdf4;
  border-color: #86efac;
}

.node-card-normal {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.nsc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.nsc-city {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.nsc-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

.nsc-metrics {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.stock-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.num-danger {
  color: #dc2626;
}

.num-excess {
  color: #16a34a;
}

.num-normal {
  color: #0f172a;
}

.stock-uom {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
  margin-left: 4px;
}

.nsc-thresholds {
  font-size: 12px;
  color: #475569;
  text-align: right;
  line-height: 1.4;
}

.danger-text {
  color: #dc2626;
  font-weight: 700;
}

.nsc-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
}

.nsc-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fill-danger {
  background: #ef4444;
}

.fill-excess {
  background: #22c55e;
}

.fill-normal {
  background: #3b82f6;
}

/* Phase 2: Anomaly Cards */
.anomaly-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.anomaly-card {
  border-radius: 10px;
  padding: 20px;
  border: 1.5px solid;
}

.anomaly-card.danger-glow {
  background: #fff8f8;
  border-color: #f87171;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.08);
}

.anomaly-card.info-glow {
  background: #f0fdf4;
  border-color: #4ade80;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.08);
}

.ac-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ac-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ac-icon.danger {
  background: #fee2e2;
  color: #dc2626;
}

.ac-icon.info {
  background: #dcfce7;
  color: #16a34a;
}

.ac-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.ac-tag.danger {
  color: #b91c1c;
}

.ac-tag.info {
  color: #15803d;
}

.ac-title-wrap h4 {
  margin: 2px 0 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.ac-body p {
  font-size: 13px;
  color: #334155;
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.ac-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 10px;
}

.ac-submetric {
  display: flex;
  flex-direction: column;
}

.ac-submetric span {
  font-size: 11px;
  color: #64748b;
}

.ac-submetric strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

.ac-submetric.alert strong {
  color: #dc2626;
}

.rebalance-trigger-banner {
  background: linear-gradient(90deg, #f3e8ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.rebalance-trigger-banner .rt-icon {
  color: #7c3aed;
}

.rebalance-trigger-banner .rt-text {
  font-size: 13.5px;
  color: #4c1d95;
  line-height: 1.4;
}

/* Phase 3: Trade-Off Matrix */
.confidence-header-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.confidence-header-card .ch-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.confidence-gauge-val {
  font-size: 26px;
  font-weight: 800;
  color: #059669;
}

.ch-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.ch-sub {
  font-size: 12px;
  color: #64748b;
}

.decision-table th.highlight-column,
.decision-table td.highlight-column {
  background: #f0fdf4;
  border-left: 2px solid #86efac;
  border-right: 2px solid #86efac;
}

.danger-pill {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-block;
}

.success-pill {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-block;
}

.score-low {
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
}

.score-high {
  font-size: 16px;
  font-weight: 800;
  color: #15803d;
}

.llm-reasoning-card {
  background: #11281d;
  color: #ffffff;
  border-radius: 10px;
  padding: 20px 24px;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.lrc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #34d399;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

.lrc-quote {
  margin: 0;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.6;
  font-style: italic;
  border-left: 3px solid #34d399;
  padding-left: 14px;
}

/* Phase 4: Action & Execution */
.action-order-card {
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 22px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.action-order-card.card-executed {
  border-color: #10b981;
  background: #fafdfb;
}

.aoc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.order-ref-badge {
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aoc-title-block h4 {
  margin: 4px 0 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.aoc-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.spec-item strong {
  font-size: 14px;
  color: #0f172a;
  margin-top: 2px;
}

.spec-item small {
  font-size: 11.5px;
  color: #64748b;
}

.quantity-emphasis {
  font-size: 17px !important;
  color: #059669 !important;
  font-weight: 800;
}

.execution-success-banner {
  background: #dcfce7;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.esb-icon {
  color: #16a34a;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.esb-content strong {
  font-size: 15px;
  color: #166534;
  display: block;
  margin-bottom: 4px;
}

.esb-content p {
  font-size: 13px;
  color: #15803d;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.esb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #166534;
}

.post-execution-preview {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 18px;
}

.post-execution-preview h5 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: #166534;
}

.pep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.pep-box {
  background: #ffffff;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.pep-loc {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.pep-stock {
  font-size: 20px;
  font-weight: 800;
  color: #16a34a;
  margin: 2px 0;
}

.aoc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.large-btn {
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
}

.approve-btn {
  background: #059669;
  border-color: #047857;
}

.prompt-alert {
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.prompt-alert.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.prompt-alert.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* LLM Payload Code Card */
.llm-payload-section {
  margin-top: 10px;
}

.llm-payload-card {
  background: #0c1913;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.lpc-header {
  background: #11261d;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.lpc-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lpc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lpc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.lpc-subtitle {
  margin: 2px 0 0 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.lpc-actions {
  display: flex;
  gap: 8px;
}

.lpc-actions .button.subtle {
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.lpc-actions .button.subtle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.lpc-code-wrapper {
  padding: 14px 18px;
  max-height: 460px;
  overflow: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.lpc-pre {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #a7f3d0;
}

.lpc-code {
  color: #a7f3d0;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
}

/* ==========================================================================
   AI Control: Smooth Phase Transitions & Visual Rebalance Pipeline
   ========================================================================== */

.phase-transition {
  animation: phaseFadeIn 0.22s ease-out;
}

@keyframes phaseFadeIn {
  from {
    opacity: 0.3;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.visual-rebalance-pipeline {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

@media (max-width: 960px) {
  .visual-rebalance-pipeline {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.vrp-node {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.vrp-node.source {
  border-left: 5px solid #16a34a;
}

.vrp-node.target {
  border-left: 5px solid #dc2626;
}

.vrp-node-badge {
  font-size: 11.5px;
  font-weight: 750;
  color: #475569;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.vrp-node-badge svg {
  width: 14px;
  height: 14px;
}

.vrp-stock-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.vrp-val {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}

.vrp-uom {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.vrp-label {
  font-size: 13px;
  font-weight: 750;
  margin-top: 4px;
}

.vrp-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.vrp-connector-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 0 10px;
}

.vrp-truck-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #11281d;
  color: #34d399;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(17, 40, 29, 0.2);
  z-index: 2;
}

.vrp-truck-box svg {
  width: 16px;
  height: 16px;
  color: #34d399;
}

.vrp-connector-line {
  width: 100%;
  height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.vrp-connector-wrap.active .vrp-connector-line {
  background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #059669 100%);
}

.vrp-pulse-dot {
  position: absolute;
  top: -2px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseMove 2.2s infinite linear;
}

@keyframes pulseMove {
  0% { left: 0%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.vrp-advantage-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   AI Control: Non-Expert Layman Spotlight Box & Modal
   ========================================================================== */

.ai-layman-explanation {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-left: 5px solid #0284c7;
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ale-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ale-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ale-robot-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ale-robot-icon svg {
  width: 22px;
  height: 22px;
}

.ale-step-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.ale-badge-easy {
  font-size: 11px;
  font-weight: 750;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #bae6fd;
}

.ale-headline {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
}

.ale-modal-btn {
  color: #0284c7 !important;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  font-weight: 650 !important;
}

.ale-modal-btn:hover {
  background: #e0f2fe !important;
}

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

@media (max-width: 900px) {
  .ale-grid {
    grid-template-columns: 1fr;
  }
}

.ale-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ale-box.concept {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.ale-box.results {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ale-box.value {
  background: #fdf4ff;
  border-color: #f5d0fe;
}

.ale-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  color: #1e293b;
}

.ale-box.concept .ale-box-header {
  color: #166534;
}

.ale-box.results .ale-box-header {
  color: #1e40af;
}

.ale-box.value .ale-box-header {
  color: #86198f;
}

.ale-box-icon svg {
  width: 16px;
  height: 16px;
}

.ale-text {
  margin: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

.ale-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
}

.ale-list li {
  margin-bottom: 4px;
}

.ale-roi-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roi-pill {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.roi-pill.blue {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.roi-pill.amber {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.roi-pill.emerald {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.roi-pill.purple {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.roi-pill.rose {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.ale-roi-summary {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #701a75;
  line-height: 1.45;
}

/* Layman Explanation Modal Content */
.ai-modal-explanation {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.ame-header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ame-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.ame-card {
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid;
}

.ame-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ame-card.concept-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.ame-card.concept-card h4 {
  color: #166534;
}

.ame-card.results-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ame-card.results-card h4 {
  color: #1e40af;
}

.ame-card.results-card ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
}

.ame-card.value-card {
  background: #fdf4ff;
  border-color: #f5d0fe;
}

.ame-card.value-card h4 {
  color: #86198f;
}

.ame-roi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ame-roi-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #701a75;
}

.dot.purple {
  background: #7c3aed;
}

/* Floating Architecture Tour Widget */
.investor-tour-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  width: 430px;
  max-width: calc(100vw - 32px);
  background: #0b1f17;
  color: #f8fafc;
  border: 1px solid #1e4f3b;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(52, 211, 153, 0.2);
  animation: tourWidgetIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tourWidgetIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tour-widget-inner {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tour-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding-bottom: 10px;
}

.tour-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tour-rocket-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
  display: grid;
  place-items: center;
}

.tour-rocket-icon svg {
  width: 17px;
  height: 17px;
}

.tour-header-title strong {
  font-size: 14px;
  font-weight: 750;
  color: #ffffff;
}

.tour-step-pill {
  font-size: 11px;
  font-weight: 750;
  background: rgba(52, 211, 153, 0.22);
  color: #6ee7b7;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  letter-spacing: 0.3px;
}

.tour-close-btn {
  color: #94a3b8 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
}

.tour-close-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.tour-widget-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tour-badge-pill {
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 6px;
  padding: 3px 8px;
  align-self: flex-start;
  line-height: 1.3;
}

.tour-widget-body h4 {
  font-size: 15px;
  font-weight: 750;
  color: #ffffff;
  margin: 2px 0 0;
  line-height: 1.35;
}

.tour-widget-body p {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
}

.tour-hint-box {
  background: rgba(52, 211, 153, 0.08);
  border-left: 3px solid #34d399;
  padding: 8px 11px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.4;
}

.tour-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.tour-widget-footer .button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

.tour-widget-footer .button.subtle {
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
}

.tour-widget-footer .button.subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.tour-widget-footer .tour-next-btn {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #022c22 !important;
  font-weight: 750 !important;
}

.tour-widget-footer .tour-next-btn:hover {
  background: #34d399 !important;
  border-color: #34d399 !important;
}

@media (max-width: 600px) {
  .investor-tour-widget {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* ==========================================
   Help Triggers Layout & Multi-Context Styles
   ========================================== */

.spectrum-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spectrum-kpi-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.hero-kpi-label-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ai-kpi-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spectrum-bar-card .help-trigger,
.executive-dark-hero .help-trigger,
.ai-control-hero .help-trigger {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 2px;
  color: #a7c5b6;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  transition: background 0.15s ease, color 0.15s ease;
}

.spectrum-bar-card .help-trigger svg,
.executive-dark-hero .help-trigger svg,
.ai-control-hero .help-trigger svg {
  width: 14px;
  height: 14px;
}

.spectrum-bar-card .help-trigger:hover,
.spectrum-bar-card .help-trigger:focus,
.executive-dark-hero .help-trigger:hover,
.executive-dark-hero .help-trigger:focus,
.ai-control-hero .help-trigger:hover,
.ai-control-hero .help-trigger:focus {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

th .help-trigger {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 2px;
  color: #718096;
  margin-left: 4px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  border-radius: 50%;
}

th .help-trigger svg {
  width: 13px;
  height: 13px;
}

th .help-trigger:hover,
th .help-trigger:focus {
  background: #edf2f7;
  color: #1a202c;
}

.cockpit-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cockpit-card-header .help-trigger {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 2px;
  color: var(--muted);
}

.cockpit-card-header .help-trigger svg {
  width: 14px;
  height: 14px;
}

.pill-group .help-trigger {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 1px;
  color: inherit;
  opacity: 0.75;
}

.pill-group .help-trigger svg {
  width: 13px;
  height: 13px;
}

.pill-group .help-trigger:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
  .spectrum-kpi-label,
  .hero-kpi-label-wrap {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Login / Prototype Access Gate Screen (truestock.one)
   ========================================================================== */
.login-screen-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 18%, #f0fdf4 0%, #f8fafc 55%, #e2e8f0 100%);
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  padding: 34px 28px 24px;
  display: flex;
  flex-direction: column;
  animation: loginCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.login-brand-header .brand-mark svg {
  width: 44px;
  height: 44px;
}

.login-brand-header .brand-text {
  font-size: 24px;
  margin-top: 8px;
}

.login-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.login-tag svg {
  width: 13px;
  height: 13px;
}

.login-title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 14px;
  margin-bottom: 4px;
  text-align: center;
}

.login-desc {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
  margin-bottom: 18px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  display: flex;
  justify-content: space-between;
}

.login-field-group input {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 13px;
  font-size: 14px;
  transition: all 0.15s ease;
  background: #f8fafc;
}

.login-field-group input:focus {
  background: #ffffff;
  border-color: #096b53;
  box-shadow: 0 0 0 3px rgba(9, 107, 83, 0.12);
  outline: none;
}

.login-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-pw-wrap input {
  width: 100%;
  padding-right: 42px;
}

.login-pw-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  padding: 7px;
  display: flex;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-pw-toggle:hover {
  color: #334155;
  background: #f1f5f9;
}

.login-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: loginShake 0.3s ease-in-out;
}

.login-error-msg svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.login-action-box {
  display: flex;
  flex-direction: column;
  margin: 10px 0 6px;
}

.login-submit-btn {
  width: 100%;
  height: 46px;
  background: #096b53;
  color: #ffffff;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(9, 107, 83, 0.25);
}

.login-submit-btn:hover {
  background: #07573f;
  box-shadow: 0 6px 18px rgba(9, 107, 83, 0.35);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-submit-btn svg {
  width: 18px;
  height: 18px;
}

.login-demo-box {
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-demo-text {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-demo-box code {
  background: #e2e8f0;
  color: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.login-autofill-btn {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-autofill-btn:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.login-footer-security {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}

.login-footer-security svg {
  width: 13px;
  height: 13px;
  color: #096b53;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.sidebar-logout-btn svg {
  width: 14px;
  height: 14px;
}


/* Legal links: Footer, Sidebar, and Login screen */
.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.footer-legal-links a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-legal-links a:hover {
  color: #059669;
  text-decoration: underline;
}

.footer-legal-links .sep {
  color: #cbd5e1;
}

.sidebar-legal-links {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  text-align: center;
}

.sidebar-legal-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sidebar-legal-links a:hover {
  color: #059669;
  text-decoration: underline;
}

.login-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
}

.login-legal-links a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.login-legal-links a:hover {
  color: #059669;
  text-decoration: underline;
}

.login-legal-links .sep {
  color: #cbd5e1;
}


/* ==========================================================================
   TRUESTOCK.ONE MOBILE & SMARTPHONE INVESTOR OPTIMIZATIONS
   Designed for one-thumb executive navigation, iOS/Android HIG compliance,
   zero-overflow responsive layouts, and native touch ergonomics.
   ========================================================================== */

/* --- Mobile Bottom Navigation Bar (Hidden on Desktop) --- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1050px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(62px + env(safe-area-inset-bottom, 12px));
    padding-bottom: env(safe-area-inset-bottom, 12px);
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(210, 222, 215, 0.85);
    box-shadow: 0 -4px 24px rgba(10, 25, 18, 0.08);
    z-index: 45;
    user-select: none;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    min-height: 48px;
    padding: 6px 2px;
    color: #556c60;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
    color: #62796e;
    transition: transform 0.15s ease, color 0.15s ease;
  }

  .mobile-nav-item:active svg {
    transform: scale(0.9);
  }

  .mobile-nav-item.active {
    color: var(--green);
    font-weight: 750;
  }

  .mobile-nav-item.active svg {
    color: var(--green);
    transform: translateY(-1px);
  }

  .mobile-nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--green);
    border-radius: 0 0 3px 3px;
  }

  .mobile-nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 10px;
    padding: 0 4px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
  }

  .mobile-nav-pill-demo {
    position: absolute;
    top: -6px;
    right: -16px;
    font-size: 8.5px;
    font-weight: 800;
    color: #047857;
    background: #e6f7ef;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 1px 3px;
    line-height: 1;
  }

  /* Padding offset so bottom nav doesn't cover content or footer */
  .app-body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 14px)) !important;
  }

  main {
    padding-bottom: calc(52px + env(safe-area-inset-bottom, 14px)) !important;
  }

  .investor-tour-widget {
    bottom: calc(76px + env(safe-area-inset-bottom, 14px)) !important;
  }
}

/* --- Mobile Swipe & Scroll Improvements (<= 768px) --- */
@media (max-width: 768px) {
  /* Process Mining interactive diagram mobile scroll & helper */
  .mobile-diagram-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: #edf8f2;
    color: #096b53;
    border-bottom: 1px solid #d1fae5;
    font-size: 12px;
    font-weight: 650;
    user-select: none;
  }

  .mobile-diagram-swipe-hint svg {
    width: 16px;
    height: 16px;
    animation: handSwipeAnim 2s infinite ease-in-out;
  }

  @keyframes handSwipeAnim {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(7px); }
  }

  .diagram-scroll-viewport {
    padding: 14px 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* AI Simulation Stepper on Mobile (horizontal tab swipe instead of blowout) */
  .ai-stepper-nav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    scrollbar-width: none !important;
    max-width: 100% !important;
    border-radius: 10px !important;
  }

  .ai-stepper-nav::-webkit-scrollbar {
    display: none;
  }

  .ai-step-btn {
    flex: 0 0 auto !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 7px 11px !important;
  }

  .ai-step-btn.active {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15) !important;
  }

  .ai-step-btn .step-meta strong {
    white-space: nowrap !important;
    font-size: 12px !important;
  }

  .ai-step-btn .step-meta small {
    display: none !important;
  }

  .step-connector {
    display: none !important;
  }

  /* Prevent JSON payload container blowout */
  .llm-payload-card, .llm-payload-section, .lpc-code-wrapper, .lpc-pre, .lpc-code {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
  }

  .lpc-code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }
}

/* --- Smartphone Screen Optimizations (<= 640px) --- */
@media (max-width: 640px) {
  /* Prevent iOS Safari auto-zoom on input focus (requires >= 16px font-size) */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Touch targets minimum 44px for thumb comfort */
  .button, button.button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .icon-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  /* Tactile feedback on touch */
  .button:active, .sku-chip:active, .mobile-stock:active, .variant-card:active, .ai-step-btn:active {
    transform: scale(0.985);
  }

  /* Market SKU Selector Chips: Horizontal swipe rail */
  .market-sku-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    margin-left: -2px !important;
    margin-right: -2px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    scrollbar-width: none !important;
  }

  .market-sku-chips::-webkit-scrollbar {
    display: none;
  }

  .sku-chip {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 7px 13px !important;
    min-height: 38px !important;
    font-size: 12.5px !important;
  }

  /* Market modes button bar */
  .market-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .market-modes {
    display: flex !important;
    width: 100% !important;
  }

  .market-mode-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    min-height: 42px !important;
  }

  /* Simulation toolbar in AI Control */
  .simulation-actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .simulation-actions .button {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  .simulation-actions .button-group {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .simulation-actions .button-group .button {
    flex: 1 !important;
  }

  /* AI Layman explanation card */
  .ai-layman-explanation {
    padding: 16px 14px !important;
    border-radius: 10px !important;
  }

  .ale-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .ale-box {
    padding: 14px 14px !important;
  }

  /* Modal / Dialog bottom sheet on smartphone */
  dialog {
    width: calc(100% - 16px) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 36px) !important;
    margin: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
  }

  dialog.wide-dialog {
    width: calc(100% - 16px) !important;
  }

  .dialog-header {
    padding: 16px 18px !important;
  }

  .dialog-body {
    padding: 16px 18px !important;
  }

  .dialog-footer {
    padding: 14px 18px !important;
    gap: 10px !important;
  }

  /* Dual Timeline lanes in analysis-demo */
  .dual-timeline-card {
    padding: 14px 12px !important;
    border-radius: 10px !important;
  }

  .timeline-lane {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .lane-track {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
  }

  /* Visual Rebalance Pipeline */
  .visual-rebalance-pipeline {
    padding: 16px 14px !important;
  }

  .vrp-val {
    font-size: 28px !important;
  }

  /* Comparison mode tabs */
  .comparison-mode-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 6px !important;
  }

  .comparison-mode-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  /* Metrics 2x2 grid polish */
  .metrics-band {
    border-radius: 10px;
    border: 1px solid var(--line) !important;
    overflow: hidden;
    margin-bottom: 22px;
  }

  /* Executive Dark Hero items */
  .hero-kpis {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px 10px !important;
  }

  .hero-kpi-item:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* Subtle table scroll indicator */
.table-scroll {
  background: 
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 0 100%,
    radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)) 0 100%;
  background-repeat: no-repeat;
  background-color: white;
  background-size: 36px 100%, 36px 100%, 12px 100%, 12px 100%;
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-attachment: local, local, scroll, scroll;
}


/* --- Refinements for Zero-Overflow and Clean Mobile Experience --- */
.decision-matrix-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-sizing: border-box;
}

.decision-matrix-table-wrap .data-table {
  min-width: 580px;
}

@media (max-width: 640px) {
  /* Prevent horizontal stretch on main app wrapper */
  #app, .app-body, .workspace-body, main {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Autonomy mode toggle: vertical wrap on smartphone */
  .autonomy-mode-toggle {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .autonomy-mode-toggle .control-label {
    font-size: 13px !important;
    margin-bottom: 2px !important;
  }

  .autonomy-mode-toggle .pill-group {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px !important;
  }

  .autonomy-mode-toggle .pill-btn {
    width: 100% !important;
    justify-content: flex-start !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    min-height: 40px !important;
    font-size: 12.5px !important;
  }

  /* Network Stock Cards in AI Control */
  .nsc-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .nsc-header .badge {
    align-self: flex-start !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .network-stock-card {
    padding: 16px 14px !important;
  }

  /* Confidence Header Card */
  .confidence-header-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px !important;
  }

  /* Action Order Card execution buttons */
  .aoc-actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .aoc-actions .button {
    width: 100% !important;
    justify-content: center !important;
    min-height: 46px !important;
  }
}


/* --- KPI Labels: Prevent Unwanted Ellipsis Truncation on Mobile --- */
@media (max-width: 640px) {
  .hero-kpis {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .hero-kpi-item, .spectrum-kpi {
    min-width: 0 !important;
    text-align: left !important;
  }

  .hero-kpi-item small,
  .hero-kpi-label-wrap small,
  .spectrum-kpi small,
  .spectrum-kpi-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    display: block !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }

  .hero-kpi-item strong,
  .spectrum-kpi strong {
    font-size: 16px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  .hero-kpi-item .kpi-sub,
  .spectrum-kpi .kpi-sub {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    display: block !important;
    word-break: break-word !important;
  }
}

/* === TrueStock.one Dark Mode Design System === */

/* Theme Toggle Button */
.theme-toggle-btn {
  color: #556c60;
  transition: transform 0.25s ease, color 0.15s ease, background 0.15s ease;
}
.theme-toggle-btn:hover {
  color: #096b53;
  transform: rotate(18deg);
}
.login-theme-bar {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10001;
}
.login-theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.8);
  color: #475569;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.login-theme-toggle:hover {
  background: #ffffff;
  color: #096b53;
}

/* 1. CSS Custom Properties for Dark Mode */
html.dark,
html[data-theme="dark"],
:root.dark,
:root[data-theme="dark"] {
  --color-scheme: dark;
  --ink: #e6ede9;
  --muted: #94a9a0;
  --subtle: #6e857c;
  --line: #1c3028;
  --surface: #0e1a15;
  --canvas: #08110e;
  --green: #10b981;
  --green-light: rgba(16, 185, 129, 0.16);
  --blue: #60a5fa;
  --blue-light: rgba(59, 130, 246, 0.16);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.16);
  --red: #f87171;
  --red-light: rgba(239, 68, 68, 0.16);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]),
  html:not([data-theme="light"]) {
    --color-scheme: dark;
    --ink: #e6ede9;
    --muted: #94a9a0;
    --subtle: #6e857c;
    --line: #1c3028;
    --surface: #0e1a15;
    --canvas: #08110e;
    --green: #10b981;
    --green-light: rgba(16, 185, 129, 0.16);
    --blue: #60a5fa;
    --blue-light: rgba(59, 130, 246, 0.16);
    --amber: #f59e0b;
    --amber-light: rgba(245, 158, 11, 0.16);
    --red: #f87171;
    --red-light: rgba(239, 68, 68, 0.16);
    color-scheme: dark;
  }
}

html.dark body,
html[data-theme="dark"] body,
html.dark #app,
html[data-theme="dark"] #app {
  background-color: var(--canvas) !important;
  color: var(--ink) !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body,
  html:not([data-theme="light"]) #app {
    background-color: var(--canvas) !important;
    color: var(--ink) !important;
  }
}

html.dark .theme-toggle-btn,
html[data-theme="dark"] .theme-toggle-btn {
  color: #fbbf24;
}
html.dark .theme-toggle-btn:hover,
html[data-theme="dark"] .theme-toggle-btn:hover {
  color: #fef08a;
  background: #172a23;
  transform: rotate(-18deg);
}
html.dark .login-theme-toggle,
html[data-theme="dark"] .login-theme-toggle {
  background: rgba(17, 29, 25, 0.9);
  border-color: #1f362c;
  color: #fbbf24;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
html.dark .login-theme-toggle:hover,
html[data-theme="dark"] .login-theme-toggle:hover {
  background: #1a2f26;
  color: #fef08a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle-btn {
    color: #fbbf24;
  }
  html:not([data-theme="light"]) .theme-toggle-btn:hover {
    color: #fef08a;
    background: #172a23;
    transform: rotate(-18deg);
  }
  html:not([data-theme="light"]) .login-theme-toggle {
    background: rgba(17, 29, 25, 0.9);
    border-color: #1f362c;
    color: #fbbf24;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  html:not([data-theme="light"]) .login-theme-toggle:hover {
    background: #1a2f26;
    color: #fef08a;
  }
}
html.dark .sidebar,
html[data-theme="dark"] .sidebar {
  background: #0d1714 !important; border-right-color: #1c3028 !important;
}
html.dark .brand-true,
html[data-theme="dark"] .brand-true {
  color: #f8fafc !important;
}
html.dark .brand-stock,
html[data-theme="dark"] .brand-stock {
  color: #34d399 !important;
}
html.dark .brand:hover .brand-stock,
html[data-theme="dark"] .brand:hover .brand-stock {
  color: #6ee7b7 !important;
}
html.dark .brand-tld, html.dark .brand-dot,
html[data-theme="dark"] .brand-tld, html[data-theme="dark"] .brand-dot {
  color: #10b981 !important;
}
html.dark .workspace-switch,
html[data-theme="dark"] .workspace-switch {
  background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
}
html.dark .workspace-switch:hover,
html[data-theme="dark"] .workspace-switch:hover {
  background: #172a23 !important; border-color: #2b453a !important;
}
html.dark .workspace-switch strong,
html[data-theme="dark"] .workspace-switch strong {
  color: #f0fdf4 !important;
}
html.dark .workspace-switch small,
html[data-theme="dark"] .workspace-switch small {
  color: #94a9a0 !important;
}
html.dark .workspace-switch > svg,
html[data-theme="dark"] .workspace-switch > svg {
  color: #728980 !important;
}
html.dark .company-avatar,
html[data-theme="dark"] .company-avatar {
  background: #183025 !important; color: #34d399 !important;
}
html.dark .nav-caption,
html[data-theme="dark"] .nav-caption {
  color: #6e857b !important;
}
html.dark .nav-item,
html[data-theme="dark"] .nav-item {
  color: #9bb0a5 !important;
}
html.dark .nav-item > svg,
html[data-theme="dark"] .nav-item > svg {
  color: #728980 !important;
}
html.dark .nav-item:hover,
html[data-theme="dark"] .nav-item:hover {
  background: #162821 !important; color: #f0fdf4 !important;
}
html.dark .nav-item:hover > svg,
html[data-theme="dark"] .nav-item:hover > svg {
  color: #34d399 !important;
}
html.dark .nav-item.active,
html[data-theme="dark"] .nav-item.active {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
}
html.dark .nav-item.active > svg,
html[data-theme="dark"] .nav-item.active > svg {
  color: #34d399 !important;
}
html.dark .nav-item.active::before,
html[data-theme="dark"] .nav-item.active::before {
  background: #10b981 !important;
}
html.dark .nav-tag,
html[data-theme="dark"] .nav-tag {
  background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important;
}
html.dark .nav-count,
html[data-theme="dark"] .nav-count {
  background: rgba(16, 185, 129, 0.22) !important; color: #34d399 !important;
}
html.dark .nav-separator,
html[data-theme="dark"] .nav-separator {
  background: #1c3028 !important;
}
html.dark .database-status,
html[data-theme="dark"] .database-status {
  color: #819b8f !important;
}
html.dark .database-status .status-dot,
html[data-theme="dark"] .database-status .status-dot {
  background: #10b981 !important;
}
html.dark .sidebar-version-badge,
html[data-theme="dark"] .sidebar-version-badge {
  border-top-color: #1c3028 !important;
}
html.dark .sidebar-version-badge .version-label,
html[data-theme="dark"] .sidebar-version-badge .version-label {
  background: #13221d !important; border-color: #1c3028 !important; color: #819b8f !important;
}
html.dark .sidebar-legal-links,
html[data-theme="dark"] .sidebar-legal-links {
  color: #6e857b !important;
}
html.dark .sidebar-legal-links a,
html[data-theme="dark"] .sidebar-legal-links a {
  color: #6e857b !important;
}
html.dark .sidebar-legal-links a:hover,
html[data-theme="dark"] .sidebar-legal-links a:hover {
  color: #34d399 !important;
}
html.dark .sidebar-logout-btn,
html[data-theme="dark"] .sidebar-logout-btn {
  background: transparent !important; color: #819b8f !important;
}
html.dark .sidebar-logout-btn:hover,
html[data-theme="dark"] .sidebar-logout-btn:hover {
  background: #162821 !important; color: #f87171 !important;
}
html.dark .topbar,
html[data-theme="dark"] .topbar {
  background: #0d1714 !important; border-bottom-color: #1c3028 !important;
}
html.dark .breadcrumb span,
html[data-theme="dark"] .breadcrumb span {
  color: #6e857b !important;
}
html.dark .breadcrumb strong,
html[data-theme="dark"] .breadcrumb strong {
  color: #f0fdf4 !important;
}
html.dark .breadcrumb svg,
html[data-theme="dark"] .breadcrumb svg {
  color: #6e857b !important;
}
html.dark .global-search,
html[data-theme="dark"] .global-search {
  background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
}
html.dark .global-search:hover,
html[data-theme="dark"] .global-search:hover {
  background: #172a23 !important; border-color: #2b453a !important;
}
html.dark .global-search svg,
html[data-theme="dark"] .global-search svg {
  color: #728980 !important;
}
html.dark #language,
html[data-theme="dark"] #language {
  background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
}
html.dark #language option,
html[data-theme="dark"] #language option {
  background: #13221d !important; color: #e6ede9 !important;
}
html.dark .copilot-toggle,
html[data-theme="dark"] .copilot-toggle {
  background: rgba(59, 130, 246, 0.16) !important; border-color: rgba(59, 130, 246, 0.35) !important; color: #93c5fd !important;
}
html.dark .copilot-toggle.selected,
html[data-theme="dark"] .copilot-toggle.selected {
  background: rgba(59, 130, 246, 0.25) !important; border-color: #60a5fa !important; color: #bfdbfe !important;
}
html.dark .app-footer,
html[data-theme="dark"] .app-footer {
  background: #0d1714 !important; border-top-color: #1c3028 !important; color: #819b8f !important;
}
html.dark .app-footer a,
html[data-theme="dark"] .app-footer a {
  color: #819b8f !important;
}
html.dark .app-footer a:hover,
html[data-theme="dark"] .app-footer a:hover {
  color: #34d399 !important;
}
html.dark .mobile-bottom-nav,
html[data-theme="dark"] .mobile-bottom-nav {
  background: #0d1714 !important; border-top-color: #1c3028 !important;
}
html.dark .mobile-nav-item,
html[data-theme="dark"] .mobile-nav-item {
  color: #819b8f !important;
}
html.dark .mobile-nav-item:hover,
html[data-theme="dark"] .mobile-nav-item:hover {
  color: #34d399 !important;
}
html.dark .mobile-nav-item.active,
html[data-theme="dark"] .mobile-nav-item.active {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
}
html.dark .mobile-nav-item.active svg,
html[data-theme="dark"] .mobile-nav-item.active svg {
  color: #34d399 !important;
}
html.dark .mobile-nav-pill-demo,
html[data-theme="dark"] .mobile-nav-pill-demo {
  background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important;
}
html.dark .mobile-nav-badge,
html[data-theme="dark"] .mobile-nav-badge {
  background: #10b981 !important; color: #ffffff !important;
}
html.dark .page-heading,
html[data-theme="dark"] .page-heading {
  background: #0f1c17 !important; border-color: #1c3028 !important; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}
html.dark .page-heading h1,
html[data-theme="dark"] .page-heading h1 {
  color: #f0fdf4 !important;
}
html.dark .page-heading .eyebrow,
html[data-theme="dark"] .page-heading .eyebrow {
  color: #34d399 !important;
}
html.dark .page-heading .eyebrow::before,
html[data-theme="dark"] .page-heading .eyebrow::before {
  background: #10b981 !important;
}
html.dark .page-purpose,
html[data-theme="dark"] .page-purpose {
  background: linear-gradient(110deg, #12211a, #152720) !important; border-color: #1c3028 !important;
}
html.dark .page-purpose::before,
html[data-theme="dark"] .page-purpose::before {
  background: #10b981 !important;
}
html.dark .purpose-text,
html[data-theme="dark"] .purpose-text {
  color: #cbdcd4 !important;
}
html.dark .page-purpose--dark,
html[data-theme="dark"] .page-purpose--dark {
  background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(52, 211, 153, 0.2) !important;
}
html.dark .comparison-mode-nav,
html[data-theme="dark"] .comparison-mode-nav {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .comp-mode-btn,
html[data-theme="dark"] .comp-mode-btn {
  color: #8da498 !important;
}
html.dark .comp-mode-btn:hover,
html[data-theme="dark"] .comp-mode-btn:hover {
  background: #182c23 !important; color: #34d399 !important;
}
html.dark .comp-mode-btn.active,
html[data-theme="dark"] .comp-mode-btn.active {
  background: #1c332a !important; color: #34d399 !important; border-color: #2c4f40 !important; box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
}
html.dark .metrics-band,
html[data-theme="dark"] .metrics-band {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .metric + .metric,
html[data-theme="dark"] .metric + .metric {
  border-left-color: #1c3028 !important;
}
html.dark .metric-label,
html[data-theme="dark"] .metric-label {
  color: #94a9a0 !important;
}
html.dark .metric-value,
html[data-theme="dark"] .metric-value {
  color: #f0fdf4 !important;
}
html.dark .metric-note,
html[data-theme="dark"] .metric-note {
  color: #6e857b !important;
}
html.dark .metric-icon,
html[data-theme="dark"] .metric-icon {
  background: rgba(59, 130, 246, 0.16) !important; color: #60a5fa !important;
}
html.dark .metric-icon.green,
html[data-theme="dark"] .metric-icon.green {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
}
html.dark .metric-icon.amber,
html[data-theme="dark"] .metric-icon.amber {
  background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important;
}
html.dark .metric-icon.muted,
html[data-theme="dark"] .metric-icon.muted {
  background: #1e293b !important; color: #94a3b8 !important;
}
html.dark .table-section,
html[data-theme="dark"] .table-section {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .section-heading h2,
html[data-theme="dark"] .section-heading h2 {
  color: #f0fdf4 !important;
}
html.dark .section-heading h2 > svg,
html[data-theme="dark"] .section-heading h2 > svg {
  color: #34d399 !important;
}
html.dark .section-count,
html[data-theme="dark"] .section-count {
  background: #162720 !important; color: #8da498 !important;
}
html.dark .section-symbol,
html[data-theme="dark"] .section-symbol {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
}
html.dark .section-meta,
html[data-theme="dark"] .section-meta {
  color: #728980 !important;
}
html.dark .comparison-context,
html[data-theme="dark"] .comparison-context {
  border-color: #1c3028 !important;
}
html.dark .context-system strong,
html[data-theme="dark"] .context-system strong {
  color: #f0fdf4 !important;
}
html.dark .context-system small,
html[data-theme="dark"] .context-system small {
  color: #728980 !important;
}
html.dark .system-avatar,
html[data-theme="dark"] .system-avatar {
  background: #182e24 !important; border-color: #274b3a !important; color: #34d399 !important;
}
html.dark .system-1,
html[data-theme="dark"] .system-1 {
  background: rgba(59, 130, 246, 0.15) !important; border-color: rgba(59, 130, 246, 0.35) !important; color: #93c5fd !important;
}
html.dark .system-2,
html[data-theme="dark"] .system-2 {
  background: rgba(168, 85, 247, 0.15) !important; border-color: rgba(168, 85, 247, 0.35) !important; color: #d8b4fe !important;
}
html.dark .table-toolbar,
html[data-theme="dark"] .table-toolbar {
  border-bottom-color: #1c3028 !important;
}
html.dark .data-table th,
html[data-theme="dark"] .data-table th {
  background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
}
html.dark .data-table td,
html[data-theme="dark"] .data-table td {
  background: #0f1c17 !important; border-color: #1c3028 !important; color: #e6ede9 !important;
}
html.dark .data-table tbody tr:hover td,
html[data-theme="dark"] .data-table tbody tr:hover td {
  background: #152720 !important;
}
html.dark .data-table tbody tr.different td:first-child,
html[data-theme="dark"] .data-table tbody tr.different td:first-child {
  border-left-color: #f59e0b !important;
}
html.dark .comparison-table td:first-child, html.dark .comparison-table th:first-child,
html[data-theme="dark"] .comparison-table td:first-child, html[data-theme="dark"] .comparison-table th:first-child {
  box-shadow: 1px 0 0 #1c3028 !important; background: #0f1c17 !important;
}
html.dark .comparison-table th:first-child,
html[data-theme="dark"] .comparison-table th:first-child {
  background: #13221d !important;
}
html.dark .search-field,
html[data-theme="dark"] .search-field {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .search-field input,
html[data-theme="dark"] .search-field input {
  color: #e6ede9 !important;
}
html.dark .search-field svg,
html[data-theme="dark"] .search-field svg {
  color: #728980 !important;
}
html.dark .filter-tab,
html[data-theme="dark"] .filter-tab {
  color: #8da498 !important;
}
html.dark .filter-tab:hover,
html[data-theme="dark"] .filter-tab:hover {
  background: #162821 !important; color: #f0fdf4 !important;
}
html.dark .filter-tab.active,
html[data-theme="dark"] .filter-tab.active {
  background: #1a3328 !important; color: #34d399 !important; border-color: #274d3d !important;
}
html.dark .filter-tab span,
html[data-theme="dark"] .filter-tab span {
  background: #14231e !important; color: #8da498 !important;
}
html.dark .filter-tab.active span,
html[data-theme="dark"] .filter-tab.active span {
  background: rgba(52, 211, 153, 0.22) !important; color: #34d399 !important;
}
html.dark .table-footer,
html[data-theme="dark"] .table-footer {
  border-top-color: #1c3028 !important; color: #8da498 !important;
}
html.dark .table-footer .icon-button,
html[data-theme="dark"] .table-footer .icon-button {
  background: #13221d !important; border-color: #1c3028 !important; color: #8da498 !important;
}
html.dark .table-footer .icon-button:hover,
html[data-theme="dark"] .table-footer .icon-button:hover {
  background: #182c23 !important; color: #f0fdf4 !important;
}
html.dark .table-scroll,
html[data-theme="dark"] .table-scroll {
  scrollbar-color: #27483a #0f1c17 !important;
}
html.dark input, html.dark select, html.dark textarea,
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important; color-scheme: dark !important;
}
html.dark input:focus, html.dark select:focus, html.dark textarea:focus,
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus {
  border-color: #10b981 !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important; background: #162720 !important;
}
html.dark ::placeholder,
html[data-theme="dark"] ::placeholder {
  color: #5b7368 !important;
}
html.dark .button,
html[data-theme="dark"] .button {
  background: #14241e !important; border-color: #233b30 !important; color: #e6ede9 !important;
}
html.dark .button:hover,
html[data-theme="dark"] .button:hover {
  background: #1c332a !important; border-color: #355748 !important; color: #ffffff !important;
}
html.dark .button.primary,
html[data-theme="dark"] .button.primary {
  background: #059669 !important; border-color: #059669 !important; color: #ffffff !important;
}
html.dark .button.primary:hover,
html[data-theme="dark"] .button.primary:hover {
  background: #047857 !important; border-color: #047857 !important;
}
html.dark .button.selected,
html[data-theme="dark"] .button.selected {
  background: rgba(16, 185, 129, 0.18) !important; border-color: #10b981 !important; color: #34d399 !important;
}
html.dark .icon-button,
html[data-theme="dark"] .icon-button {
  color: #8fa59b !important;
}
html.dark .icon-button:hover,
html[data-theme="dark"] .icon-button:hover {
  background: #172a23 !important; color: #f0fdf4 !important;
}
html.dark .help-trigger,
html[data-theme="dark"] .help-trigger {
  color: #728980 !important;
}
html.dark .help-trigger:hover, html.dark .help-trigger:focus,
html[data-theme="dark"] .help-trigger:hover, html[data-theme="dark"] .help-trigger:focus {
  background: #182b23 !important; color: #34d399 !important;
}
html.dark .text-button,
html[data-theme="dark"] .text-button {
  color: #e6ede9 !important;
}
html.dark .text-link,
html[data-theme="dark"] .text-link {
  color: #34d399 !important;
}
html.dark .badge,
html[data-theme="dark"] .badge {
  background: #152720 !important; color: #cbdcd4 !important;
}
html.dark .badge.different, html.dark .badge.amber, html.dark .badge.conditional, html.dark .badge.incomplete, html.dark .badge.timing_lag,
html[data-theme="dark"] .badge.different, html[data-theme="dark"] .badge.amber, html[data-theme="dark"] .badge.conditional, html[data-theme="dark"] .badge.incomplete, html[data-theme="dark"] .badge.timing_lag {
  background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
html.dark .badge.equal, html.dark .badge.complete, html.dark .badge.allowed,
html[data-theme="dark"] .badge.equal, html[data-theme="dark"] .badge.complete, html[data-theme="dark"] .badge.allowed {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
html.dark .badge.missing, html.dark .badge.missing_counterpart, html.dark .badge.incomparable, html.dark .badge.unknown, html.dark .badge.preview, html.dark .badge.duplicate,
html[data-theme="dark"] .badge.missing, html[data-theme="dark"] .badge.missing_counterpart, html[data-theme="dark"] .badge.incomparable, html[data-theme="dark"] .badge.unknown, html[data-theme="dark"] .badge.preview, html[data-theme="dark"] .badge.duplicate {
  background: rgba(148, 163, 184, 0.14) !important; color: #94a3b8 !important; border: 1px solid rgba(148, 163, 184, 0.25) !important;
}
html.dark .badge.invalid, html.dark .badge.prohibited,
html[data-theme="dark"] .badge.invalid, html[data-theme="dark"] .badge.prohibited {
  background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
html.dark .badge.value,
html[data-theme="dark"] .badge.value {
  background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important; border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
html.dark .badge.demo,
html[data-theme="dark"] .badge.demo {
  background: rgba(168, 85, 247, 0.16) !important; color: #c084fc !important; border: 1px solid rgba(168, 85, 247, 0.3) !important;
}
html.dark .mode-badge.green,
html[data-theme="dark"] .mode-badge.green {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
}
html.dark .mode-badge.amber,
html[data-theme="dark"] .mode-badge.amber {
  background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important;
}
html.dark .copilot-panel,
html[data-theme="dark"] .copilot-panel {
  background: #0d1714 !important; border-left-color: #1c3028 !important;
}
html.dark .copilot-header,
html[data-theme="dark"] .copilot-header {
  border-bottom-color: #1c3028 !important;
}
html.dark .copilot-header strong,
html[data-theme="dark"] .copilot-header strong {
  color: #f0fdf4 !important;
}
html.dark .copilot-header small,
html[data-theme="dark"] .copilot-header small {
  color: #8da498 !important;
}
html.dark .copilot-symbol,
html[data-theme="dark"] .copilot-symbol {
  background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important;
}
html.dark .copilot-context,
html[data-theme="dark"] .copilot-context {
  background: #13221d !important; color: #8da498 !important;
}
html.dark .assistant-message,
html[data-theme="dark"] .assistant-message {
  color: #d1e2da !important;
}
html.dark .user-message,
html[data-theme="dark"] .user-message {
  background: #172a38 !important; color: #bae6fd !important;
}
html.dark .action-draft,
html[data-theme="dark"] .action-draft {
  background: #13221d !important; border-color: #223f33 !important;
}
html.dark .action-draft strong,
html[data-theme="dark"] .action-draft strong {
  color: #f0fdf4 !important;
}
html.dark .action-draft .eyebrow,
html[data-theme="dark"] .action-draft .eyebrow {
  color: #34d399 !important;
}
html.dark .copilot-suggestions button,
html[data-theme="dark"] .copilot-suggestions button {
  background: #13221d !important; border-color: #1c3028 !important; color: #94a9a0 !important;
}
html.dark .copilot-suggestions button:hover,
html[data-theme="dark"] .copilot-suggestions button:hover {
  background: #182b24 !important; color: #f0fdf4 !important; border-color: #2b453a !important;
}
html.dark #copilot-form,
html[data-theme="dark"] #copilot-form {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark #copilot-form:focus-within,
html[data-theme="dark"] #copilot-form:focus-within {
  border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}
html.dark #copilot-form textarea,
html[data-theme="dark"] #copilot-form textarea {
  color: #e6ede9 !important;
}
html.dark .copilot-disclosure,
html[data-theme="dark"] .copilot-disclosure {
  color: #6e857b !important;
}
html.dark dialog,
html[data-theme="dark"] dialog {
  background: #0f1c17 !important; border-color: #1c3028 !important; color: #e6ede9 !important; box-shadow: 0 24px 85px rgba(0, 0, 0, 0.65) !important;
}
html.dark dialog::backdrop,
html[data-theme="dark"] dialog::backdrop {
  background: rgba(0, 0, 0, 0.75) !important;
}
html.dark .dialog-header,
html[data-theme="dark"] .dialog-header {
  background: #0f1c17 !important; border-bottom-color: #1c3028 !important; color: #f0fdf4 !important;
}
html.dark .dialog-footer,
html[data-theme="dark"] .dialog-footer {
  background: #0a1410 !important; border-top-color: #1c3028 !important;
}
html.dark .field > span, html.dark .field-caption,
html[data-theme="dark"] .field > span, html[data-theme="dark"] .field-caption {
  color: #cbdcd4 !important;
}
html.dark .form-section-title,
html[data-theme="dark"] .form-section-title {
  color: #f0fdf4 !important; border-top-color: #1c3028 !important;
}
html.dark .form-note,
html[data-theme="dark"] .form-note {
  color: #8da498 !important;
}
html.dark .upload-zone,
html[data-theme="dark"] .upload-zone {
  background: #13221d !important; border-color: #274b3a !important; color: #34d399 !important;
}
html.dark .upload-zone > span,
html[data-theme="dark"] .upload-zone > span {
  color: #8da498 !important;
}
html.dark .package-row,
html[data-theme="dark"] .package-row {
  border-color: #1c3028 !important;
}
html.dark .package-row legend,
html[data-theme="dark"] .package-row legend {
  color: #cbdcd4 !important;
}
html.dark .remove-package,
html[data-theme="dark"] .remove-package {
  background: #0f1c17 !important;
}
html.dark .donut-total-text,
html[data-theme="dark"] .donut-total-text {
  fill: #f0fdf4 !important;
}
html.dark .donut-unit-text,
html[data-theme="dark"] .donut-unit-text {
  fill: #8da498 !important;
}
html.dark .gauge-val-text,
html[data-theme="dark"] .gauge-val-text {
  fill: #f0fdf4 !important;
}
html.dark .gauge-title,
html[data-theme="dark"] .gauge-title {
  color: #f0fdf4 !important;
}
html.dark .gauge-status-badge.optimal,
html[data-theme="dark"] .gauge-status-badge.optimal {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.35) !important;
}
html.dark .gauge-status-badge.elevated,
html[data-theme="dark"] .gauge-status-badge.elevated {
  background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.35) !important;
}
html.dark .gauge-status-badge.critical,
html[data-theme="dark"] .gauge-status-badge.critical {
  background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.35) !important;
}
html.dark .int-kpi,
html[data-theme="dark"] .int-kpi {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .int-kpi small,
html[data-theme="dark"] .int-kpi small {
  color: #8da498 !important;
}
html.dark .int-kpi strong,
html[data-theme="dark"] .int-kpi strong {
  color: #f0fdf4 !important;
}
html.dark .hbar-label,
html[data-theme="dark"] .hbar-label {
  color: #cbdcd4 !important;
}
html.dark .hbar-val strong,
html[data-theme="dark"] .hbar-val strong {
  color: #f0fdf4 !important;
}
html.dark .hbar-track,
html[data-theme="dark"] .hbar-track {
  background: #182b23 !important;
}
html.dark .depot-summary-note,
html[data-theme="dark"] .depot-summary-note {
  border-top-color: #1c3028 !important; color: #8da498 !important;
}
html.dark .delta-bar-track,
html[data-theme="dark"] .delta-bar-track {
  background: #182b23 !important;
}
html.dark .market-modes,
html[data-theme="dark"] .market-modes {
  background: #13221d !important;
}
html.dark .market-mode-btn,
html[data-theme="dark"] .market-mode-btn {
  color: #8da498 !important;
}
html.dark .market-mode-btn:hover,
html[data-theme="dark"] .market-mode-btn:hover {
  color: #e6ede9 !important; background: #182c23 !important;
}
html.dark .market-mode-btn.active,
html[data-theme="dark"] .market-mode-btn.active {
  background: #1c332a !important; color: #34d399 !important;
}
html.dark .market-search-box,
html[data-theme="dark"] .market-search-box {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .market-search-box svg,
html[data-theme="dark"] .market-search-box svg {
  color: #728980 !important;
}
html.dark .market-search-input,
html[data-theme="dark"] .market-search-input {
  color: #e6ede9 !important;
}
html.dark .sku-chip,
html[data-theme="dark"] .sku-chip {
  background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
}
html.dark .sku-chip:hover,
html[data-theme="dark"] .sku-chip:hover {
  background: #182c23 !important; border-color: #10b981 !important;
}
html.dark .sku-chip.active,
html[data-theme="dark"] .sku-chip.active {
  background: #059669 !important; color: #ffffff !important; border-color: #059669 !important;
}
html.dark .market-map-card,
html[data-theme="dark"] .market-map-card {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .market-map-header,
html[data-theme="dark"] .market-map-header {
  background: #13221d !important; border-bottom-color: #1c3028 !important;
}
html.dark .market-map-header h3,
html[data-theme="dark"] .market-map-header h3 {
  color: #f0fdf4 !important;
}
html.dark .legend-chip,
html[data-theme="dark"] .legend-chip {
  background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
}
html.dark .legend-chip:hover,
html[data-theme="dark"] .legend-chip:hover {
  background: #182c23 !important; border-color: #10b981 !important; color: #f0fdf4 !important;
}
html.dark .legend-chip.active,
html[data-theme="dark"] .legend-chip.active {
  background: rgba(16, 185, 129, 0.18) !important; border-color: #10b981 !important; color: #34d399 !important;
}
html.dark .legend-count,
html[data-theme="dark"] .legend-count {
  background: #182b23 !important; color: #8da498 !important;
}
html.dark .leaflet-tile,
html[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.65) invert(1) contrast(1.7) hue-rotate(185deg) saturate(0.5) !important;
}
html.dark .leaflet-container,
html[data-theme="dark"] .leaflet-container {
  background: #0b1411 !important;
}
html.dark .leaflet-popup-content-wrapper, html.dark .leaflet-popup-tip,
html[data-theme="dark"] .leaflet-popup-content-wrapper, html[data-theme="dark"] .leaflet-popup-tip {
  background: #13221d !important; color: #e6ede9 !important; border: 1px solid #1c3028 !important; box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}
html.dark .leaflet-control-zoom a,
html[data-theme="dark"] .leaflet-control-zoom a {
  background: #13221d !important; color: #e6ede9 !important; border-color: #1c3028 !important;
}
html.dark .leaflet-control-zoom a:hover,
html[data-theme="dark"] .leaflet-control-zoom a:hover {
  background: #182c23 !important; color: #34d399 !important;
}
html.dark .mining-graph-section, html.dark .mining-panel, html.dark .mining-cases-panel,
html[data-theme="dark"] .mining-graph-section, html[data-theme="dark"] .mining-panel, html[data-theme="dark"] .mining-cases-panel {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .mining-node-card,
html[data-theme="dark"] .mining-node-card {
  background: #13221d !important; border-color: #1c3028 !important; box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
}
html.dark .mining-node-card:hover,
html[data-theme="dark"] .mining-node-card:hover {
  border-color: #10b981 !important; background: #172a23 !important;
}
html.dark .mining-node-card strong,
html[data-theme="dark"] .mining-node-card strong {
  color: #f0fdf4 !important;
}
html.dark .mining-node-card.bottleneck-node,
html[data-theme="dark"] .mining-node-card.bottleneck-node {
  border-color: #f59e0b !important; background: linear-gradient(180deg, #1f1b13 0%, #16241e 100%) !important;
}
html.dark .sop-node-card,
html[data-theme="dark"] .sop-node-card {
  background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
}
html.dark .dual-timeline-card,
html[data-theme="dark"] .dual-timeline-card {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .dual-timeline-header,
html[data-theme="dark"] .dual-timeline-header {
  border-bottom-color: #1c3028 !important;
}
html.dark .dual-timeline-header h3,
html[data-theme="dark"] .dual-timeline-header h3 {
  color: #f0fdf4 !important;
}
html.dark .lane-track,
html[data-theme="dark"] .lane-track {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .timeline-node,
html[data-theme="dark"] .timeline-node {
  background: #162720 !important; border-color: #233e31 !important; color: #e6ede9 !important;
}
html.dark .timeline-node time,
html[data-theme="dark"] .timeline-node time {
  color: #f0fdf4 !important; background: #1f362b !important;
}
html.dark .timeline-node.active,
html[data-theme="dark"] .timeline-node.active {
  border-color: #10b981 !important; background: #1a3328 !important;
}
html.dark .timeline-node.lag,
html[data-theme="dark"] .timeline-node.lag {
  border-color: #f59e0b !important; background: #261f13 !important; color: #fbbf24 !important;
}
html.dark .lane-system-badge.erp,
html[data-theme="dark"] .lane-system-badge.erp {
  background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.35) !important;
}
html.dark .lane-system-badge.wms,
html[data-theme="dark"] .lane-system-badge.wms {
  background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.35) !important;
}
html.dark .ai-control-toolbar-bar,
html.dark .ai-stepper-nav,
html.dark .ai-viewport-card,
html[data-theme="dark"] .ai-control-toolbar-bar,
html[data-theme="dark"] .ai-stepper-nav,
html[data-theme="dark"] .ai-viewport-card {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .pill-group,
html[data-theme="dark"] .pill-group {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .pill-btn,
html[data-theme="dark"] .pill-btn {
  color: #8da498 !important;
}
html.dark .pill-btn:hover,
html[data-theme="dark"] .pill-btn:hover {
  color: #f0fdf4 !important;
}
html.dark .pill-btn.active,
html[data-theme="dark"] .pill-btn.active {
  background: #1a3328 !important; color: #34d399 !important; border: 1px solid rgba(52, 211, 153, 0.4) !important;
}
html.dark .ai-step-btn:hover,
html[data-theme="dark"] .ai-step-btn:hover {
  background: #162720 !important;
}
html.dark .ai-step-btn .step-num,
html[data-theme="dark"] .ai-step-btn .step-num {
  background: #1e293b !important; color: #94a3b8 !important;
}
html.dark .ai-step-btn.active .step-num,
html[data-theme="dark"] .ai-step-btn.active .step-num {
  background: #1a3328 !important; color: #34d399 !important;
}
html.dark .ai-step-btn .step-meta strong,
html[data-theme="dark"] .ai-step-btn .step-meta strong {
  color: #e2e8f0 !important;
}
html.dark .ai-step-btn .step-meta small,
html[data-theme="dark"] .ai-step-btn .step-meta small {
  color: #94a3b8 !important;
}
html.dark .ai-step-btn.active .step-meta strong,
html[data-theme="dark"] .ai-step-btn.active .step-meta strong {
  color: #34d399 !important;
}
html.dark .ai-step-btn.active .step-meta small,
html[data-theme="dark"] .ai-step-btn.active .step-meta small {
  color: #6ee7b7 !important;
}
html.dark .step-connector,
html[data-theme="dark"] .step-connector {
  background: #1e293b !important;
}
html.dark .phase-badge-header h3,
html[data-theme="dark"] .phase-badge-header h3 {
  color: #f0fdf4 !important;
}
html.dark .phase-subtext,
html[data-theme="dark"] .phase-subtext {
  color: #94a9a0 !important;
}
html.dark .focus-article-bar,
html[data-theme="dark"] .focus-article-bar {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .focus-article-bar .fa-icon,
html[data-theme="dark"] .focus-article-bar .fa-icon {
  background: #182c23 !important; color: #34d399 !important;
}
html.dark .focus-article-bar .fa-name,
html[data-theme="dark"] .focus-article-bar .fa-name {
  color: #f0fdf4 !important;
}
html.dark .focus-article-bar .fa-sku,
html[data-theme="dark"] .focus-article-bar .fa-sku {
  color: #8da498 !important;
}
html.dark .node-card-alert,
html[data-theme="dark"] .node-card-alert {
  background: rgba(239, 68, 68, 0.12) !important; border-color: rgba(239, 68, 68, 0.35) !important;
}
html.dark .node-card-excess,
html[data-theme="dark"] .node-card-excess {
  background: rgba(34, 197, 94, 0.12) !important; border-color: rgba(34, 197, 94, 0.35) !important;
}
html.dark .node-card-normal,
html[data-theme="dark"] .node-card-normal {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .nsc-name,
html[data-theme="dark"] .nsc-name {
  color: #f0fdf4 !important;
}
html.dark .num-normal,
html[data-theme="dark"] .num-normal {
  color: #f0fdf4 !important;
}
html.dark .nsc-thresholds,
html[data-theme="dark"] .nsc-thresholds {
  color: #8da498 !important;
}
html.dark .nsc-progress-bar,
html[data-theme="dark"] .nsc-progress-bar {
  background: #182b23 !important;
}
html.dark .confidence-header-card,
html[data-theme="dark"] .confidence-header-card {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .ch-title,
html[data-theme="dark"] .ch-title {
  color: #f0fdf4 !important;
}
html.dark .decision-table th.highlight-column, html.dark .decision-table td.highlight-column,
html[data-theme="dark"] .decision-table th.highlight-column, html[data-theme="dark"] .decision-table td.highlight-column {
  background: rgba(16, 185, 129, 0.12) !important; border-left-color: rgba(16, 185, 129, 0.35) !important; border-right-color: rgba(16, 185, 129, 0.35) !important;
}
html.dark .action-order-card,
html[data-theme="dark"] .action-order-card {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .action-order-card.card-executed,
html[data-theme="dark"] .action-order-card.card-executed {
  background: #142820 !important; border-color: #10b981 !important;
}
html.dark .subnav-btn,
html[data-theme="dark"] .subnav-btn {
  background: #13221d !important; border-color: #1c3028 !important; color: #8da498 !important;
}
html.dark .subnav-btn:hover,
html[data-theme="dark"] .subnav-btn:hover {
  background: #182c23 !important; color: #f0fdf4 !important;
}
html.dark .subnav-btn.active,
html[data-theme="dark"] .subnav-btn.active {
  background: #059669 !important; border-color: #059669 !important; color: #ffffff !important;
}
html.dark .point-in-time-panel,
html[data-theme="dark"] .point-in-time-panel {
  background: #0f1c17 !important; border-color: rgba(16, 185, 129, 0.25) !important;
}
html.dark .pit-article-info,
html[data-theme="dark"] .pit-article-info {
  background: #13221d !important; border-color: #1c3028 !important;
}
html.dark .pit-article-header strong,
html[data-theme="dark"] .pit-article-header strong {
  color: #34d399 !important;
}
html.dark .pit-article-header span,
html[data-theme="dark"] .pit-article-header span {
  color: #f0fdf4 !important;
}
html.dark .login-screen-wrap,
html[data-theme="dark"] .login-screen-wrap {
  background: radial-gradient(circle at 50% 18%, #0f271e 0%, #0a1410 55%, #050b08 100%) !important;
}
html.dark .login-card,
html[data-theme="dark"] .login-card {
  background: #0f1c17 !important; border-color: #1c3028 !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(52, 211, 153, 0.15) !important;
}
html.dark .login-title,
html[data-theme="dark"] .login-title {
  color: #f0fdf4 !important;
}
html.dark .login-desc,
html[data-theme="dark"] .login-desc {
  color: #8da498 !important;
}
html.dark .login-field-group label,
html[data-theme="dark"] .login-field-group label {
  color: #cbdcd4 !important;
}
html.dark .login-field-group input,
html[data-theme="dark"] .login-field-group input {
  background: #13221d !important; border-color: #1c3028 !important; color: #f0fdf4 !important;
}
html.dark .login-footer-security,
html[data-theme="dark"] .login-footer-security {
  color: #6e857b !important;
}
html.dark .login-legal-links a,
html[data-theme="dark"] .login-legal-links a {
  color: #6e857b !important;
}
html.dark .login-legal-links a:hover,
html[data-theme="dark"] .login-legal-links a:hover {
  color: #34d399 !important;
}
html.dark .system-card,
html[data-theme="dark"] .system-card {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .system-card dd,
html[data-theme="dark"] .system-card dd {
  color: #f0fdf4 !important;
}
html.dark .system-card dt,
html[data-theme="dark"] .system-card dt {
  color: #8da498 !important;
}
html.dark .system-card footer,
html[data-theme="dark"] .system-card footer {
  border-top-color: #1c3028 !important; color: #8da498 !important;
}
html.dark .analysis-content,
html[data-theme="dark"] .analysis-content {
  background: #0f1c17 !important; border-color: #1c3028 !important;
}
html.dark .analysis-explanation,
html[data-theme="dark"] .analysis-explanation {
  background: #13221d !important; border-left-color: #10b981 !important;
}
html.dark .analysis-explanation p,
html[data-theme="dark"] .analysis-explanation p {
  color: #cbdcd4 !important;
}
html.dark .analysis-case-header .mono,
html[data-theme="dark"] .analysis-case-header .mono {
  color: #8da498 !important;
}
html.dark #toast,
html[data-theme="dark"] #toast {
  background: #13221d !important; border-color: #10b981 !important; color: #f0fdf4 !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .sidebar {
    background: #0d1714 !important; border-right-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .brand-true {
    color: #f8fafc !important;
  }
  html:not([data-theme="light"]) .brand-stock {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .brand:hover .brand-stock {
    color: #6ee7b7 !important;
  }
  html:not([data-theme="light"]) .brand-tld, html:not([data-theme="light"]) .brand-dot {
    color: #10b981 !important;
  }
  html:not([data-theme="light"]) .workspace-switch {
    background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .workspace-switch:hover {
    background: #172a23 !important; border-color: #2b453a !important;
  }
  html:not([data-theme="light"]) .workspace-switch strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .workspace-switch small {
    color: #94a9a0 !important;
  }
  html:not([data-theme="light"]) .workspace-switch > svg {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .company-avatar {
    background: #183025 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .nav-caption {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .nav-item {
    color: #9bb0a5 !important;
  }
  html:not([data-theme="light"]) .nav-item > svg {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .nav-item:hover {
    background: #162821 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .nav-item:hover > svg {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .nav-item.active {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .nav-item.active > svg {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .nav-item.active::before {
    background: #10b981 !important;
  }
  html:not([data-theme="light"]) .nav-tag {
    background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important;
  }
  html:not([data-theme="light"]) .nav-count {
    background: rgba(16, 185, 129, 0.22) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .nav-separator {
    background: #1c3028 !important;
  }
  html:not([data-theme="light"]) .database-status {
    color: #819b8f !important;
  }
  html:not([data-theme="light"]) .database-status .status-dot {
    background: #10b981 !important;
  }
  html:not([data-theme="light"]) .sidebar-version-badge {
    border-top-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .sidebar-version-badge .version-label {
    background: #13221d !important; border-color: #1c3028 !important; color: #819b8f !important;
  }
  html:not([data-theme="light"]) .sidebar-legal-links {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .sidebar-legal-links a {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .sidebar-legal-links a:hover {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .sidebar-logout-btn {
    background: transparent !important; color: #819b8f !important;
  }
  html:not([data-theme="light"]) .sidebar-logout-btn:hover {
    background: #162821 !important; color: #f87171 !important;
  }
  html:not([data-theme="light"]) .topbar {
    background: #0d1714 !important; border-bottom-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .breadcrumb span {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .breadcrumb strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .breadcrumb svg {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .global-search {
    background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .global-search:hover {
    background: #172a23 !important; border-color: #2b453a !important;
  }
  html:not([data-theme="light"]) .global-search svg {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) #language {
    background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) #language option {
    background: #13221d !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .copilot-toggle {
    background: rgba(59, 130, 246, 0.16) !important; border-color: rgba(59, 130, 246, 0.35) !important; color: #93c5fd !important;
  }
  html:not([data-theme="light"]) .copilot-toggle.selected {
    background: rgba(59, 130, 246, 0.25) !important; border-color: #60a5fa !important; color: #bfdbfe !important;
  }
  html:not([data-theme="light"]) .app-footer {
    background: #0d1714 !important; border-top-color: #1c3028 !important; color: #819b8f !important;
  }
  html:not([data-theme="light"]) .app-footer a {
    color: #819b8f !important;
  }
  html:not([data-theme="light"]) .app-footer a:hover {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mobile-bottom-nav {
    background: #0d1714 !important; border-top-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .mobile-nav-item {
    color: #819b8f !important;
  }
  html:not([data-theme="light"]) .mobile-nav-item:hover {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mobile-nav-item.active {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mobile-nav-item.active svg {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mobile-nav-pill-demo {
    background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important;
  }
  html:not([data-theme="light"]) .mobile-nav-badge {
    background: #10b981 !important; color: #ffffff !important;
  }
  html:not([data-theme="light"]) .page-heading {
    background: #0f1c17 !important; border-color: #1c3028 !important; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
  }
  html:not([data-theme="light"]) .page-heading h1 {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .page-heading .eyebrow {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .page-heading .eyebrow::before {
    background: #10b981 !important;
  }
  html:not([data-theme="light"]) .page-purpose {
    background: linear-gradient(110deg, #12211a, #152720) !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .page-purpose::before {
    background: #10b981 !important;
  }
  html:not([data-theme="light"]) .purpose-text {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .page-purpose--dark {
    background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(52, 211, 153, 0.2) !important;
  }
  html:not([data-theme="light"]) .comparison-mode-nav {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .comp-mode-btn {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .comp-mode-btn:hover {
    background: #182c23 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .comp-mode-btn.active {
    background: #1c332a !important; color: #34d399 !important; border-color: #2c4f40 !important; box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
  }
  html:not([data-theme="light"]) .metrics-band {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .metric + .metric {
    border-left-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .metric-label {
    color: #94a9a0 !important;
  }
  html:not([data-theme="light"]) .metric-value {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .metric-note {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .metric-icon {
    background: rgba(59, 130, 246, 0.16) !important; color: #60a5fa !important;
  }
  html:not([data-theme="light"]) .metric-icon.green {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .metric-icon.amber {
    background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important;
  }
  html:not([data-theme="light"]) .metric-icon.muted {
    background: #1e293b !important; color: #94a3b8 !important;
  }
  html:not([data-theme="light"]) .table-section {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .section-heading h2 {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .section-heading h2 > svg {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .section-count {
    background: #162720 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .section-symbol {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .section-meta {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .comparison-context {
    border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .context-system strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .context-system small {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .system-avatar {
    background: #182e24 !important; border-color: #274b3a !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .system-1 {
    background: rgba(59, 130, 246, 0.15) !important; border-color: rgba(59, 130, 246, 0.35) !important; color: #93c5fd !important;
  }
  html:not([data-theme="light"]) .system-2 {
    background: rgba(168, 85, 247, 0.15) !important; border-color: rgba(168, 85, 247, 0.35) !important; color: #d8b4fe !important;
  }
  html:not([data-theme="light"]) .table-toolbar {
    border-bottom-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .data-table th {
    background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .data-table td {
    background: #0f1c17 !important; border-color: #1c3028 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .data-table tbody tr:hover td {
    background: #152720 !important;
  }
  html:not([data-theme="light"]) .data-table tbody tr.different td:first-child {
    border-left-color: #f59e0b !important;
  }
  html:not([data-theme="light"]) .comparison-table td:first-child, html:not([data-theme="light"]) .comparison-table th:first-child {
    box-shadow: 1px 0 0 #1c3028 !important; background: #0f1c17 !important;
  }
  html:not([data-theme="light"]) .comparison-table th:first-child {
    background: #13221d !important;
  }
  html:not([data-theme="light"]) .search-field {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .search-field input {
    color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .search-field svg {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .filter-tab {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .filter-tab:hover {
    background: #162821 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .filter-tab.active {
    background: #1a3328 !important; color: #34d399 !important; border-color: #274d3d !important;
  }
  html:not([data-theme="light"]) .filter-tab span {
    background: #14231e !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .filter-tab.active span {
    background: rgba(52, 211, 153, 0.22) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .table-footer {
    border-top-color: #1c3028 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .table-footer .icon-button {
    background: #13221d !important; border-color: #1c3028 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .table-footer .icon-button:hover {
    background: #182c23 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .table-scroll {
    scrollbar-color: #27483a #0f1c17 !important;
  }
  html:not([data-theme="light"]) input, html:not([data-theme="light"]) select, html:not([data-theme="light"]) textarea {
    background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important; color-scheme: dark !important;
  }
  html:not([data-theme="light"]) input:focus, html:not([data-theme="light"]) select:focus, html:not([data-theme="light"]) textarea:focus {
    border-color: #10b981 !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important; background: #162720 !important;
  }
  html:not([data-theme="light"]) ::placeholder {
    color: #5b7368 !important;
  }
  html:not([data-theme="light"]) .button {
    background: #14241e !important; border-color: #233b30 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .button:hover {
    background: #1c332a !important; border-color: #355748 !important; color: #ffffff !important;
  }
  html:not([data-theme="light"]) .button.primary {
    background: #059669 !important; border-color: #059669 !important; color: #ffffff !important;
  }
  html:not([data-theme="light"]) .button.primary:hover {
    background: #047857 !important; border-color: #047857 !important;
  }
  html:not([data-theme="light"]) .button.selected {
    background: rgba(16, 185, 129, 0.18) !important; border-color: #10b981 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .icon-button {
    color: #8fa59b !important;
  }
  html:not([data-theme="light"]) .icon-button:hover {
    background: #172a23 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .help-trigger {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .help-trigger:hover, html:not([data-theme="light"]) .help-trigger:focus {
    background: #182b23 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .text-button {
    color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .text-link {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .badge {
    background: #152720 !important; color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .badge.different, html:not([data-theme="light"]) .badge.amber, html:not([data-theme="light"]) .badge.conditional, html:not([data-theme="light"]) .badge.incomplete, html:not([data-theme="light"]) .badge.timing_lag {
    background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.3) !important;
  }
  html:not([data-theme="light"]) .badge.equal, html:not([data-theme="light"]) .badge.complete, html:not([data-theme="light"]) .badge.allowed {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important;
  }
  html:not([data-theme="light"]) .badge.missing, html:not([data-theme="light"]) .badge.missing_counterpart, html:not([data-theme="light"]) .badge.incomparable, html:not([data-theme="light"]) .badge.unknown, html:not([data-theme="light"]) .badge.preview, html:not([data-theme="light"]) .badge.duplicate {
    background: rgba(148, 163, 184, 0.14) !important; color: #94a3b8 !important; border: 1px solid rgba(148, 163, 184, 0.25) !important;
  }
  html:not([data-theme="light"]) .badge.invalid, html:not([data-theme="light"]) .badge.prohibited {
    background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important;
  }
  html:not([data-theme="light"]) .badge.value {
    background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important; border: 1px solid rgba(59, 130, 246, 0.3) !important;
  }
  html:not([data-theme="light"]) .badge.demo {
    background: rgba(168, 85, 247, 0.16) !important; color: #c084fc !important; border: 1px solid rgba(168, 85, 247, 0.3) !important;
  }
  html:not([data-theme="light"]) .mode-badge.green {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mode-badge.amber {
    background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important;
  }
  html:not([data-theme="light"]) .copilot-panel {
    background: #0d1714 !important; border-left-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .copilot-header {
    border-bottom-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .copilot-header strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .copilot-header small {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .copilot-symbol {
    background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important;
  }
  html:not([data-theme="light"]) .copilot-context {
    background: #13221d !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .assistant-message {
    color: #d1e2da !important;
  }
  html:not([data-theme="light"]) .user-message {
    background: #172a38 !important; color: #bae6fd !important;
  }
  html:not([data-theme="light"]) .action-draft {
    background: #13221d !important; border-color: #223f33 !important;
  }
  html:not([data-theme="light"]) .action-draft strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .action-draft .eyebrow {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .copilot-suggestions button {
    background: #13221d !important; border-color: #1c3028 !important; color: #94a9a0 !important;
  }
  html:not([data-theme="light"]) .copilot-suggestions button:hover {
    background: #182b24 !important; color: #f0fdf4 !important; border-color: #2b453a !important;
  }
  html:not([data-theme="light"]) #copilot-form {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) #copilot-form:focus-within {
    border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
  }
  html:not([data-theme="light"]) #copilot-form textarea {
    color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .copilot-disclosure {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) dialog {
    background: #0f1c17 !important; border-color: #1c3028 !important; color: #e6ede9 !important; box-shadow: 0 24px 85px rgba(0, 0, 0, 0.65) !important;
  }
  html:not([data-theme="light"]) dialog::backdrop {
    background: rgba(0, 0, 0, 0.75) !important;
  }
  html:not([data-theme="light"]) .dialog-header {
    background: #0f1c17 !important; border-bottom-color: #1c3028 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .dialog-footer {
    background: #0a1410 !important; border-top-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .field > span, html:not([data-theme="light"]) .field-caption {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .form-section-title {
    color: #f0fdf4 !important; border-top-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .form-note {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .upload-zone {
    background: #13221d !important; border-color: #274b3a !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .upload-zone > span {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .package-row {
    border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .package-row legend {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .remove-package {
    background: #0f1c17 !important;
  }
  html:not([data-theme="light"]) .donut-total-text {
    fill: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .donut-unit-text {
    fill: #8da498 !important;
  }
  html:not([data-theme="light"]) .gauge-val-text {
    fill: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .gauge-title {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .gauge-status-badge.optimal {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.35) !important;
  }
  html:not([data-theme="light"]) .gauge-status-badge.elevated {
    background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.35) !important;
  }
  html:not([data-theme="light"]) .gauge-status-badge.critical {
    background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.35) !important;
  }
  html:not([data-theme="light"]) .int-kpi {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .int-kpi small {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .int-kpi strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .hbar-label {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .hbar-val strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .hbar-track {
    background: #182b23 !important;
  }
  html:not([data-theme="light"]) .depot-summary-note {
    border-top-color: #1c3028 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .delta-bar-track {
    background: #182b23 !important;
  }
  html:not([data-theme="light"]) .market-modes {
    background: #13221d !important;
  }
  html:not([data-theme="light"]) .market-mode-btn {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .market-mode-btn:hover {
    color: #e6ede9 !important; background: #182c23 !important;
  }
  html:not([data-theme="light"]) .market-mode-btn.active {
    background: #1c332a !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .market-search-box {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .market-search-box svg {
    color: #728980 !important;
  }
  html:not([data-theme="light"]) .market-search-input {
    color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .sku-chip {
    background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .sku-chip:hover {
    background: #182c23 !important; border-color: #10b981 !important;
  }
  html:not([data-theme="light"]) .sku-chip.active {
    background: #059669 !important; color: #ffffff !important; border-color: #059669 !important;
  }
  html:not([data-theme="light"]) .market-map-card {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .market-map-header {
    background: #13221d !important; border-bottom-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .market-map-header h3 {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .legend-chip {
    background: #13221d !important; border-color: #1c3028 !important; color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .legend-chip:hover {
    background: #182c23 !important; border-color: #10b981 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .legend-chip.active {
    background: rgba(16, 185, 129, 0.18) !important; border-color: #10b981 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .legend-count {
    background: #182b23 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .leaflet-tile {
    filter: brightness(0.65) invert(1) contrast(1.7) hue-rotate(185deg) saturate(0.5) !important;
  }
  html:not([data-theme="light"]) .leaflet-container {
    background: #0b1411 !important;
  }
  html:not([data-theme="light"]) .leaflet-popup-content-wrapper, html:not([data-theme="light"]) .leaflet-popup-tip {
    background: #13221d !important; color: #e6ede9 !important; border: 1px solid #1c3028 !important; box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  }
  html:not([data-theme="light"]) .leaflet-control-zoom a {
    background: #13221d !important; color: #e6ede9 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .leaflet-control-zoom a:hover {
    background: #182c23 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .mining-graph-section, html:not([data-theme="light"]) .mining-panel, html:not([data-theme="light"]) .mining-cases-panel {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .mining-node-card {
    background: #13221d !important; border-color: #1c3028 !important; box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
  }
  html:not([data-theme="light"]) .mining-node-card:hover {
    border-color: #10b981 !important; background: #172a23 !important;
  }
  html:not([data-theme="light"]) .mining-node-card strong {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .mining-node-card.bottleneck-node {
    border-color: #f59e0b !important; background: linear-gradient(180deg, #1f1b13 0%, #16241e 100%) !important;
  }
  html:not([data-theme="light"]) .sop-node-card {
    background: #13221d !important; border-color: #1c3028 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .dual-timeline-card {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .dual-timeline-header {
    border-bottom-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .dual-timeline-header h3 {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .lane-track {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .timeline-node {
    background: #162720 !important; border-color: #233e31 !important; color: #e6ede9 !important;
  }
  html:not([data-theme="light"]) .timeline-node time {
    color: #f0fdf4 !important; background: #1f362b !important;
  }
  html:not([data-theme="light"]) .timeline-node.active {
    border-color: #10b981 !important; background: #1a3328 !important;
  }
  html:not([data-theme="light"]) .timeline-node.lag {
    border-color: #f59e0b !important; background: #261f13 !important; color: #fbbf24 !important;
  }
  html:not([data-theme="light"]) .lane-system-badge.erp {
    background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.35) !important;
  }
  html:not([data-theme="light"]) .lane-system-badge.wms {
    background: rgba(59, 130, 246, 0.16) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.35) !important;
  }
  html:not([data-theme="light"]) .ai-control-toolbar-bar,
  html:not([data-theme="light"]) .ai-stepper-nav,
  html:not([data-theme="light"]) .ai-viewport-card {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .pill-group {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .pill-btn {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .pill-btn:hover {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .pill-btn.active {
    background: #1a3328 !important; color: #34d399 !important; border: 1px solid rgba(52, 211, 153, 0.4) !important;
  }
  html:not([data-theme="light"]) .ai-step-btn:hover {
    background: #162720 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn .step-num {
    background: #1e293b !important; color: #94a3b8 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn.active .step-num {
    background: #1a3328 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn .step-meta strong {
    color: #e2e8f0 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn .step-meta small {
    color: #94a3b8 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn.active .step-meta strong {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .ai-step-btn.active .step-meta small {
    color: #6ee7b7 !important;
  }
  html:not([data-theme="light"]) .step-connector {
    background: #1e293b !important;
  }
  html:not([data-theme="light"]) .phase-badge-header h3 {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .phase-subtext {
    color: #94a9a0 !important;
  }
  html:not([data-theme="light"]) .focus-article-bar {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .focus-article-bar .fa-icon {
    background: #182c23 !important; color: #34d399 !important;
  }
  html:not([data-theme="light"]) .focus-article-bar .fa-name {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .focus-article-bar .fa-sku {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .node-card-alert {
    background: rgba(239, 68, 68, 0.12) !important; border-color: rgba(239, 68, 68, 0.35) !important;
  }
  html:not([data-theme="light"]) .node-card-excess {
    background: rgba(34, 197, 94, 0.12) !important; border-color: rgba(34, 197, 94, 0.35) !important;
  }
  html:not([data-theme="light"]) .node-card-normal {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .nsc-name {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .num-normal {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .nsc-thresholds {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .nsc-progress-bar {
    background: #182b23 !important;
  }
  html:not([data-theme="light"]) .confidence-header-card {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .ch-title {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .decision-table th.highlight-column, html:not([data-theme="light"]) .decision-table td.highlight-column {
    background: rgba(16, 185, 129, 0.12) !important; border-left-color: rgba(16, 185, 129, 0.35) !important; border-right-color: rgba(16, 185, 129, 0.35) !important;
  }
  html:not([data-theme="light"]) .action-order-card {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .action-order-card.card-executed {
    background: #142820 !important; border-color: #10b981 !important;
  }
  html:not([data-theme="light"]) .subnav-btn {
    background: #13221d !important; border-color: #1c3028 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .subnav-btn:hover {
    background: #182c23 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .subnav-btn.active {
    background: #059669 !important; border-color: #059669 !important; color: #ffffff !important;
  }
  html:not([data-theme="light"]) .point-in-time-panel {
    background: #0f1c17 !important; border-color: rgba(16, 185, 129, 0.25) !important;
  }
  html:not([data-theme="light"]) .pit-article-info {
    background: #13221d !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .pit-article-header strong {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .pit-article-header span {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .login-screen-wrap {
    background: radial-gradient(circle at 50% 18%, #0f271e 0%, #0a1410 55%, #050b08 100%) !important;
  }
  html:not([data-theme="light"]) .login-card {
    background: #0f1c17 !important; border-color: #1c3028 !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(52, 211, 153, 0.15) !important;
  }
  html:not([data-theme="light"]) .login-title {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .login-desc {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .login-field-group label {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .login-field-group input {
    background: #13221d !important; border-color: #1c3028 !important; color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .login-footer-security {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .login-legal-links a {
    color: #6e857b !important;
  }
  html:not([data-theme="light"]) .login-legal-links a:hover {
    color: #34d399 !important;
  }
  html:not([data-theme="light"]) .system-card {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .system-card dd {
    color: #f0fdf4 !important;
  }
  html:not([data-theme="light"]) .system-card dt {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) .system-card footer {
    border-top-color: #1c3028 !important; color: #8da498 !important;
  }
  html:not([data-theme="light"]) .analysis-content {
    background: #0f1c17 !important; border-color: #1c3028 !important;
  }
  html:not([data-theme="light"]) .analysis-explanation {
    background: #13221d !important; border-left-color: #10b981 !important;
  }
  html:not([data-theme="light"]) .analysis-explanation p {
    color: #cbdcd4 !important;
  }
  html:not([data-theme="light"]) .analysis-case-header .mono {
    color: #8da498 !important;
  }
  html:not([data-theme="light"]) #toast {
    background: #13221d !important; border-color: #10b981 !important; color: #f0fdf4 !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  }
}

/* ==========================================================================
   Audit Protocol Modal & Print Styles (Enterprise & Revisionssicherheit)
   ========================================================================== */

.printable-audit-protocol {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text-color, #1f2937);
}

.audit-doc-header {
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  padding-bottom: 1rem;
}

.adh-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.adh-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.adh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.adh-badge.optimal {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.adh-badge.action-required {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.adh-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0.5rem 0 1rem 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.adh-title-row h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.adh-doc-id {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

.adh-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  font-size: 0.825rem;
}

.adh-meta-grid div {
  display: flex;
  flex-direction: column;
}

.adh-meta-grid small {
  color: var(--muted-color, #6b7280);
  font-size: 0.725rem;
  text-transform: uppercase;
}

.audit-summary-section {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 1rem;
}

.ass-title, .afs-title, .aso-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ass-title h3, .afs-title h3, .aso-title h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ass-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ass-kpi-box {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.ass-kpi-box small {
  font-size: 0.725rem;
  color: var(--muted-color, #6b7280);
}

.ass-kpi-box strong {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.ass-kpi-box span {
  font-size: 0.7rem;
  color: var(--muted-color, #6b7280);
}

.ass-kpi-box.success strong {
  color: #059669;
}

.ass-kpi-box.warning strong {
  color: #d97706;
}

.ass-opinion-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
  border-radius: 0 6px 6px 0;
  font-size: 0.825rem;
}

.ass-opinion-box p {
  margin: 0;
  line-height: 1.45;
}

.audit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
}

.audit-findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}

.audit-findings-table th {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.725rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-color, #6b7280);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.audit-findings-table th.numeric,
.audit-findings-table td.numeric {
  text-align: right;
}

.audit-findings-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  vertical-align: top;
}

.audit-findings-table tbody tr:last-child td {
  border-bottom: none;
}

.cause-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.directive-cell {
  max-width: 280px;
  line-height: 1.4;
  color: var(--text-color, #1f2937);
  font-size: 0.8rem;
}

.audit-signoff-section {
  border-top: 1px dashed var(--border-color, #e5e7eb);
  padding-top: 1rem;
}

.aso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.aso-box {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.02);
}

.aso-role {
  font-size: 0.725rem;
  text-transform: uppercase;
  color: var(--muted-color, #6b7280);
  font-weight: 700;
}

.aso-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0.2rem 0 0.5rem 0;
}

.status-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #059669;
  font-weight: 700;
  font-size: 0.775rem;
}

.sig-placeholder {
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted-color, #6b7280);
}

.aso-date {
  font-size: 0.7rem;
  color: var(--muted-color, #6b7280);
  margin-top: 0.4rem;
}

.audit-action-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  flex-wrap: wrap;
}

/* Sync Assistant Modal */
.sync-assistant-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sam-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  padding-bottom: 0.75rem;
}

.sam-hero .sam-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sam-hero h3 {
  margin: 0;
  font-size: 1.1rem;
}

.sam-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.sam-card {
  padding: 0.85rem 1rem;
  background: #f8faf9;
  border: 1px solid #d5e3dc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.sam-card small {
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.sam-card strong {
  margin: 0.2rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.sam-card strong.text-amber,
.text-amber {
  color: #b45309 !important;
}

.sam-card span {
  font-size: 0.8rem;
  color: #475569;
}

.sam-order-draft {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
  border-radius: 6px;
  padding: 0.85rem;
}

.sod-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.sod-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #10b981;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sod-body p {
  margin: 0 0 0.6rem 0;
  font-size: 0.825rem;
  line-height: 1.45;
}

.sod-meta-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.725rem;
  color: #065f46;
  font-weight: 600;
}

.sod-meta-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sam-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Dark mode adjustments */
html.dark .audit-summary-section,
html[data-theme="dark"] .audit-summary-section,
html.dark .aso-box,
html[data-theme="dark"] .aso-box,
html.dark .sam-card,
html[data-theme="dark"] .sam-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
}

html.dark .sam-card small,
html[data-theme="dark"] .sam-card small {
  color: #94a9a0 !important;
}

html.dark .sam-card strong,
html[data-theme="dark"] .sam-card strong {
  color: #f0fdf4 !important;
}

html.dark .sam-card strong.text-amber,
html[data-theme="dark"] .sam-card strong.text-amber {
  color: #fbbf24 !important;
}

html.dark .sam-card span,
html[data-theme="dark"] .sam-card span {
  color: #cbdcd4 !important;
}

html.dark .ass-kpi-box,
html[data-theme="dark"] .ass-kpi-box {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}

html.dark .audit-findings-table th,
html[data-theme="dark"] .audit-findings-table th {
  background: #13221d !important;
  border-color: #1c3028 !important;
}

html.dark .audit-findings-table td,
html[data-theme="dark"] .audit-findings-table td {
  border-color: #1c3028 !important;
}

/* ==========================================================================
   Comprehensive Dark Mode Surface & Component Normalization
   Eliminates all remaining white/light surfaces in Dark Mode
   ========================================================================== */

/* Base Controls, Inputs & Form Elements */
html.dark input, html.dark select, html.dark textarea,
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
  color-scheme: dark !important;
}
html.dark input:focus, html.dark select:focus, html.dark textarea:focus,
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
  background: #162720 !important;
}
html.dark ::placeholder,
html[data-theme="dark"] ::placeholder {
  color: #5b7368 !important;
}

/* Article Thumbnails */
html.dark .article-thumb,
html[data-theme="dark"] .article-thumb,
html.dark .article-thumb.case, html.dark .article-thumb.thermal,
html.dark .article-thumb.sensor, html.dark .article-thumb.valve,
html.dark .article-thumb.motor, html.dark .article-thumb.module,
html[data-theme="dark"] .article-thumb.case, html[data-theme="dark"] .article-thumb.thermal,
html[data-theme="dark"] .article-thumb.sensor, html[data-theme="dark"] .article-thumb.valve,
html[data-theme="dark"] .article-thumb.motor, html[data-theme="dark"] .article-thumb.module {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #8da498 !important;
}

/* Activity Icons, Outlines & Misc Utilities */
html.dark .activity-icon,
html[data-theme="dark"] .activity-icon {
  background: #162720 !important;
  border-color: #1c3028 !important;
  color: #34d399 !important;
}
html.dark .timeline-dot.outlined,
html[data-theme="dark"] .timeline-dot.outlined {
  background: #0e1a15 !important;
  border-color: #34d399 !important;
}
html.dark .table-scroll,
html[data-theme="dark"] .table-scroll {
  background-color: transparent !important;
}
html.dark .mobile-stock,
html[data-theme="dark"] .mobile-stock {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .mobile-sidebar-close:hover,
html[data-theme="dark"] .mobile-sidebar-close:hover {
  background: #162821 !important;
  color: #f0fdf4 !important;
}

/* Notices, Alerts & Interpretations */
html.dark .notice,
html[data-theme="dark"] .notice {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .notice.warning,
html[data-theme="dark"] .notice.warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}
html.dark .notice.danger, html.dark .form-error,
html[data-theme="dark"] .notice.danger, html[data-theme="dark"] .form-error {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}
html.dark .demo-notice,
html[data-theme="dark"] .demo-notice {
  background: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  color: #e9d5ff !important;
}
html.dark .interpretation.different,
html[data-theme="dark"] .interpretation.different {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}
html.dark .reconciliation-section,
html[data-theme="dark"] .reconciliation-section {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}

/* Process Mining & Interactive Diagram */
html.dark .sop-pipeline-flow,
html[data-theme="dark"] .sop-pipeline-flow {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .interactive-diagram-container,
html[data-theme="dark"] .interactive-diagram-container {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .diagram-toolbar,
html[data-theme="dark"] .diagram-toolbar {
  background: #13221d !important;
  border-bottom-color: #1c3028 !important;
}
html.dark .diagram-toolbar .metric-btn,
html[data-theme="dark"] .diagram-toolbar .metric-btn {
  background: #162821 !important;
  border-color: #1c3028 !important;
  color: #94a9a0 !important;
}
html.dark .diagram-toolbar .metric-btn:hover,
html[data-theme="dark"] .diagram-toolbar .metric-btn:hover {
  background: #1c332a !important;
  color: #f0fdf4 !important;
}
html.dark .diagram-toolbar .metric-btn.active,
html[data-theme="dark"] .diagram-toolbar .metric-btn.active {
  background: #1a3328 !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}
html.dark .diagram-scroll-viewport,
html[data-theme="dark"] .diagram-scroll-viewport {
  background: #09130f !important;
}
html.dark .bottleneck-tag,
html[data-theme="dark"] .bottleneck-tag {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html.dark .deviation-tag,
html[data-theme="dark"] .deviation-tag {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html.dark .diagram-legend,
html[data-theme="dark"] .diagram-legend {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .diagram-legend-item,
html[data-theme="dark"] .diagram-legend-item {
  color: #8da498 !important;
}
html.dark .diagram-legend-item strong,
html[data-theme="dark"] .diagram-legend-item strong {
  color: #f0fdf4 !important;
}
html.dark .deviation-card,
html[data-theme="dark"] .deviation-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .deviation-icon,
html[data-theme="dark"] .deviation-icon {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
}
html.dark .variant-card,
html[data-theme="dark"] .variant-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .variant-card.selected,
html[data-theme="dark"] .variant-card.selected,
html.dark .variant-card.expanded,
html[data-theme="dark"] .variant-card.expanded {
  background: #162a22 !important;
  border-color: #10b981 !important;
}
html.dark .variant-toggle-btn,
html[data-theme="dark"] .variant-toggle-btn {
  background: #182c23 !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .variant-step-pill,
html[data-theme="dark"] .variant-step-pill {
  background: #162821 !important;
  border: 1px solid #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .variant-step-pill.quality_inspection,
html.dark .variant-step-pill.quarantine_block,
html[data-theme="dark"] .variant-step-pill.quality_inspection,
html[data-theme="dark"] .variant-step-pill.quarantine_block {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html.dark .dev-note,
html[data-theme="dark"] .dev-note {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #fde68a !important;
}
html.dark .variant-drawer-inner,
html[data-theme="dark"] .variant-drawer-inner {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .variant-cases-table-wrap,
html[data-theme="dark"] .variant-cases-table-wrap {
  background: #13221d !important;
  border-color: #1c3028 !important;
}
html.dark .variant-cases-table th,
html[data-theme="dark"] .variant-cases-table th {
  background: #162821 !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .variant-case-row:hover,
html[data-theme="dark"] .variant-case-row:hover {
  background: #1a3328 !important;
}
html.dark .highlighted-col,
html[data-theme="dark"] .highlighted-col {
  background: rgba(16, 185, 129, 0.12) !important;
}
html.dark .mining-lead-time-card,
html[data-theme="dark"] .mining-lead-time-card {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}

/* Executive Cockpit, Readiness & Market Map */
html.dark .executive-cockpit-section,
html[data-theme="dark"] .executive-cockpit-section {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .executive-cockpit-grid,
html[data-theme="dark"] .executive-cockpit-grid {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .readiness-card,
html[data-theme="dark"] .readiness-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .readiness-card-top small,
html[data-theme="dark"] .readiness-card-top small {
  color: #8da498 !important;
}
html.dark .action-box,
html[data-theme="dark"] .action-box {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .lag-callout,
html[data-theme="dark"] .lag-callout {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #fde68a !important;
}
html.dark .st-card,
html[data-theme="dark"] .st-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .st-total,
html[data-theme="dark"] .st-total {
  background: #182e24 !important;
  border-color: #274b3a !important;
}
html.dark .pit-network-summary,
html[data-theme="dark"] .pit-network-summary {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .discrepancy-drilldown-section,
html[data-theme="dark"] .discrepancy-drilldown-section {
  background: #0f1c17 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html.dark .section-symbol-amber,
html[data-theme="dark"] .section-symbol-amber {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}
html.dark .drilldown-card,
html[data-theme="dark"] .drilldown-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .drilldown-card:hover,
html[data-theme="dark"] .drilldown-card:hover {
  background: #182c23 !important;
  border-color: #f59e0b !important;
}
html.dark .comparison-evidence-box,
html[data-theme="dark"] .comparison-evidence-box {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fef3c7 !important;
}
html.dark .comparison-evidence-box h4,
html[data-theme="dark"] .comparison-evidence-box h4 {
  color: #fbbf24 !important;
}
html.dark .legend-chip.clear-filter,
html[data-theme="dark"] .legend-chip.clear-filter {
  background: #182c23 !important;
  border-color: #1c3028 !important;
  color: #8da498 !important;
}
html.dark .leaflet-tooltip.osm-custom-tooltip,
html[data-theme="dark"] .leaflet-tooltip.osm-custom-tooltip {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6) !important;
}
html.dark .osm-tooltip-table th,
html[data-theme="dark"] .osm-tooltip-table th {
  color: #8da498 !important;
}
html.dark .osm-tooltip-table td,
html[data-theme="dark"] .osm-tooltip-table td {
  color: #f0fdf4 !important;
}

/* Ledger, Movements & Problem Deep-Linking */
html.dark .ledger-table-header,
html[data-theme="dark"] .ledger-table-header {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .ledger-row:hover,
html[data-theme="dark"] .ledger-row:hover {
  background: #152720 !important;
}
html.dark .flow-pill,
html[data-theme="dark"] .flow-pill {
  background: #162821 !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .movement-sort-btn,
html[data-theme="dark"] .movement-sort-btn {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #8da498 !important;
}
html.dark .movement-sort-btn:hover,
html[data-theme="dark"] .movement-sort-btn:hover {
  background: #182c23 !important;
  color: #f0fdf4 !important;
}
html.dark .delta-neg,
html[data-theme="dark"] .delta-neg {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
}
html.dark .delta-neutral,
html[data-theme="dark"] .delta-neutral {
  background: #1e293b !important;
  color: #94a3b8 !important;
}
html.dark .problem-btn,
html[data-theme="dark"] .problem-btn {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
}
html.dark .problem-btn:hover,
html[data-theme="dark"] .problem-btn:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  color: #fef08a !important;
  border-color: #f59e0b !important;
}
html.dark .problem-focus-banner,
html[data-theme="dark"] .problem-focus-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.18) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  border-left: 5px solid #f59e0b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
html.dark .pfb-title strong,
html[data-theme="dark"] .pfb-title strong {
  color: #f0fdf4 !important;
}
html.dark .pfb-title span,
html[data-theme="dark"] .pfb-title span {
  color: #cbdcd4 !important;
}
html.dark .pfb-clear-btn,
html[data-theme="dark"] .pfb-clear-btn {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
}
html.dark .pfb-clear-btn:hover,
html[data-theme="dark"] .pfb-clear-btn:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  color: #fef08a !important;
}

/* AI Control Center, Layman Box & Autonomy */
html.dark .ai-tag,
html[data-theme="dark"] .ai-tag {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
html.dark .ai-kpi-card,
html[data-theme="dark"] .ai-kpi-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .anomaly-card.danger-glow,
html[data-theme="dark"] .anomaly-card.danger-glow {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}
html.dark .anomaly-card.info-glow,
html[data-theme="dark"] .anomaly-card.info-glow {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}
html.dark .ac-icon.danger,
html[data-theme="dark"] .ac-icon.danger {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}
html.dark .danger-pill,
html[data-theme="dark"] .danger-pill {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
html.dark .step-indicator-pill.alert-pill,
html[data-theme="dark"] .step-indicator-pill.alert-pill {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}
html.dark .step-indicator-pill.purple-pill,
html[data-theme="dark"] .step-indicator-pill.purple-pill {
  background: rgba(168, 85, 247, 0.18) !important;
  color: #c084fc !important;
}
html.dark .step-indicator-pill.emerald-pill,
html[data-theme="dark"] .step-indicator-pill.emerald-pill {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
}
html.dark .aoc-specs-grid,
html[data-theme="dark"] .aoc-specs-grid {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .post-execution-preview,
html[data-theme="dark"] .post-execution-preview {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #cbdcd4 !important;
}
html.dark .post-execution-preview h5,
html[data-theme="dark"] .post-execution-preview h5 {
  color: #34d399 !important;
}
html.dark .pep-box,
html[data-theme="dark"] .pep-box {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .prompt-alert.warning,
html[data-theme="dark"] .prompt-alert.warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}
html.dark .prompt-alert.info,
html[data-theme="dark"] .prompt-alert.info {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #93c5fd !important;
}
html.dark .vrp-route-panel,
html[data-theme="dark"] .vrp-route-panel {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
}
html.dark .vrp-node,
html[data-theme="dark"] .vrp-node {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .ai-layman-explanation,
html[data-theme="dark"] .ai-layman-explanation {
  background: #13221d !important;
  border-color: #1c3028 !important;
  border-left-color: #0284c7 !important;
  color: #e6ede9 !important;
}
html.dark .ale-box,
html[data-theme="dark"] .ale-box {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .ale-box.concept,
html[data-theme="dark"] .ale-box.concept {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
html.dark .ale-box.results,
html[data-theme="dark"] .ale-box.results {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}
html.dark .ale-box.value,
html[data-theme="dark"] .ale-box.value {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
}
html.dark .ale-modal-btn,
html[data-theme="dark"] .ale-modal-btn {
  background: rgba(2, 132, 199, 0.18) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #38bdf8 !important;
}
html.dark .ale-modal-btn:hover,
html[data-theme="dark"] .ale-modal-btn:hover {
  background: rgba(2, 132, 199, 0.28) !important;
  color: #7dd3fc !important;
}
html.dark .ame-card,
html[data-theme="dark"] .ame-card {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
}
html.dark .ame-card.concept-card,
html[data-theme="dark"] .ame-card.concept-card {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
html.dark .ame-card.value-card,
html[data-theme="dark"] .ame-card.value-card {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
}
html.dark .roi-pill.amber,
html[data-theme="dark"] .roi-pill.amber {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}
html.dark .roi-pill.rose,
html[data-theme="dark"] .roi-pill.rose {
  background: rgba(244, 63, 94, 0.18) !important;
  color: #fda4af !important;
}
html.dark .login-demo-box,
html[data-theme="dark"] .login-demo-box {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #cbdcd4 !important;
}
html.dark .login-error-msg,
html[data-theme="dark"] .login-error-msg {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}
html.dark .login-pw-toggle:hover,
html[data-theme="dark"] .login-pw-toggle:hover {
  background: #182c23 !important;
  color: #f0fdf4 !important;
}

/* Dialogs, Modals & Tour Widget */
html.dark dialog,
html[data-theme="dark"] dialog {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
  color: #e6ede9 !important;
  box-shadow: 0 24px 85px rgba(0, 0, 0, 0.75) !important;
}
html.dark dialog::backdrop,
html[data-theme="dark"] dialog::backdrop {
  background: rgba(0, 0, 0, 0.75) !important;
}
html.dark .dialog-header,
html[data-theme="dark"] .dialog-header {
  background: #0f1c17 !important;
  border-bottom-color: #1c3028 !important;
  color: #f0fdf4 !important;
}
html.dark .dialog-body,
html[data-theme="dark"] .dialog-body {
  background: #0f1c17 !important;
  color: #e6ede9 !important;
}
html.dark .dialog-footer,
html[data-theme="dark"] .dialog-footer {
  background: #0a1410 !important;
  border-top-color: #1c3028 !important;
}
html.dark #auth-dialog-form,
html[data-theme="dark"] #auth-dialog-form {
  background: #0f1c17 !important;
  color: #e6ede9 !important;
}
html.dark .auth-notice,
html[data-theme="dark"] .auth-notice {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #a7f3d0 !important;
}
html.dark .auth-pw-input,
html[data-theme="dark"] .auth-pw-input {
  background: #13221d !important;
  border-color: #1c3028 !important;
  color: #f0fdf4 !important;
}
html.dark #auth-toggle-vis,
html[data-theme="dark"] #auth-toggle-vis {
  color: #8da498 !important;
}
html.dark #auth-toggle-vis:hover,
html[data-theme="dark"] #auth-toggle-vis:hover {
  color: #34d399 !important;
}
html.dark .printable-audit-protocol,
html[data-theme="dark"] .printable-audit-protocol {
  background: #0f1c17 !important;
  color: #e6ede9 !important;
}
html.dark .pap-header,
html[data-theme="dark"] .pap-header {
  border-bottom-color: #1c3028 !important;
}
html.dark .pap-header h2,
html[data-theme="dark"] .pap-header h2 {
  color: #f0fdf4 !important;
}
html.dark .sam-order-draft,
html[data-theme="dark"] .sam-order-draft {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #cbdcd4 !important;
}
html.dark .sod-meta-tags,
html[data-theme="dark"] .sod-meta-tags {
  color: #34d399 !important;
}
html.dark #investor-tour-widget,
html[data-theme="dark"] #investor-tour-widget {
  background: #0f1c17 !important;
  border-color: #1c3028 !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
  color: #e6ede9 !important;
}
html.dark .tour-widget-header,
html[data-theme="dark"] .tour-widget-header {
  background: #13221d !important;
  border-bottom-color: #1c3028 !important;
}
html.dark .tour-widget-header strong,
html[data-theme="dark"] .tour-widget-header strong {
  color: #f0fdf4 !important;
}
html.dark .tour-close-btn,
html[data-theme="dark"] .tour-close-btn {
  color: #8da498 !important;
}
html.dark .tour-close-btn:hover,
html[data-theme="dark"] .tour-close-btn:hover {
  background: #182c23 !important;
  color: #f0fdf4 !important;
}
html.dark .tour-step-desc,
html[data-theme="dark"] .tour-step-desc {
  color: #cbdcd4 !important;
}
html.dark .tour-widget-footer,
html[data-theme="dark"] .tour-widget-footer {
  background: #0a1410 !important;
  border-top-color: #1c3028 !important;
}

/* ==========================================================================
   High-Contrast Dark Mode Typography & Facts Detail Normalization
   Fixes dark text colors on dark backgrounds in modals, cards and data grids
   ========================================================================== */

/* Dialog & Modal Typography */
html.dark dialog,
html[data-theme="dark"] dialog {
  color: #e6ede9 !important;
}

html.dark dialog h2,
html.dark dialog h3,
html.dark dialog h4,
html[data-theme="dark"] dialog h2,
html[data-theme="dark"] dialog h3,
html[data-theme="dark"] dialog h4 {
  color: #f0fdf4 !important;
}

/* Definition Lists & Facts Grids (Article Modal, Comparison, Snapshots) */
html.dark .facts dt,
html[data-theme="dark"] .facts dt {
  color: #94a9a0 !important;
}

html.dark .facts dd,
html[data-theme="dark"] .facts dd {
  color: #f0fdf4 !important;
}

html.dark .facts dt .help-trigger,
html[data-theme="dark"] .facts dt .help-trigger {
  color: #a7f3d0 !important;
}

html.dark .facts dt .help-trigger:hover,
html[data-theme="dark"] .facts dt .help-trigger:hover {
  background: #182b23 !important;
  color: #34d399 !important;
}

/* Detail Views & Source Detail Grids */
html.dark .detail-identity h2,
html[data-theme="dark"] .detail-identity h2 {
  color: #f0fdf4 !important;
}

html.dark .detail-identity .eyebrow,
html[data-theme="dark"] .detail-identity .eyebrow {
  color: #34d399 !important;
}

html.dark .detail-quantity,
html[data-theme="dark"] .detail-quantity {
  color: #34d399 !important;
}

html.dark .detail-quantity small,
html[data-theme="dark"] .detail-quantity small {
  color: #94a9a0 !important;
}

html.dark .source-detail-grid h3,
html[data-theme="dark"] .source-detail-grid h3 {
  color: #f0fdf4 !important;
}

html.dark .detail-time-zone,
html[data-theme="dark"] .detail-time-zone {
  color: #94a9a0 !important;
}

/* Version Lists & Collapsible Details */
html.dark .version-list details,
html[data-theme="dark"] .version-list details {
  border-bottom-color: #1c3028 !important;
}

html.dark details summary,
html[data-theme="dark"] details summary {
  color: #f0fdf4 !important;
}

html.dark details summary > span:last-of-type,
html[data-theme="dark"] details summary > span:last-of-type {
  color: #94a9a0 !important;
}

html.dark details summary .version-label,
html[data-theme="dark"] details summary .version-label {
  background: #182c23 !important;
  color: #34d399 !important;
  border: 1px solid #1c3028 !important;
}

/* Form Fields, Captions, Notes & Packages in Dialogs */
html.dark .field > span,
html.dark .field-caption,
html.dark .field-caption label,
html[data-theme="dark"] .field > span,
html[data-theme="dark"] .field-caption,
html[data-theme="dark"] .field-caption label {
  color: #cbdcd4 !important;
}

html.dark .form-note,
html[data-theme="dark"] .form-note {
  color: #94a9a0 !important;
}

html.dark .form-section-title,
html[data-theme="dark"] .form-section-title {
  color: #f0fdf4 !important;
  border-top-color: #1c3028 !important;
}

html.dark .package-row,
html[data-theme="dark"] .package-row {
  border-color: #1c3028 !important;
}

html.dark .package-row legend,
html[data-theme="dark"] .package-row legend {
  color: #cbdcd4 !important;
}

html.dark .import-summary strong,
html[data-theme="dark"] .import-summary strong {
  color: #f0fdf4 !important;
}

html.dark .import-summary small,
html[data-theme="dark"] .import-summary small {
  color: #94a9a0 !important;
}

html.dark .validation-error,
html[data-theme="dark"] .validation-error {
  color: #f87171 !important;
}

/* Table Sub-cells, Units and Metadata */
html.dark .cell-sub,
html.dark .cell-unit,
html.dark .stock-article-cell .cell-sub,
html.dark .location-code,
html.dark .stock-type,
html[data-theme="dark"] .cell-sub,
html[data-theme="dark"] .cell-unit,
html[data-theme="dark"] .stock-article-cell .cell-sub,
html[data-theme="dark"] .location-code,
html[data-theme="dark"] .stock-type {
  color: #94a9a0 !important;
}

html.dark .article-bold-name,
html.dark .case-business-title,
html[data-theme="dark"] .article-bold-name,
html[data-theme="dark"] .case-business-title {
  color: #f0fdf4 !important;
}

html.dark .delta.nonzero,
html[data-theme="dark"] .delta.nonzero {
  color: #fbbf24 !important;
}

html.dark .missing-value,
html[data-theme="dark"] .missing-value {
  color: #64748b !important;
}

html.dark .help-trigger,
html[data-theme="dark"] .help-trigger {
  color: #a7f3d0 !important;
}

html.dark .help-trigger:hover,
html.dark .help-trigger:focus,
html[data-theme="dark"] .help-trigger:hover,
html[data-theme="dark"] .help-trigger:focus {
  background: #182b23 !important;
  color: #34d399 !important;
}

html.dark .empty-state,
html[data-theme="dark"] .empty-state {
  color: #8da498 !important;
}

/* Scenario & Cockpit Lists */
html.dark .scenario,
html[data-theme="dark"] .scenario {
  color: #cbdcd4 !important;
}

html.dark .scenario strong,
html[data-theme="dark"] .scenario strong {
  color: #f0fdf4 !important;
}

html.dark .scenario small,
html[data-theme="dark"] .scenario small {
  color: #94a9a0 !important;
}

html.dark .scenario.active,
html[data-theme="dark"] .scenario.active {
  background: #162821 !important;
  color: #34d399 !important;
  border-color: #10b981 !important;
}

html.dark .scenario.active strong,
html[data-theme="dark"] .scenario.active strong {
  color: #34d399 !important;
}

html.dark .scenario-number,
html[data-theme="dark"] .scenario-number {
  color: #94a9a0 !important;
}

html.dark .next-check,
html[data-theme="dark"] .next-check {
  color: #cbdcd4 !important;
}

html.dark .small-label,
html[data-theme="dark"] .small-label {
  color: #94a9a0 !important;
}

/* Legend & Market Values */
html.dark .legend-name,
html.dark .impact-label,
html.dark .section-sub,
html.dark .section-desc,
html.dark .st-label,
html[data-theme="dark"] .legend-name,
html[data-theme="dark"] .impact-label,
html[data-theme="dark"] .section-sub,
html[data-theme="dark"] .section-desc,
html[data-theme="dark"] .st-label {
  color: #94a9a0 !important;
}

html.dark .legend-val,
html.dark .impact-text,
html.dark .st-qty,
html[data-theme="dark"] .legend-val,
html[data-theme="dark"] .impact-text,
html[data-theme="dark"] .st-qty {
  color: #f0fdf4 !important;
}

html.dark .mtb-label,
html[data-theme="dark"] .mtb-label {
  color: #94a9a0 !important;
}

html.dark .mtb-value,
html[data-theme="dark"] .mtb-value {
  color: #f0fdf4 !important;
}

html.dark .mtb-sub,
html.dark .pit-time-sub,
html.dark .pfb-sub,
html[data-theme="dark"] .mtb-sub,
html[data-theme="dark"] .pit-time-sub,
html[data-theme="dark"] .pfb-sub {
  color: #cbdcd4 !important;
}

html.dark .nsc-city,
html.dark .stock-uom,
html.dark .spec-label,
html.dark .ch-sub,
html.dark .vrp-uom,
html.dark .vrp-sub,
html[data-theme="dark"] .nsc-city,
html[data-theme="dark"] .stock-uom,
html[data-theme="dark"] .spec-label,
html[data-theme="dark"] .ch-sub,
html[data-theme="dark"] .vrp-uom,
html[data-theme="dark"] .vrp-sub {
  color: #94a9a0 !important;
}

html.dark .pep-loc,
html[data-theme="dark"] .pep-loc {
  color: #cbdcd4 !important;
}

html.dark .ale-headline,
html.dark .ame-title,
html.dark .ale-box-header,
html[data-theme="dark"] .ale-headline,
html[data-theme="dark"] .ame-title,
html[data-theme="dark"] .ale-box-header {
  color: #f0fdf4 !important;
}

html.dark .ale-text,
html.dark .ale-list,
html[data-theme="dark"] .ale-text,
html[data-theme="dark"] .ale-list {
  color: #cbdcd4 !important;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-audit-protocol, .printable-audit-protocol * {
    visibility: visible;
  }
  dialog#dialog {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
  }
  .audit-action-footer,
  .dialog-header button,
  .sidebar,
  .topbar,
  .app-footer,
  .mobile-bottom-nav,
  #investor-tour-widget {
    display: none !important;
  }
}
