.scenario-table-wrap tbody tr:hover td.sc-col-month { background: #eef1f6; }
.scenario-table-wrap tbody tr.row-growth:hover td.sc-col-month { background: #e8effc; }
.scenario-table-wrap tbody tr.row-be:hover td.sc-col-month { background: #e0f9f0; }
.scenario-table-wrap tbody tr.row-growth td { background: rgba(37, 99, 235, 0.04); }
.scenario-table-wrap tbody tr.row-be td { background: #ecfdf5; }
.scenario-table-wrap tbody tr.row-be td.num { color: var(--green); font-weight: 500; }
.scenario-table-wrap td.sc-compound-cell .sc-client { color: var(--green); }
.scenario-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem;
}
.scenario-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: rgba(26, 29, 38, 0.45);
}
.scenario-modal-backdrop[hidden] { display: none; }
.scenario-modal {
  display: flex; flex-direction: column;
  width: min(420px, 100%); max-height: min(90vh, 520px);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(26, 29, 38, 0.18);
  overflow: hidden;
}
.scenario-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.15rem 1.25rem 0.75rem; flex-shrink: 0;
}
.scenario-modal-title {
  font-size: 1rem; font-weight: 500; margin: 0;
}
.scenario-modal-close {
  border: none; background: transparent; color: var(--muted);
  font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.scenario-modal-close:hover { color: var(--text); background: var(--surface2); }
.scenario-modal-body {
  flex: 1; overflow-y: auto;
  padding: 0.25rem 1.25rem 1rem;
}
.scenario-modal-body .scenario-controls {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 0.75rem; flex-wrap: nowrap;
}
.scenario-modal-footer {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.scenario-modal .scenario-ctrl-note { margin: 0.15rem 0 0; flex: none; min-width: 0; }
.scenario-ctrl { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; width: 100%; }
.scenario-ctrl-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 500;
}
.scenario-ctrl-field {
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.scenario-ctrl-field-full {
  position: relative; width: 100%;
}
.scenario-input {
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font: inherit; font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums;
  text-align: right; width: 5rem; padding: 0.4rem 0.55rem; border-radius: 8px;
  outline: none; transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield; appearance: textfield;
}
.scenario-modal .scenario-input {
  width: 100%; text-align: left;
  padding: 0.65rem 3.25rem 0.65rem 0.75rem;
  font-size: 0.95rem; font-weight: 400;
}
.scenario-modal .scenario-input::placeholder {
  color: var(--muted); font-weight: 400; opacity: 1;
}
.scenario-modal .scenario-ctrl-unit {
  position: absolute; right: 0.75rem; top: 50%;
  transform: translateY(-50%); pointer-events: none;
}
.scenario-input:hover { border-color: #c8ced8; }
.scenario-input:focus { border-color: var(--accent); background: var(--surface); }
.scenario-input::-webkit-outer-spin-button,
.scenario-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scenario-ctrl-unit { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.scenario-ctrl-note { font-size: 0.78rem; color: var(--muted); flex: 1; min-width: 12rem; line-height: 1.45; }
.scenario-apply-btn {
  align-self: flex-end; height: 36px; padding: 0 0.9rem;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font: inherit; font-size: 0.82rem; font-weight: 500;
  border-radius: 8px; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.scenario-modal-footer .scenario-apply-btn {
  width: 100%; height: 42px; align-self: stretch;
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.scenario-modal-footer .scenario-apply-btn:hover {
  background: #1d4ed8; border-color: #1d4ed8;
}
.scenario-apply-btn:hover { background: var(--surface); border-color: #c8ced8; }
td.scenario-new-cell { padding: 0.3rem 0.4rem; }
.scenario-input-cell {
  width: 3.4rem; font-size: 0.82rem; font-weight: 500; padding: 0.3rem 0.4rem;
}
.scenario-table-wrap tbody tr[data-month] td[data-col] { transition: background 0.12s; }
.scenario-table-wrap thead th {
  vertical-align: bottom; line-height: 1.25;
  padding: 0.55rem 0.45rem 0.45rem; background: var(--surface2);
}
.sc-th-label {
  display: inline-flex; align-items: center; justify-content: flex-end;
  gap: 0.15rem; max-width: 100%;
}
.sc-th-title { display: block; font-weight: 600; font-size: inherit; margin: 0; }
.sc-th-subs { display: flex; flex-direction: column; gap: 0.12rem; }
.sc-th-sub { font-size: 0.62rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sc-th-sub.sc-sub-client { color: var(--accent); }
.sc-th-sub.sc-sub-ours { color: #64748b; }
.sc-th-ours-only .sc-th-sub { text-align: right; }
td.sc-dual-cell { vertical-align: middle; }
.sc-cell { display: flex; flex-direction: column; gap: 0.18rem; align-items: flex-end; }
.sc-cell-line { font-variant-numeric: tabular-nums; line-height: 1.15; }
.sc-cell-line.sc-client { color: var(--accent); font-weight: 500; }
.sc-cell-line.sc-ours { color: #64748b; font-size: 0.92em; }
.scenario-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem;
  font-size: 0.78rem; color: var(--muted);
}
.hero .scenario-legend { margin-top: 0.35rem; }
.scenario-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.scenario-legend-dot {
  display: inline-block; width: 0.65rem; height: 0.65rem;
  border-radius: 50%; flex-shrink: 0;
}
.scenario-legend-dot.client { background: var(--accent); }
.scenario-legend-dot.cost { background: var(--text); }
.scenario-legend-label.client { color: var(--accent); font-weight: 500; }
.scenario-legend-label.cost { color: #64748b; font-weight: 500; }
.scenario-legend-meta { color: var(--muted); white-space: nowrap; }
.scenario-legend-sep { color: #c8ced8; user-select: none; }
.scenario-legend-edit {
  border: none; background: none; font: inherit; font-size: inherit;
  color: var(--muted); cursor: pointer; padding: 0; white-space: nowrap;
  text-decoration: underline dotted; text-underline-offset: 2px;
}
.scenario-legend-edit:hover { color: var(--accent); }
