:root {
  --ink: #17201d;
  --muted: #69726e;
  --paper: #f4f3ee;
  --card: #fffefa;
  --line: #d8d8d0;
  --green: #0d7255;
  --green-soft: #dcebe3;
  --coral: #e36f52;
  --coral-soft: #f5dfd8;
  --discount-positive: #005792;
  --discount-negative: #dc2f2f;
  --lime: #d9f277;
  --shadow: 0 14px 40px rgba(29, 44, 37, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
.page-shell { width: min(1440px, 100%); margin: auto; padding: 0 40px; }
.site-header { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; display: flex; align-items: end; justify-content: center; gap: 2px; padding: 6px; border-radius: 50%; background: var(--ink); }
.brand-mark i { display: block; width: 4px; background: var(--lime); border-radius: 4px; }
.brand-mark i:nth-child(1) { height: 7px; }.brand-mark i:nth-child(2) { height: 14px; }.brand-mark i:nth-child(3) { height: 10px; }
.header-note { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-soft); }
.hero { display: grid; grid-template-columns: 1.55fr .75fr; align-items: end; gap: 70px; padding: 76px 0 48px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
h1 { margin: 0; max-width: 820px; font-size: clamp(48px, 6.1vw, 88px); line-height: .98; letter-spacing: -.065em; font-weight: 500; }
h1 em { color: var(--green); font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 400px; margin: 0 0 7px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.control-strip { position: sticky; top: 12px; z-index: 10; display: flex; align-items: stretch; min-height: 94px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,254,250,.94); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.setting { width: 245px; padding: 20px 24px; border-right: 1px solid var(--line); }
.setting > span:first-child { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.input-wrap { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.input-wrap input { width: 100px; padding: 0; border: 0; outline: none; color: var(--ink); background: transparent; font-family: "DM Mono", monospace; font-size: 27px; font-weight: 500; }
.input-wrap b { color: var(--muted); font-size: 13px; font-weight: 500; }
.control-actions { margin-left: auto; display: flex; align-items: center; gap: 23px; padding: 17px; }
.text-button, .primary-button { cursor: pointer; border: 0; font-weight: 700; font-size: 12px; }
.text-button { padding: 11px 3px; background: transparent; border-bottom: 1px solid var(--ink); }
.primary-button { display: flex; align-items: center; gap: 9px; padding: 14px 18px; color: white; background: var(--ink); border-radius: 9px; box-shadow: 0 6px 14px rgba(23,32,29,.16); }
.primary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.summary-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); margin: 36px 0 18px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.metric { min-height: 143px; display: flex; flex-direction: column; justify-content: center; padding: 24px 30px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { margin: 8px 0 4px; font-family: "DM Mono", monospace; font-size: clamp(25px, 3vw, 40px); line-height: 1; font-weight: 500; letter-spacing: -.05em; }
.metric small { color: var(--muted); font-size: 11px; }.positive-text { color: var(--green); }.negative-text { color: var(--coral); }
.chart-card, .data-card { margin: 18px 0; padding: 30px 30px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.card-heading h2 { margin: 0; font-size: 25px; line-height: 1.1; letter-spacing: -.035em; font-weight: 600; }
.card-heading > p { max-width: 380px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 11px; font-weight: 600; }
.legend span { display: flex; align-items: center; gap: 7px; }.legend i { width: 9px; height: 9px; border-radius: 3px; }
.positive-key { background: var(--green); }.negative-key { background: var(--coral); }
[data-chart="discounted"] .positive-key { background: var(--discount-positive); }
[data-chart="discounted"] .negative-key { background: var(--discount-negative); }
.legend .cumulative-key { width: 16px; height: 2px; border-radius: 0; background: var(--ink); }
.chart-scroll { overflow-x: auto; padding: 34px 0 0; scrollbar-width: thin; }
.chart { position: relative; height: 370px; }
.plot-grid { position: absolute; inset: 0 0 40px 62px; }
.grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed #deded7; }
.grid-line span { position: absolute; left: -62px; top: -8px; width: 50px; color: #8a918e; font-family: "DM Mono", monospace; font-size: 10px; text-align: right; }
.zero-line { position: absolute; left: 62px; right: 0; z-index: 2; border-top: 1.5px solid #65706b; transform: translateY(-40px); pointer-events: none; }
.bars { position: absolute; inset: 0 0 40px 62px; display: grid; grid-template-columns: repeat(var(--columns), minmax(54px, 1fr)); }
.cumulative-line { position: absolute; inset: 0 0 40px 62px; z-index: 4; width: calc(100% - 62px); height: calc(100% - 40px); overflow: visible; pointer-events: none; }
.cumulative-line polyline { fill: none; stroke: #101513; stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.cumulative-dots { position: absolute; inset: 0 0 40px 62px; z-index: 5; pointer-events: none; }
.cumulative-dots i { position: absolute; width: 7px; height: 7px; transform: translate(-50%, -50%); border: 2px solid var(--card); border-radius: 50%; background: #101513; box-shadow: 0 0 0 1px #101513; }
.bar-column { position: relative; min-width: 0; border-left: 1px solid rgba(220,220,213,.5); }
.bar-column:last-child { border-right: 1px solid rgba(220,220,213,.5); }
.copy-right-button {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  transform: translateX(-50%) translateY(-4px);
  border: 1px solid var(--ink);
  border-radius: 7px;
  color: white;
  background: var(--ink);
  box-shadow: 0 6px 16px rgba(23,32,29,.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .14s ease, transform .14s ease, background .14s ease;
}
.copy-right-button span { font-size: 9px; font-weight: 700; letter-spacing: .01em; }
.copy-right-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bar-column:hover .copy-right-button, .bar-column:focus-within .copy-right-button { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.copy-right-button:hover, .copy-right-button:focus-visible { color: var(--ink); background: var(--lime); outline: none; }
.copy-right-button.last-column { left: auto; right: 3px; transform: translateY(-4px); }
.bar-column:hover .copy-right-button.last-column, .bar-column:focus-within .copy-right-button.last-column { transform: translateY(0); }
.copy-right-button:disabled { cursor: not-allowed; opacity: .45; }
.bar-hitbox { position: absolute; left: 22%; width: 56%; min-height: 3px; padding: 0; border: 0; cursor: default; background: transparent; }
[data-chart="nominal"] .bar-hitbox { cursor: ns-resize; touch-action: none; user-select: none; }
.bar-fill { position: absolute; inset: 0; display: block; border-radius: 4px 4px 2px 2px; background: var(--green); box-shadow: inset 0 -8px 14px rgba(0,0,0,.05); transition: filter .15s; }
.bar-hitbox.negative .bar-fill { background: var(--coral); border-radius: 2px 2px 4px 4px; }
[data-chart="discounted"] .bar-hitbox.positive .bar-fill { background: var(--discount-positive); }
[data-chart="discounted"] .bar-hitbox.negative .bar-fill { background: var(--discount-negative); }
.bar-hitbox:hover .bar-fill, .bar-hitbox:focus .bar-fill { filter: brightness(1.08); }
.bar-hitbox:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.bar-value { position: absolute; left: 50%; z-index: 3; transform: translateX(-50%); color: var(--ink); font-family: "DM Mono", monospace; font-size: 10px; white-space: nowrap; }
.bar-hitbox.positive .bar-value { top: -19px; }.bar-hitbox.negative .bar-value { bottom: -19px; }
.drag-handle { position: absolute; left: 50%; z-index: 4; width: 20px; height: 5px; transform: translateX(-50%); border-top: 1px solid rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.85); opacity: .7; }
.positive .drag-handle { top: 7px; }.negative .drag-handle { bottom: 7px; }
.year-label { position: absolute; left: 0; right: 0; bottom: -28px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; text-align: center; }
.chart-caption { margin: 9px 0 0 62px; color: var(--muted); font-size: 11px; }
.quick-editor {
  position: fixed;
  z-index: 100;
  width: 210px;
  padding: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(23,32,29,.22);
}
.quick-editor label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.quick-editor label div { display: flex; align-items: center; gap: 5px; margin-top: 7px; padding: 7px 9px; border: 1px solid var(--green); border-radius: 7px; box-shadow: 0 0 0 3px var(--green-soft); }
.quick-editor label span { color: var(--muted); font-family: "DM Mono", monospace; font-size: 14px; }
.quick-editor input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-family: "DM Mono", monospace; font-size: 17px; font-weight: 500; }
.quick-editor small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; text-align: center; text-transform: none; letter-spacing: 0; }
.data-card { margin-top: 18px; padding-bottom: 30px; }
.cashflow-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; margin-top: 27px; }
.cashflow-field { padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf6; }
.cashflow-field-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.cashflow-field-head label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.input-copy-right-button { padding: 3px 5px; border: 0; border-radius: 4px; color: var(--green); background: var(--green-soft); cursor: pointer; font-size: 8px; font-weight: 700; white-space: nowrap; }
.input-copy-right-button b { color: inherit; font-size: 10px; }
.input-copy-right-button:hover, .input-copy-right-button:focus-visible { color: white; background: var(--green); outline: none; }
.input-copy-right-button:disabled { cursor: not-allowed; opacity: .45; }
.cashflow-value { display: flex; align-items: center; gap: 3px; }.cashflow-value > b { color: #929895; font-size: 12px; }
.cashflow-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-family: "DM Mono", monospace; font-size: 13px; }
.cashflow-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
footer { display: flex; justify-content: space-between; padding: 42px 0 55px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
footer span:first-child { color: var(--ink); font-weight: 700; }

@media (max-width: 850px) {
  .page-shell { padding: 0 18px; }.hero { grid-template-columns: 1fr; gap: 28px; padding: 52px 0 34px; }.hero-copy { max-width: 560px; }
  .control-strip { position: relative; top: 0; flex-wrap: wrap; }.setting { width: 50%; }.setting:nth-child(2) { border-right: 0; }
  .control-actions { width: 100%; border-top: 1px solid var(--line); }.summary-grid { grid-template-columns: 1fr; }.metric { border-left: 0; border-top: 1px solid var(--line); }.metric:first-child { border-top: 0; }
}
@media (max-width: 560px) {
  .site-header { height: 70px; }.header-note { display: none; }h1 { font-size: 49px; }.setting { padding: 16px; }.control-actions { justify-content: space-between; gap: 12px; }.text-button { font-size: 11px; }.primary-button { padding: 12px; }.primary-button svg { display: none; }
  .chart-card, .data-card { padding: 24px 16px; }.card-heading { align-items: start; flex-direction: column; gap: 14px; }.card-heading > p { text-align: left; }.chart-scroll { margin-right: -16px; }.chart-caption { margin-left: 48px; }.plot-grid, .bars, .cumulative-dots { left: 48px; }.cumulative-line { left: 48px; width: calc(100% - 48px); }.zero-line { left: 48px; }.grid-line span { left: -48px; width: 38px; }.metric { min-height: 125px; padding: 22px; }footer { flex-direction: column; gap: 12px; }
}
