:root {
  --ink: #17211f;
  --muted: #64706d;
  --line: #d8dedb;
  --paper: #f4f6f4;
  --surface: #ffffff;
  --accent: #0b796b;
  --accent-dark: #075c52;
  --accent-soft: #dcefeb;
  --danger: #a13c38;
  --radius: 10px;
  --shadow: 0 12px 30px rgba(23, 33, 31, 0.08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
button, input, select { font: inherit; }
button, input, select { min-height: 44px; }
button { cursor: pointer; }
.topbar { min-height: 92px; padding: 20px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--ink); color: white; }
h1 { margin: 2px 0 0; font-size: clamp(1.45rem, 2.7vw, 2.15rem); letter-spacing: -0.04em; }
h2 { margin: 3px 0 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -0.045em; }
h3 { margin: 0; }
.eyebrow { margin: 0; color: var(--accent); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.topbar .eyebrow { color: #7bd1c4; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.save-status { color: #c9d1cf; font-size: .78rem; margin-right: 8px; }
.save-status.save-error { color: #ffb4ad; font-weight: 700; }
.button, .tab, .icon-button { border: 0; border-radius: 7px; font-weight: 700; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.button { min-height: 44px; padding: 0 16px; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; }
.topbar .button.secondary { border-color: #53615e; color: white; }
.button.danger { margin-top: 24px; color: var(--danger); background: transparent; border: 1px solid #d8b5b2; }
.button:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .icon-button:focus-visible { outline: 3px solid rgba(11, 121, 107, .28); outline-offset: 2px; }
.tabs { display: flex; overflow-x: auto; padding: 0 clamp(20px, 4vw, 64px); background: var(--surface); border-bottom: 1px solid var(--line); }
.tab { flex: 0 0 auto; min-height: 54px; padding: 0 20px; background: transparent; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
main { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.panel { animation: reveal .18s ease; }
@keyframes reveal { from { opacity: .25; transform: translateY(3px); } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.lead { color: var(--muted); max-width: 850px; margin: 0 0 28px; }
.badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 99px; background: #ede9dc; color: #6d5b1e; font-size: .75rem; font-weight: 800; }
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--surface); }
.kpi-strip article { padding: 24px; border-right: 1px solid var(--line); }
.kpi-strip article:last-child { border-right: 0; }
.kpi-strip span, .roi-summary span { display: block; color: var(--muted); font-size: .78rem; min-height: 36px; }
.kpi-strip strong, .roi-summary strong { display: block; margin-top: 9px; font-size: clamp(1.25rem, 2vw, 1.7rem); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.kpi-strip .accent-kpi { background: var(--accent); color: white; }
.kpi-strip .accent-kpi span { color: #d2f0eb; }
.overview-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 18px; }
.opportunity-block, .assumptions { background: var(--surface); border: 1px solid var(--line); padding: 28px; }
.opportunity-block h3 { margin-top: 14px; font-size: 1.6rem; }
.opportunity-block > p:not(.eyebrow) { color: var(--muted); }
.text-action { min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--accent); font-weight: 800; }
.assumptions dl { margin: 20px 0 0; }
.assumptions dl div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.assumptions dt { color: var(--muted); }
.assumptions dd { margin: 0; text-align: right; font-weight: 700; }
.company-layout, .task-form-wrap { background: var(--surface); border: 1px solid var(--line); padding: 28px; margin-top: 26px; }
.company-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
label { display: grid; gap: 7px; color: #394340; font-size: .82rem; font-weight: 750; }
input, select { width: 100%; border: 1px solid #bfc8c5; border-radius: 6px; padding: 9px 11px; background: white; color: var(--ink); }
input:invalid:not(:placeholder-shown) { border-color: var(--danger); }
.form-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-top: 8px; }
.form-footer p { margin: 0; color: var(--muted); max-width: 650px; }
.task-form-wrap { border-top: 4px solid var(--accent); box-shadow: var(--shadow); }
.form-title, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon-button { width: 44px; padding: 0; background: transparent; color: var(--muted); font-size: 1.6rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0; }
.span-2 { grid-column: span 2; }
.form-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 20px; }
.table-wrap { margin-top: 24px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { text-align: left; padding: 15px 14px; border-bottom: 1px solid var(--line); font-size: .83rem; }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; background: #f9faf9; }
td strong { display: block; }
td small { color: var(--muted); }
.row-actions { display: flex; gap: 4px; }
.row-actions button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 750; }
.row-actions .remove { color: var(--danger); }
.empty-state { text-align: center; color: var(--muted); padding: 42px 20px; margin: 0; }
.formula-details { margin-top: 20px; border: 1px solid var(--line); background: var(--surface); padding: 0 18px; }
.formula-details summary { min-height: 52px; display: flex; align-items: center; color: var(--accent); font-weight: 800; cursor: pointer; }
.formula-details p { color: var(--muted); }
.formula-list { display: grid; gap: 10px; padding: 0 0 20px; }
.formula-list code { white-space: normal; color: #34403d; }
.matrix-shell { position: relative; margin: 34px 0 22px; padding: 0 0 30px 28px; }
.matrix { position: relative; height: 510px; background: linear-gradient(to right, transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px)), linear-gradient(to bottom, transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px)), var(--surface); border: 1px solid #aeb9b6; overflow: hidden; }
.quadrant { position: absolute; padding: 10px; color: #7a8582; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.q1 { top: 0; left: 0; }.q2 { top: 0; right: 0; color: var(--accent); }.q3 { bottom: 0; left: 0; }.q4 { bottom: 0; right: 0; }
.axis-label { position: absolute; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.y-axis { left: 0; top: 50%; writing-mode: vertical-rl; transform: rotate(180deg) translateY(50%); }
.x-axis { bottom: 0; left: 50%; transform: translateX(-50%); }
.matrix-point { position: absolute; transform: translate(-50%, 50%); width: 20px; height: 20px; min-height: 20px; border: 3px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-dark); }
.matrix-point span { position: absolute; left: 14px; bottom: 13px; max-width: 145px; padding: 4px 7px; background: rgba(255,255,255,.94); color: var(--ink); border: 1px solid var(--line); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix-point.right-edge span { left: auto; right: 14px; }
.priority-list { display: grid; gap: 8px; }
.priority-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 18px; align-items: center; min-height: 58px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); }
.priority-row span { color: var(--muted); font-size: .78rem; }
.roi-summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink); color: white; margin: 26px 0 18px; }
.roi-summary.five-columns { grid-template-columns: repeat(5, 1fr); }
.roi-summary div { padding: 22px; border-right: 1px solid #45504e; }
.roi-summary span { color: #b7c0be; }
.scenario-list { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); }
.scenario { padding: 26px; border-right: 1px solid var(--line); }
.scenario:last-child { border-right: 0; }
.scenario.probable { border-top: 4px solid var(--accent); padding-top: 22px; }
.scenario h3 { font-size: 1.05rem; }
.scenario .factor { color: var(--accent); font-size: .76rem; font-weight: 800; }
.scenario dl { margin-bottom: 0; }
.scenario dl div { padding: 10px 0; border-top: 1px solid var(--line); }
.scenario dt { color: var(--muted); font-size: .72rem; }
.scenario dd { margin: 4px 0 0; font-size: 1.1rem; font-weight: 800; }
.fine-print { color: var(--muted); font-size: .78rem; }
footer { padding: 24px clamp(20px, 4vw, 64px); display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: .78rem; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .kpi-strip, .roi-summary, .roi-summary.five-columns { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip article:nth-child(2), .roi-summary div:nth-child(2) { border-right: 0; }
  .kpi-strip article { border-bottom: 1px solid var(--line); }
  .overview-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-list { grid-template-columns: 1fr; }
  .scenario { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
  main { width: min(100% - 24px, 1320px); padding-top: 26px; }
  .topbar { padding: 18px; }
  .top-actions, .top-actions .button { width: 100%; }
  .save-status { width: 100%; }
  .tabs { padding: 0 6px; }
  .tab { padding: 0 14px; }
  .section-heading, .form-footer { align-items: stretch; flex-direction: column; }
  .section-heading .button { width: 100%; }
  .kpi-strip, .roi-summary, .roi-summary.five-columns, .company-layout, .form-grid { grid-template-columns: 1fr; }
  .kpi-strip article, .roi-summary div { border-right: 0; }
  .span-2 { grid-column: auto; }
  .priority-row { grid-template-columns: 1fr 1fr; }
  .priority-row strong { grid-column: 1 / -1; }
  .matrix { height: 420px; }
  .matrix-point span { max-width: 95px; }
}
@media print {
  body { background: white; font-size: 12pt; }
  .top-actions, .tabs, .button, .task-form-wrap, .row-actions, footer { display: none !important; }
  main { width: 100%; padding: 20px; }
  .panel { display: block !important; page-break-after: always; }
  .company-layout { display: none; }
  .kpi-strip, .roi-summary { break-inside: avoid; }
  .matrix { height: 420px; }
}
