:root {
  --bg: #eef5fb;
  --ink: #0a1e30;
  --ink-soft: #496174;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(14, 34, 51, 0.12);
  --primary: #d92130;
  --primary-dark: #b31b27;
  --accent: #ff7a18;
  --ok: #07835b;
  --shadow: 0 16px 34px rgba(15, 42, 61, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 15% 0%, #d9ecff 0%, var(--bg) 45%), linear-gradient(180deg, #f8fcff 0%, #eaf2f8 100%);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(48px);
}

.orb-1 { width: 280px; height: 280px; background: #93c7ff73; top: 40px; right: 10%; }
.orb-2 { width: 220px; height: 220px; background: #ffa65457; bottom: 30px; left: 10%; }

body.legacy-mode .app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  padding: 12px;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body.legacy-mode .left-panel,
body.legacy-mode .panel,
body.legacy-mode .topbar,
body.legacy-mode .kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

body.legacy-mode .left-panel { padding: 10px; position: sticky; top: 8px; height: calc(100vh - 16px); overflow: auto; min-width: 0; }
body.legacy-mode .brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 0 8px;
  border-radius: 12px;
}
body.legacy-mode .left-panel h1 { font-family: "Space Grotesk", sans-serif; font-size: 1.08rem; line-height: 1.2; margin: 0 0 4px; }
.muted { color: var(--ink-soft); margin: 0; }

.upload-box {
  border: 1px dashed #4b709a9c;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff99;
  display: grid;
  gap: 8px;
}

button,
input[type="file"]::file-selector-button {
  font-family: inherit;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

button.ghost { background: var(--primary-dark); }
button:disabled { opacity: .4; cursor: not-allowed; }

.actions { margin: 14px 0; display: grid; gap: 8px; }
.control-block {
  margin: 14px 0;
  border: 1px solid #c4d7e6;
  border-radius: 12px;
  background: #f7fbff;
  padding: 10px;
}
.control-block h3 { margin: 0 0 6px; font-size: .9rem; color: #b31b27; line-height: 1.15; }
.control-label {
  display: block;
  color: #34536d;
  font-size: .82rem;
  font-weight: 700;
  margin: 8px 0 4px;
}
.rule-list {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
  font-size: .85rem;
  color: #234865;
}
.rule-list label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rule-list input[type="checkbox"] {
  width: 14px;
  height: 14px;
}
select {
  width: 100%;
  border: 1px solid #b2c8da;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  font-family: inherit;
  color: var(--ink);
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d92130;
  margin: 0 0 6px;
}

.scenario-grid,
.scenario-weights {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
}
.scenario-actions {
  display: grid;
  gap: 8px;
  align-content: end;
}
.scenario-weights input[type="number"],
.scenario-grid input[type="text"],
.scenario-grid select {
  width: 100%;
}

.dependency-graph {
  width: 100%;
  min-height: 420px;
  border: 1px solid #e7c7d1;
  border-radius: 14px;
  background: #fff7fa;
  overflow: hidden;
  margin-top: 10px;
}
.dependency-graph svg {
  width: 100%;
  height: 100%;
  display: block;
}
.dep-label {
  font-size: 11px;
  fill: #4c0b1e;
  font-weight: 600;
  pointer-events: none;
}

.raci-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr);
  align-items: start;
}
.raci-chart {
  width: 100%;
  min-height: 280px;
  border: 1px solid #e7c7d1;
  border-radius: 14px;
  background: #fff7fa;
}
.raci-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}
.raci-bubble {
  font-weight: 700;
}

.dep-warning,
.dep-ok {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.dep-warning {
  background: #ffe1e7;
  color: #d92130;
}
.dep-ok {
  background: #e2f3ec;
  color: #0f7a5a;
}

.sheet-list { display: grid; gap: 6px; margin-top: 8px; }
.sheet-group {
  margin-top: 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #7b1430;
  padding: 6px 2px 2px;
}
.left-panel input[type="search"] {
  width: 100%;
  border: 1px solid #b2c8da;
  border-radius: 10px;
  padding: 9px 10px;
  margin: 4px 0 10px;
  background: #fff;
}
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e8b8c6;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff6f8;
  color: #7b1430;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  text-align: left;
}
.sheet-item.active { background: linear-gradient(90deg, #d92130, #b31b27); color: #fff; border-color: transparent; }
.sheet-item-label { font-weight: 700; }
.sheet-item-tag {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1f5;
  color: #b31b27;
  border: 1px solid #f2c0cf;
  white-space: nowrap;
}
.sheet-item.active .sheet-item-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

body.legacy-mode .main-panel { display: grid; gap: 14px; }
body.legacy-mode .main-panel { min-width: 0; }
body.legacy-mode .main-panel > * { min-width: 0; max-width: 100%; }
body.legacy-mode .panel { min-width: 0; max-width: 100%; }

/* Header styles now tailwind-first in index.html */

/* Dashboard charts: keep stable size (prevent growth on rerender) */
.charts-grid > .panel {
  min-height: 220px;
}
.charts-grid canvas {
  display: block;
  width: 100% !important;
  height: 150px !important;
  max-height: 150px !important;
}

body.legacy-mode .kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}
body.legacy-mode .kpi-card { padding: 8px 9px; border-radius: 12px; }
body.legacy-mode .kpi-card h4 { margin: 0; color: #2a4d68; font-size: .78rem; line-height: 1.2; }
body.legacy-mode .kpi-card p { margin: 4px 0 0; font-size: .92rem; font-weight: 800; color: #07253a; line-height: 1.2; }
body.legacy-mode .kpi-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid #7fb8e0;
}
body.legacy-mode .kpi-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, #d9ecff 0%, rgba(217, 236, 255, 0) 72%);
}

body.legacy-mode .charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}
body.legacy-mode .charts-grid canvas {
  height: 150px;
  max-height: 150px;
}
body.legacy-mode .panel { padding: 10px; }
body.legacy-mode .panel h3 { margin: 0 0 6px; font-size: .88rem; line-height: 1.15; color: #b31b27; }
body.legacy-mode .panel.compact { padding: 8px; }
body.legacy-mode .panel.compact h3 { margin-bottom: 4px; font-size: .84rem; }
body.legacy-mode .panel.compact .audit-log { max-height: 160px; }
body.legacy-mode .panel.compact .quality-summary { padding: 8px; }
body.legacy-mode .tile-mini {
  max-width: 430px;
  width: 100%;
  padding: 8px 10px;
}
body.legacy-mode .tile-mini h3 {
  margin-bottom: 4px;
  font-size: .86rem;
}
body.legacy-mode .tile-mini .muted {
  margin: 0;
  font-size: .82rem;
  line-height: 1.3;
}
body.legacy-mode .tile-summary {
  max-width: 430px;
}
body.legacy-mode .tile-summary .audit-entry {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .78rem;
  line-height: 1.3;
}
#raciPanel .raci-grid {
  display: none;
}
#dashboardQualityPanel #dashboardQualityList,
#dashboardQualityPanel #dataLineage {
  display: none;
}
.governance-cards-wrap {
  width: 100%;
}
.governance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.governance-card {
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.governance-card.top {
  border-color: #f0bac9;
  box-shadow: inset 0 0 0 1px #f8d7e1;
}
.governance-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.governance-card-head .rank {
  color: #b31b27;
  font-weight: 800;
  font-size: .78rem;
}
.governance-card-head h4 {
  margin: 0;
  font-size: .85rem;
  line-height: 1.2;
  color: #173852;
}
.governance-card-head .status {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}
.governance-card-head .status.ok {
  background: #e7f8ee;
  color: #13613b;
}
.governance-card-head .status.warn {
  background: #fff1d9;
  color: #8b5e00;
}
.governance-meta {
  display: grid;
  gap: 3px;
  color: #2c4a61;
  font-size: .75rem;
  margin-bottom: 6px;
}
.governance-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.governance-kpis span {
  font-size: .73rem;
  border: 1px solid #dce8f2;
  border-radius: 999px;
  padding: 2px 6px;
  color: #1f3b52;
  background: #f8fcff;
}
.governance-reason {
  margin: 0;
  font-size: .73rem;
  color: #375268;
  line-height: 1.35;
}
body.legacy-mode .decision-panel {
  border-left: 6px solid #ff7a18;
  background: linear-gradient(180deg, #fffaf5 0%, #fff 100%);
}
body.legacy-mode .decision-text {
  margin: 0;
  color: #173852;
  font-weight: 700;
  line-height: 1.45;
  font-size: .95rem;
}
.score-mask-input {
  width: 86px;
  border: 1px solid #b7cfe0;
  border-radius: 8px;
  padding: 6px 7px;
  font: inherit;
}
.score-mask-input.invalid {
  border-color: #c53232;
  background: #fff2f2;
}
body.legacy-mode .executive-brief {
  border: 1px solid #b6d4ea;
  background: linear-gradient(120deg, #f9fcff 0%, #eef7ff 100%);
}
body.legacy-mode .brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.legacy-mode .brief-head h3 { margin: 0 0 8px; color: #b31b27; }
body.legacy-mode .brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}
body.legacy-mode .brief-card {
  border: 1px solid #cfe3f2;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
body.legacy-mode .brief-card h4 {
  margin: 0 0 6px;
  color: #244a66;
  font-size: .86rem;
}
body.legacy-mode .brief-main {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #082a42;
  overflow-wrap: anywhere;
  word-break: break-word;
}
body.legacy-mode .brief-text {
  margin: 0;
  line-height: 1.4;
  color: #193a53;
  font-size: .9rem;
}

.table-panel {
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.table-note { margin: 0 0 10px; font-size: .88rem; }
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.table-tools-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-toolbar input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  min-width: 220px;
}

.table-wrap {
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  background: #fff;
  contain: inline-size;
}
.table-wrap::-webkit-scrollbar {
  height: 10px;
}
.table-wrap::-webkit-scrollbar-track {
  background: #f3f6fa;
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: #d4dee9;
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #bfcfdf;
}
table {
  border-collapse: collapse;
  width: max(100%, max-content);
  min-width: 100%;
  background: #fff;
  table-layout: auto;
  max-width: none;
}
th, td {
  border: 1px solid #dde9f1;
  padding: 5px 6px;
  text-align: left;
  min-width: 100px;
  font-size: .74rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(90deg, #d92130, #b31b27);
  color: #fff;
  white-space: nowrap;
}
th:hover {
  background: linear-gradient(90deg, #d92130, #b31b27);
  color: #fff;
}
th:not(.table-index) {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}
th[contenteditable="true"] {
  cursor: text;
}
th[contenteditable="true"]:focus {
  outline: 2px solid #ff9bb5;
  background: linear-gradient(90deg, #c51a45, #9b1033);
}
.table-index {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff1f5;
  color: #d92130;
  font-weight: 700;
  text-align: center;
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}
.header-row td {
  background: #f1f8ff !important;
  font-weight: 700;
}
tr:nth-child(even) td { background: #f9fcff; }
td[contenteditable="true"]:focus { outline: 2px solid #ff9d4a; background: #fff7ef; }
td.readonly-cell,
th.readonly-cell {
  background: #f2f6fa !important;
  color: #5f7488 !important;
  cursor: not-allowed !important;
}

.quality-summary {
  font-size: .86rem;
  color: #1f415d;
  line-height: 1.4;
}
.quality-score {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
}
.quality-good { background: #e4f8ef; color: #0f6c4c; border: 1px solid #b5e8d0; }
.quality-mid { background: #fff5e7; color: #8e5a10; border: 1px solid #f3d7a8; }
.quality-bad { background: #ffecec; color: #8f1f1f; border: 1px solid #f4b8b8; }

.global-search-results {
  max-height: 160px;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.global-hit {
  border: 1px solid #cfe1ef;
  border-radius: 8px;
  background: #fff;
  color: #183a55;
  padding: 7px 8px;
  font-size: .78rem;
  cursor: pointer;
}

.audit-panel { max-height: 220px; overflow: hidden; }
.audit-log {
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 6px;
  font-size: .83rem;
}
.audit-entry {
  background: #f8fbff;
  border: 1px solid #d6e5f0;
  border-radius: 8px;
  padding: 6px 8px;
  color: #234865;
}
.gate-checklist .audit-entry {
  padding: 7px 9px;
}
.gate-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.gate-item-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.task-high { border-left: 4px solid #cf3030; }
.task-mid { border-left: 4px solid #cc8a12; }
.task-low { border-left: 4px solid #1b7a50; }

td.commented-cell {
  position: relative;
}
td.commented-cell::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff7a18;
}

#assistantPanel .table-tools-right input { min-width: 220px; max-width: 100%; width: min(100%, 420px); }
#assistantAnswer { margin: 8px 0 0; line-height: 1.45; }

.reason-item {
  background: #f6fbff;
  border: 1px solid #d4e6f3;
  border-left: 4px solid #0f4c81;
  border-radius: 8px;
  padding: 7px 9px;
  color: #20415a;
}
.decision-score {
  display: grid;
  grid-template-columns: 55px 1fr;
  gap: 8px;
  align-items: center;
}
.decision-score .bar {
  height: 8px;
  border-radius: 999px;
  background: #e2eef7;
  overflow: hidden;
}
.decision-score .bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0d5a93, #39a1d7);
}
tr.option-top td {
  background: #eef8ff !important;
  font-weight: 700;
}
.table-index-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.table-index-cell > span {
  min-width: 0;
  flex: 1 1 auto;
}
.icon-btn {
  border: 1px solid #e0afbd;
  background: #fff7fa;
  color: #b31b27;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover {
  background: #ffe7ee;
}
.icon-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.icon-btn.plus {
  border-color: #c1e8d6;
  background: #effcf6;
  color: #0f7a52;
}
.icon-btn.plus:hover {
  background: #ddf7ea;
}
.icon-btn.danger {
  border-color: #efb6c4;
  background: #fff1f5;
  color: #d92130;
  font-size: 0;
  position: relative;
}
.icon-btn.danger:hover {
  background: #ffe3eb;
}
.icon-btn.danger::before {
  content: "−";
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.tabulator {
  border: 1px solid #d7e3ed;
  border-radius: 12px;
  overflow: visible;
  background: #fff;
  font-family: "Manrope", sans-serif;
  font-size: .72rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  width: 100%;
  max-width: 100%;
}
.tabulator .tabulator-header {
  border-bottom: 1px solid #d7e3ed;
  background: linear-gradient(90deg, #d92130, #b31b27);
}
.tabulator .tabulator-header .tabulator-col {
  background: transparent;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}
.tabulator .tabulator-header .tabulator-col:hover,
.tabulator .tabulator-header .tabulator-col.tabulator-col-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 7px 8px;
  white-space: nowrap;
}
.tabulator .tabulator-tableholder {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
}
.tabulator .tabulator-tableholder .tabulator-row {
  border-bottom: 1px solid #e2ecf4;
}
.tabulator .tabulator-tableholder .tabulator-row:nth-child(even) {
  background: #fbfdff;
}
.tabulator .tabulator-tableholder .tabulator-row:hover {
  background: #f2f8ff;
}
.tabulator .tabulator-row.option-top {
  background: #eef8ff !important;
}
.tabulator .tabulator-row.option-top .tabulator-cell {
  font-weight: 700;
}
.tabulator .tabulator-cell {
  border-right: 1px solid #e2ecf4;
  padding: 5px 7px;
  line-height: 1.35;
}

.table-wrap[data-sheet="Optionen-Matrix"] .tabulator {
  font-size: .73rem;
  min-width: 100%;
}
.table-wrap[data-sheet="Optionen-Matrix"] .tabulator .tabulator-header .tabulator-col {
  font-weight: 700;
  letter-spacing: .2px;
}
.table-wrap[data-sheet="Optionen-Matrix"] .tabulator .tabulator-tableholder {
  overflow-x: auto !important;
  max-width: 100%;
}
.tabulator .tabulator-cell.required-input-col {
  background: #fff7f9;
}
.tabulator .tabulator-row:nth-child(even) .tabulator-cell.required-input-col {
  background: #fff2f6;
}
.tabulator .tabulator-cell.calculated-col {
  background: #f4f6fb;
  color: #3b4b5a;
  font-weight: 600;
}
.tabulator .tabulator-row:nth-child(even) .tabulator-cell.calculated-col {
  background: #eef2f8;
}
.tabulator .tabulator-cell.required-input-col:focus {
  background: #ffe8f0;
}
.tabulator .tabulator-cell:focus {
  outline: 2px solid #ff9bb5;
  outline-offset: -2px;
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.readonly-grid.executive-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
}
.readonly-card.executive-pack {
  min-height: auto;
}

.readonly-card {
  position: relative;
  border: 1px solid #efcfda;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fff 0%, #fff7fa 100%);
  padding: 14px 15px;
  box-shadow: 0 6px 18px rgba(122, 18, 48, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.readonly-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #d92130, #d94872);
}

.readonly-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(122, 18, 48, 0.12);
  border-color: #e3a5ba;
}

.readonly-card h4 {
  margin: 2px 0 9px;
  color: #8d1135;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.readonly-card p {
  margin: 0;
  color: #203346;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.readonly-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.readonly-head h4 {
  margin: 0;
}

.readonly-icon {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 800;
  color: #7b1633;
  background: linear-gradient(180deg, #ffe5ee 0%, #ffd3e2 100%);
  border: 1px solid #efb8ca;
  letter-spacing: 0.2px;
}

.readonly-meta {
  display: grid;
  gap: 8px;
  color: #33495d;
  font-size: 11px;
  line-height: 1.35;
}

.readonly-row {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 6px;
  border-top: 1px dashed #efd2dc;
}

.readonly-row > * {
  min-width: 0;
}

.readonly-key {
  color: #7f2340;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.readonly-value {
  color: #1f3245;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.readonly-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.readonly-list-item {
  display: grid;
  grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px dashed #efd2dc;
}

.readonly-list-item > * {
  min-width: 0;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  border: 1px solid transparent;
}

.readonly-pill.neutral {
  color: #6d2340;
  background: #fbe8ef;
  border-color: #efc5d4;
}

.readonly-pill.good {
  color: #1f6a41;
  background: #e7f8ee;
  border-color: #bde9cf;
}

.readonly-pill.warn {
  color: #8c5a10;
  background: #fff4df;
  border-color: #f3d6a6;
}

.readonly-pill.danger {
  color: #8e1738;
  background: #ffe7ef;
  border-color: #f2bccd;
}

.readonly-empty {
  padding: 14px;
  border: 1px dashed #d7a5b9;
  border-radius: 12px;
  color: #5a6d7e;
  background: #fff;
}

/* Decision Summary should use width effectively (wider cards, no cramped rows) */
.table-wrap[data-sheet="Decision Summary"] {
  max-height: none;
  display: block;
  align-content: start;
  justify-content: start;
  padding-top: 0;
}
.table-wrap[data-sheet="Decision Summary"] .readonly-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  align-items: start;
  align-content: start;
  grid-auto-rows: min-content;
}
.table-wrap[data-sheet="Decision Summary"] .readonly-card {
  padding: 16px 18px;
  align-self: start;
}
.table-wrap[data-sheet="Decision Summary"] .readonly-row {
  grid-template-columns: minmax(0, 32%) minmax(0, 1fr);
  gap: 12px;
}

.executive-summary-v2 {
  display: grid;
  gap: 12px;
}

.executive-hero {
  border-color: #e3a5ba;
  background: linear-gradient(140deg, #fff7fa 0%, #fff 55%, #fff1f6 100%);
}

.executive-hero-main {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.executive-hero-option {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 900;
  color: #7f1030;
}

.executive-hero-sub {
  font-size: 12px;
  color: #5b6d7f;
  font-weight: 600;
}

.executive-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.executive-kpi-tile {
  border: 1px solid #f0c9d7;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.executive-kpi-tile span {
  font-size: 10px;
  color: #d92130;
  font-weight: 700;
}

.executive-kpi-tile strong {
  font-size: 14px;
  color: #172533;
  line-height: 1.1;
}

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

.calc-logic-view .calc-options-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.calc-logic-view .calc-option-card .readonly-meta {
  gap: 6px;
}

.calc-logic-view .calc-option-card .readonly-row {
  align-items: flex-start;
}

@media (max-width: 980px) {
  .executive-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .executive-columns {
    grid-template-columns: 1fr;
  }
  .calc-logic-view .calc-options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body.legacy-mode .app-shell { grid-template-columns: 1fr; }
  body.legacy-mode .left-panel { position: static; height: auto; }
  body.legacy-mode .kpi-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  body.legacy-mode .brief-grid { grid-template-columns: 1fr; }
  body.legacy-mode .charts-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  th, td { min-width: 72px; }
}
@media (max-width: 720px) {
  body.legacy-mode .kpi-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  body.legacy-mode .charts-grid { grid-template-columns: 1fr; }
}

/* Main header moved to tailwind utility classes in index.html */

/* Non-dashboard views: always top-align content containers */
body.view-detail .main-panel {
  align-content: start;
}
body.view-detail .main-panel > .panel,
body.view-detail #tablePanel,
body.view-detail #tableWrap,
body.view-detail .table-wrap,
body.view-detail .readonly-grid {
  align-self: start;
  align-content: start;
  justify-content: start;
}

/* Detailseiten: keine festen Box-Höhen, Inhalt bestimmt die Größe */
body.view-detail .table-panel {
  overflow: hidden;
}
body.view-detail .table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
body.view-detail .audit-panel,
body.view-detail .audit-log {
  max-height: none;
  overflow: visible;
}

/* Kontext + Governance: explizit ohne Höhenlimit und mit voller Inhaltsbreite */
body.view-detail .table-wrap[data-sheet="Themen & Scope"],
body.view-detail .table-wrap[data-sheet="Zielbild"],
body.view-detail .table-wrap[data-sheet="Architecture Assumptions"],
body.view-detail .table-wrap[data-sheet="Platform Maturity"],
body.view-detail .table-wrap[data-sheet="RACI Rollen"],
body.view-detail .table-wrap[data-sheet="RACI Matrix"],
body.view-detail .table-wrap[data-sheet="Decision Guardrails"] {
  max-height: none;
  overflow-y: visible;
}

body.view-detail .table-wrap[data-sheet="Architecture Assumptions"] .readonly-grid,
body.view-detail .table-wrap[data-sheet="Platform Maturity"] .readonly-grid,
body.view-detail .table-wrap[data-sheet="Decision Guardrails"] .readonly-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  align-items: start;
  align-content: start;
}

.model-builder {
  display: grid;
  gap: 14px;
}

.model-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #e5cad4;
  background: #fff7fa;
  border-radius: 12px;
}

.model-builder-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #b31b27;
}

.model-builder-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #5a6d7e;
}

.model-kpi {
  min-width: 120px;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #d7dbe2;
  background: #fff;
  display: grid;
  gap: 2px;
  text-align: right;
  margin-left: auto;
}

.model-kpi span {
  font-size: 11px;
  color: #5a6d7e;
  font-weight: 700;
}

.model-kpi strong {
  font-size: 20px;
  line-height: 1;
  color: #172533;
}

.model-kpi.good {
  border-color: #b7e4cf;
  background: #effaf4;
}

.model-kpi.good strong {
  color: #156f4a;
}

.model-kpi.warn {
  border-color: #f3d6a6;
  background: #fff6e7;
}

.model-kpi.warn strong {
  color: #8c5a10;
}

.model-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  min-width: 0;
}

.model-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.model-btn {
  border: 1px solid #b31b27;
  background: #b31b27;
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.model-btn:hover {
  background: #7a0d28;
}

.model-btn.ghost {
  background: #fff;
  color: #b31b27;
}

.model-btn.danger {
  background: #fff1f5;
  color: #b31b27;
  border-color: #efb8ca;
}

.model-btn.danger:hover {
  background: #ffe7ef;
}

.model-card {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.model-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-title {
  font-weight: 800;
  font-size: 13px;
  color: #172533;
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.model-unit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  color: #7b1633;
  background: #ffe9f0;
  border: 1px solid #efb8ca;
  white-space: nowrap;
  flex: 0 0 auto;
}

.model-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.model-icon-btn.danger {
  border-color: #f2bccd;
  color: #9b1233;
  background: #fff1f5;
  font-size: 0;
  position: relative;
}

.model-icon-btn.danger::before {
  content: "−";
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.model-card label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #5a6d7e;
}

.model-card input,
.model-card select,
.model-card textarea {
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  color: #172533;
  font-family: inherit;
  background: #fff;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.assistant-wizard .assistant-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.assistant-wizard {
  gap: 10px;
}

.assistant-wizard .assistant-kpi {
  border: 1px solid #d7dbe2;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 2px;
}

.assistant-wizard .assistant-kpi span {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.assistant-wizard .assistant-kpi strong {
  font-size: 16px;
  color: #172533;
  line-height: 1.1;
}

.assistant-wizard .assistant-kpi.good {
  border-color: #b7e4cf;
  background: #effaf4;
}

.assistant-wizard .assistant-kpi.warn {
  border-color: #f3d6a6;
  background: #fff6e7;
}

.assistant-wizard .assistant-kpi.danger {
  border-color: #f2bccd;
  background: #fff1f5;
}

.assistant-progress {
  display: grid;
  gap: 6px;
}

.assistant-progress-multi {
  display: grid;
  gap: 8px;
}

.assistant-progress-block {
  display: grid;
  gap: 4px;
}

.assistant-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.assistant-progress-track {
  height: 9px;
  border-radius: 999px;
  border: 1px solid #f0c8d6;
  background: #ffe9f0;
  overflow: hidden;
}

.assistant-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d0144d 0%, #b31b27 100%);
}

.assistant-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.assistant-inline select {
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
}

.assistant-mode-toggle {
  display: inline-flex;
  gap: 6px;
}

.assistant-step {
  border-color: #efb8ca;
  background: #fff7fa;
}

.assistant-hidden {
  display: none !important;
}

.assistant-step-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.assistant-score-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.assistant-main-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  align-items: start;
}

@media (max-width: 1080px) {
  .assistant-main-grid {
    grid-template-columns: 1fr;
  }
}

.assistant-missing {
  font-size: 12px;
  font-weight: 700;
  color: #b31b27;
  background: #fff1f5;
  border: 1px solid #f2bccd;
  border-radius: 8px;
  padding: 8px 10px;
}

.assistant-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.assistant-nav .model-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.assistant-interview-weights {
  border: 1px solid #efc5d4;
  background: #fff1f6;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.assistant-report-card {
  border-color: #dca9bb;
  background: linear-gradient(180deg, #fff7fa 0%, #fff 100%);
}

.assistant-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.assistant-copilot {
  border-color: #efb8ca;
  background: linear-gradient(180deg, #fff8fb 0%, #fff 100%);
  position: sticky;
  top: 10px;
}

.assistant-actions-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.assistant-actions-row .model-btn {
  width: 100%;
}

.assistant-scenario-card {
  border-color: #efb8ca;
}

.assistant-scenario-grid {
  display: grid;
  gap: 8px;
}

.assistant-scenario-row {
  border: 1px solid #f1d8e2;
  border-radius: 10px;
  padding: 8px;
  background: #fff8fb;
  display: grid;
  gap: 6px;
}

.assistant-scenario-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.assistant-scenario-label {
  font-size: 12px;
  font-weight: 700;
  color: #172533;
}

.assistant-scenario-value {
  font-size: 11px;
  font-weight: 800;
  color: #b31b27;
}

.assistant-scenario-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #fce8f0;
  overflow: hidden;
}

.assistant-scenario-bar span {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 999px;
}

.assistant-scenario-best {
  background: rgba(14, 165, 233, 0.35);
}

.assistant-scenario-base {
  background: rgba(208, 20, 77, 0.4);
}

.assistant-scenario-worst {
  background: rgba(15, 23, 42, 0.45);
}

.assistant-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 16px;
}

.assistant-modal {
  width: min(760px, 100%);
  border-radius: 14px;
  border: 1px solid #e7c9d4;
  background: #fff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.26);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.assistant-modal h4 {
  margin: 0;
  color: #b31b27;
  font-size: 16px;
  font-weight: 800;
}

.assistant-modal-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.assistant-modal-grid label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #5a6d7e;
}

.assistant-modal-grid input,
.assistant-modal-grid select {
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
}

.assistant-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.roadmap-timeline {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.roadmap-timeline.roadmap-expanded {
  gap: 10px;
}

.roadmap-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roadmap-filter-btn {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.roadmap-filter-btn.active {
  border-color: #9b1233;
  background: #9b1233;
  color: #fff;
}

.timeline-health {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 6px;
}

.timeline-health-card {
  border: 1px solid #ecd2dc;
  border-radius: 8px;
  background: #fff;
  padding: 5px 6px;
}

.timeline-health-card h4 {
  margin: 0;
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #d92130;
}

.timeline-health-card p {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 900;
  color: #172533;
}

.timeline-health-card.risk {
  border-color: #fecaca;
  background: #fff1f2;
}

.timeline-health-card.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.timeline-axis {
  position: relative;
  height: 16px;
  border-bottom: 1px dashed #d7a5b9;
}

.timeline-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: #7f2340;
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-now-label {
  margin-top: -6px;
  font-size: 9px;
  font-weight: 800;
  color: #7f2340;
}

.timeline-lanes {
  display: grid;
  gap: 6px;
}

.timeline-lane {
  border: 1px solid #ecd2dc;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.timeline-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-lane-count {
  font-size: 10px;
  font-weight: 700;
  color: #5a6d7e;
}

.timeline-lane-body {
  display: grid;
  gap: 5px;
}

.timeline-option-lane {
  border: 1px solid #e8edf3;
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px;
  min-width: 0;
}

.timeline-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-option-title {
  font-size: 10px;
  font-weight: 800;
  color: #1f3245;
}

.timeline-option-count {
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 800;
}

.timeline-option-body {
  display: grid;
  gap: 4px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(150px, 5fr) minmax(90px, 1.2fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.timeline-label {
  font-size: 10px;
  font-weight: 700;
  color: #1f3245;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: #f7e8ee;
  border: 1px solid #efd2dc;
  overflow: hidden;
}

.timeline-track.is-overdue {
  border-color: #ef4444;
  background: #fff1f2;
}

.timeline-today-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: #1f2937;
  opacity: 0.5;
  border-radius: 1px;
}

.timeline-bar {
  position: absolute;
  top: 1px;
  height: 4px;
  border-radius: 999px;
  min-width: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0.95;
}

.timeline-bar.p0 { background: #9b1233; }
.timeline-bar.p1 { background: #c2410c; }
.timeline-bar.p2 { background: #1d4ed8; }
.timeline-bar.p3 { background: #0f766e; }

.timeline-meta {
  font-size: 10px;
  color: #5a6d7e;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.timeline-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 5px;
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.timeline-pill.p0 { background: #ffe4ec; color: #9b1233; border-color: #f4b7ca; }
.timeline-pill.p1 { background: #fff1e6; color: #c2410c; border-color: #f4c3a7; }
.timeline-pill.p2 { background: #e9f0ff; color: #1d4ed8; border-color: #bfd2ff; }
.timeline-pill.p3 { background: #e6f7f3; color: #0f766e; border-color: #b8e6dd; }

.timeline-pill.status-backlog { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.timeline-pill.status-planned { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.timeline-pill.status-progress { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.timeline-pill.status-done { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.timeline-pill.overdue { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.timeline-pill.derived { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.timeline-pill.theme { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.timeline-pill.window { background: #f1f5f9; color: #1f2937; border-color: #cbd5e1; }

.timeline-source {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-empty {
  border: 1px dashed #d7a5b9;
  border-radius: 10px;
  padding: 10px;
  color: #5a6d7e;
  font-size: 12px;
  background: #fff;
}

.timeline-empty-mini {
  font-size: 9px;
  color: #5a6d7e;
  border: 1px dashed #d7a5b9;
  border-radius: 8px;
  padding: 4px 6px;
}

.roadmap-board {
  border: 1px solid #ecd2dc;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.roadmap-board-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.roadmap-legend {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.roadmap-board-head,
.roadmap-board-row {
  display: grid;
  grid-template-columns: 172px repeat(3, minmax(220px, 1fr));
}

.roadmap-board-head {
  background: #fff1f5;
  border-bottom: 1px solid #f2d4e0;
}

.roadmap-board-head > div {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #d92130;
  border-right: 1px solid #f2d4e0;
}

.roadmap-board-head > div:last-child {
  border-right: 0;
}

.roadmap-board-row {
  border-bottom: 1px solid #eef2f6;
}

.roadmap-board-row:last-child {
  border-bottom: 0;
}

.roadmap-board-option {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #1f3245;
  border-right: 1px solid #eef2f6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.roadmap-option-name {
  font-size: 12px;
  font-weight: 800;
  color: #1f3245;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.roadmap-option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.roadmap-board-row.shared .roadmap-board-option {
  background: #f8fafc;
}

.roadmap-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 0 6px;
  height: 18px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
}

.roadmap-board-cell {
  padding: 6px 8px;
  border-right: 1px solid #eef2f6;
  min-height: 56px;
  display: grid;
  gap: 4px;
  align-content: start;
  background: #f8fafc;
}

.roadmap-board-cell:last-child {
  border-right: 0;
}

.roadmap-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.roadmap-chip-row.is-first {
  outline: 1px solid #fda4af;
  border-radius: 8px;
  padding: 2px 3px;
  background: #fff7f8;
}

.roadmap-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #d92130;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.roadmap-chip-label {
  font-size: 10px;
  color: #334155;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.status-pill,
.sheet-item-tag,
.model-unit-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}


.roadmap-empty {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.roadmap-more-hint {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}

.roadmap-show-all {
  justify-self: start;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #d92130;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  cursor: pointer;
}

.roadmap-show-all:hover {
  background: #ffe4e6;
}

.roadmap-chip-open {
  border: 1px solid #f4b7ca;
  background: #fff1f5;
  color: #9b1233;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  line-height: 1;
  cursor: pointer;
}

.roadmap-chip-open:hover {
  background: #ffe4ec;
}

.roadmap-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.roadmap-modal-backdrop[hidden] {
  display: none !important;
}

.roadmap-modal {
  width: min(860px, 96vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.3);
}

.roadmap-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.roadmap-modal-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #1f3245;
}

.roadmap-modal-close {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.roadmap-modal-body {
  padding: 12px;
}

.roadmap-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  font-size: 12px;
  color: #334155;
}

.roadmap-detail-wide {
  grid-column: 1 / -1;
}

.roadmap-list {
  display: grid;
  gap: 8px;
}

.roadmap-list-group {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.roadmap-list-group-head {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #1f3245;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.roadmap-list-group-count {
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #d92130;
  background: #ffe4e6;
}

.roadmap-list-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  font-size: 12px;
  color: #334155;
}

.kanban-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px 7px;
  display: grid;
  gap: 6px;
}

.kanban-card.is-first {
  border-color: #fda4af;
  box-shadow: 0 0 0 1px #fecdd3 inset;
}

.kanban-card-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.kanban-card-title {
  font-size: 11px;
  font-weight: 800;
  color: #1f3245;
  line-height: 1.25;
}

.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cost-tiles {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.cost-tile {
  aspect-ratio: auto;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 68px;
}

.cost-tile h4 {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  color: #1f3245;
  line-height: 1.2;
}

.cost-tile-total {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #d92130;
  line-height: 1.1;
}

.cost-tile-meta {
  margin: 0;
  font-size: 10px;
  color: #5a6d7e;
}

.cost-tile-breakdown {
  margin: 0;
  font-size: 9px;
  color: #64748b;
  line-height: 1.25;
  word-break: break-word;
}

.charts-grid-quad .chart-tile {
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.charts-grid-quad .chart-tile canvas {
  width: 100% !important;
  height: 190px !important;
  min-height: 190px !important;
  max-height: 190px !important;
  flex: 0 0 auto;
  display: block;
  max-width: 100%;
}

#costBreakdownChart {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

.charts-grid-quad {
  align-items: stretch;
  grid-auto-rows: minmax(280px, auto);
}

.charts-grid-quad > .chart-tile > * {
  min-width: 0;
}

.roadmap-timeline.roadmap-expanded .timeline-health-card p { font-size: 18px; }
.roadmap-timeline.roadmap-expanded .timeline-axis { height: 22px; }
.roadmap-timeline.roadmap-expanded .timeline-axis span { font-size: 11px; }
.roadmap-timeline.roadmap-expanded .timeline-now-label { font-size: 11px; }
.roadmap-timeline.roadmap-expanded .timeline-row {
  grid-template-columns: minmax(140px, 1.4fr) minmax(180px, 5fr) minmax(120px, 1.2fr);
  gap: 10px;
}
.roadmap-timeline.roadmap-expanded .timeline-label { font-size: 12px; }
.roadmap-timeline.roadmap-expanded .timeline-track { height: 14px; }
.roadmap-timeline.roadmap-expanded .timeline-pill { font-size: 10px; }
