:root {
  color-scheme: light;
  --navy: #273458;
  --blue: #4e73a0;
  --pale: #cee7fd;
  --text: #26313f;
  --secondary: #5b6573;
  --surface: #fff;
  --page: #f5f7fb;
  --border: #e1e7ef;
  --line: #edf1f6;
  --positive: #1e694d;
  --negative: #a43038;
  --royalty: #92612e;
  --service: #227466;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
.app-shell {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 100dvh;
  padding: 29px 16px 22px;
  background: var(--navy);
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 4px 41px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border: 1px solid #a5c5e2;
  border-radius: 9px;
  color: var(--pale);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.06em;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-wordmark, .sidebar-bottom div { display: grid; gap: 4px; }
.brand-wordmark strong { font-size: 20px; line-height: 1; letter-spacing: -.035em; }
.brand-wordmark span, .sidebar-bottom small { color: #c0d1e6; font-size: 11px; }
.navigation { display: grid; gap: 5px; }
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d1def0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-button:hover { background: #334467; color: white; }
.nav-button[aria-current="page"] { background: #3b5077; border-color: #52688c; color: white; }
.nav-button:focus-visible, .brand:focus-visible { outline-color: var(--pale); }
.icon { display: inline-flex; width: 17px; height: 17px; flex: 0 0 17px; }
.icon svg { width: 100%; height: 100%; }
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 17px 5px 0;
  border-top: 1px solid #52617e;
}
.sidebar-bottom strong { font-size: 12px; }
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #415982;
  color: var(--pale);
  font-size: 13px;
  font-weight: 700;
}
.workspace { min-width: 0; }
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 31px 34px 22px;
}
.breadcrumb {
  margin-bottom: 9px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 650;
}
.breadcrumb span { margin: 0 5px; color: #8a97a7; }
h1 { color: var(--navy); font-size: clamp(26px, 3vw, 35px); line-height: 1.06; letter-spacing: -.055em; }
h2 { color: var(--navy); font-size: 18px; font-weight: 720; letter-spacing: -.028em; }
h3 { color: var(--navy); font-size: 14px; font-weight: 720; }
.subtitle { color: var(--secondary); font-size: 13px; line-height: 1.5; }
.page-body { display: grid; gap: 17px; max-width: 1500px; margin: 0 auto; padding: 0 34px 36px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  background: var(--surface);
  font-size: 13px;
  font-weight: 670;
}
.button:hover { background: #edf4fb; }
.button.primary { background: var(--navy); color: white; border-color: var(--navy); }
.button.primary:hover { background: #3c5078; }
.button:disabled { background: #e9eef5; color: var(--secondary); border-color: #e9eef5; }
.button .icon { width: 15px; height: 15px; flex-basis: 15px; }
.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 1px 2px #27345806;
}
.panel-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 19px 20px 13px; }
.panel-header .subtitle { margin-top: 4px; }
.loading, .empty-state { padding: 25px 20px; color: var(--secondary); font-size: 14px; }
.month-panel { display: grid; gap: 10px; padding: 14px 15px; }
.month-panel-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.month-panel-top strong { font-size: 13px; color: var(--navy); }
.progress-count { display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-size: 11px; font-weight: 650; }
.progress-count::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.month-strip { position: relative; display: grid; grid-template-columns: repeat(12, minmax(50px, 1fr)); gap: 6px; overflow-x: auto; padding: 4px; margin: -4px; }
.month-button { border: 1px solid transparent; border-radius: 8px; padding: 7px 5px; background: #f2f5f9; color: var(--secondary); font-size: 12px; font-weight: 680; }
.month-button:hover { border-color: var(--blue); }
.month-button[aria-pressed="true"] { background: var(--pale); border-color: #9bc7ee; color: var(--navy); }
.month-button.revealed { color: var(--navy); }
.month-button .month-status { display: block; margin-top: 3px; font-size: 9px; font-weight: 620; letter-spacing: .025em; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; align-content: start; gap: 8px; padding: 17px 16px 15px; }
.kpi-label { color: var(--secondary); font-size: 12px; font-weight: 670; }
.kpi-number { color: var(--navy); font-size: clamp(21px, 2.35vw, 31px); font-weight: 740; letter-spacing: -.05em; }
.kpi-footer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; color: var(--secondary); font-size: 11px; line-height: 1.35; }
.kpi-footer strong { font-weight: 700; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-size: 11px; font-weight: 650; }
.swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--pale); }
.swatch.actual, .swatch.goods { background: var(--blue); }
.swatch.royalty { background: var(--royalty); }
.swatch.services { background: var(--service); }
.chart-scroll { padding: 0 18px 17px; overflow-x: auto; }
.chart { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: 126px 23px; min-width: 540px; }
.chart-axis { grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; text-align: right; padding-right: 9px; color: var(--secondary); font-size: 10px; }
.chart-plot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  position: relative;
  border-bottom: 1px solid #cbd6e4;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%);
}
.bar-group { position: relative; display: block; align-self: stretch; border: 0; background: transparent; border-radius: 5px 5px 0 0; }
.bar-group:hover, .bar-group[aria-pressed="true"] { background: #dcecf93f; }
.bar { position: absolute; left: 28%; width: 44%; min-width: 4px; border-radius: 4px 4px 0 0; background: var(--pale); }
.bar.down { border-radius: 0 0 4px 4px; }
.bar.actual { left: 53%; width: 27%; background: var(--blue); }
.bar.paired { left: 20%; width: 27%; }
.chart-labels { grid-column: 2; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.chart-label { align-self: end; text-align: center; font-size: 11px; color: var(--secondary); }
.chart-label.selected { color: var(--navy); font-weight: 740; }
.zero-line { position: absolute; left: 0; right: 0; border-top: 1px solid #afbdcf; pointer-events: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { background: #f6f8fb; color: var(--secondary); font-weight: 680; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td, .selected-row td { background: #f4f9fe; }
.table-name { color: var(--navy); font-weight: 690; }
.table-select { padding: 0; border: 0; background: transparent; color: var(--navy); font-weight: 700; text-align: left; }
.table-select:hover { text-decoration: underline; }
.dashboard-detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.breakdown { padding-bottom: 8px; }
.detail-list { list-style: none; margin: 0; padding: 1px 20px 10px; }
.detail-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--secondary); font-size: 12px; }
.detail-list li:last-child { border-bottom: 0; }
.detail-list strong { color: var(--navy); text-align: right; }
.detail-stack { display: grid; gap: 12px; }
.detail-stack .panel-header { padding-top: 16px; }
.view-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: #eef3f9; border: 1px solid var(--border); border-radius: 9px; }
.segmented button { border: 1px solid transparent; padding: 6px 9px; border-radius: 6px; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 650; }
.segmented button[aria-pressed="true"] { border-color: #dce6f3; color: var(--navy); background: white; box-shadow: 0 1px 2px #27345810; }
.segmented button:hover { color: var(--navy); }
.map-scroll { overflow-x: auto; padding: 6px 20px 18px; }
.map-stage {
  position: relative;
  isolation: isolate;
  min-width: 690px;
  height: 425px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background-color: #f6f9fd;
  background-image: radial-gradient(#d5e0ee 1px, transparent 1px);
  background-size: 18px 18px;
}
.map-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-region { position: absolute; top: 13px; color: var(--secondary); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.map-node {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 3px;
  width: clamp(102px, 15%, 156px);
  min-height: 48px;
  padding: 7px 9px;
  transform: translate(-50%, -50%);
  background: white;
  color: var(--navy);
  text-align: left;
  border: 1px solid #b9cbe0;
  border-radius: 8px;
  box-shadow: 0 2px 5px #27345813;
}
.map-node:hover, .map-node[aria-pressed="true"] { border-color: var(--blue); background: #e8f4ff; }
.map-node.muted { opacity: .55; }
.map-node strong { font-size: 11px; line-height: 1.2; }
.map-node span { color: var(--secondary); font-size: 10px; line-height: 1.25; }
.map-node.principal { border-color: #a0b5d1; background: #e9f2fc; }
.map-tools { padding: 13px 20px; display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.map-tools label { width: auto; }
.map-credit { margin-top: 8px; color: var(--secondary); font-size: 11px; line-height: 1.45; }
.map-credit a { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; align-items: start; }
.settings-form { display: grid; gap: 17px; }
.form-fields { display: grid; gap: 12px; padding: 0 20px 18px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.scenario-plan-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
label.field { display: grid; gap: 5px; color: var(--secondary); font-size: 12px; font-weight: 650; }
input, select {
  min-width: 0;
  min-height: 36px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cad6e6;
  border-radius: 6px;
  background: white;
  color: var(--navy);
}
.shock-table { padding: 0 20px; overflow: auto; }
.shock-table table { min-width: 380px; }
.shock-table th, .shock-table td { padding: 7px 6px; }
.shock-table th:first-child, .shock-table td:first-child { padding-left: 8px; }
.shock-table th:last-child, .shock-table td:last-child { padding-right: 8px; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.form-footer .view-controls { align-items: center; }
.field-note { color: var(--secondary); font-size: 11px; line-height: 1.5; }
.form-error { padding: 11px 12px; border: 1px solid #e4b8bc; border-radius: 8px; background: #fff5f5; color: var(--negative); font-size: 13px; }
.form-message { color: var(--positive); font-size: 13px; }
#scenario-message:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1090px) {
  .app-shell { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { padding-right: 11px; padding-left: 11px; }
  .page-header { padding-right: 23px; padding-left: 23px; }
  .page-body { padding-right: 23px; padding-left: 23px; }
  .dashboard-detail, .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 755px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: auto; padding: 12px 14px 10px; }
  .brand { margin: 0 0 12px; }
  .brand-mark { flex-basis: 35px; height: 35px; }
  .brand-wordmark { gap: 3px; }
  .brand-wordmark strong { font-size: 18px; }
  .sidebar-bottom { display: none; }
  .navigation { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-button { width: auto; padding: 7px 8px; font-size: 11px; gap: 5px; }
  .nav-button .icon { width: 13px; height: 13px; flex-basis: 13px; }
  .page-header { align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 18px 14px 13px; }
  .page-body { gap: 11px; padding: 0 14px 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .kpi { padding: 11px; gap: 5px; }
  .panel-header { padding: 14px 13px 10px; }
  .chart-scroll { padding-right: 13px; padding-left: 9px; }
  .panel-header h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
.map-node-title { display: inline-flex; align-items: center; gap: 4px; }
.map-factory-icon { width: 13px; height: 13px; flex-shrink: 0; color: var(--blue); }
