
/* Outcome Effect LMDI tool-specific styles.
   The global palette, typography, header, nav, buttons and footer come from /styles.css. */

.tool-page { background: var(--paper); }
.tool-page .site-header { background: rgba(7,17,31,.94); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(18px); }

.tool-hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 72px;
  color: var(--white);
  background: var(--ink);
}
.tool-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to bottom, black 10%, transparent 100%);
}
.tool-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
}
.tool-hero h1 {
  max-width: 760px;
  margin: 0 0 1.35rem;
  font-size: clamp(3.2rem, 7vw, 6.7rem);
  line-height: .95;
}
.tool-hero-lede {
  max-width: 760px;
  margin: 0;
  color: #aeb9c6;
  font-size: clamp(1.05rem, 1.6vw, 1.23rem);
}
.tool-principle {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 1rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
}
.tool-principle > span { color: var(--orange); font: 700 .75rem var(--display); }
.tool-principle small, .tool-principle strong { display: block; }
.tool-principle small { margin-bottom: .45rem; color: #8f9daf; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.tool-principle strong { max-width: 300px; font: 700 1.05rem/1.45 var(--display); }

.tool-workspace { padding-top: clamp(3rem, 6vw, 5rem); }
.tool-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 2rem; align-items: start; }
.tool-input-card {
  position: sticky;
  top: 104px;
  padding: 1.6rem;
  color: var(--white);
  background: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tool-section-heading { margin-bottom: 1.7rem; }
.tool-section-heading h2 { margin-bottom: .8rem; font-size: clamp(2rem, 3.4vw, 3.35rem); }
.tool-section-heading > p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted-dark); }
.dark-card .tool-section-heading > p:last-child, .tool-input-card .tool-section-heading > p:last-child { color: #9eabba; }
.compact-heading h2 { font-size: 2rem; }
.compact-heading .eyebrow { margin-bottom: .7rem; }

.period-inputs { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.period-block { padding-top: 1rem; border-top: 1px solid var(--line); }
.period-block h3 { margin-bottom: 1rem; color: var(--orange); font-size: 1rem; letter-spacing: -.02em; }
.tool-field { display: block; margin-bottom: .75rem; color: #aeb9c6; font-size: .78rem; font-weight: 600; }
.tool-field input {
  width: 100%;
  min-height: 44px;
  margin-top: .35rem;
  padding: .65rem .72rem;
  border: 1px solid #314058;
  border-radius: .25rem;
  outline: none;
  color: var(--white);
  background: #0a1525;
  transition: border-color .2s, box-shadow .2s;
}
.tool-field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,69,.12); }
.tool-calc-button { width: 100%; margin-top: .65rem; }
.tool-error { margin-top: 1rem; padding: .85rem 1rem; color: #ffd3c5; border: 1px solid rgba(255,122,69,.4); background: rgba(255,122,69,.09); font-size: .86rem; }

.tool-results { display: grid; gap: 1.4rem; min-width: 0; }
.tool-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-dark); background: var(--white); }
.tool-summary-card { min-height: 142px; padding: 1.35rem 1.45rem; border-right: 1px solid var(--line-dark); }
.tool-summary-card:last-child { border-right: 0; }
.tool-summary-card span, .tool-summary-card small, .tool-summary-card strong { display: block; }
.tool-summary-card span { margin-bottom: .5rem; color: var(--muted-dark); font-size: .69rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tool-summary-card strong { margin-bottom: .25rem; font: 700 clamp(1.65rem, 2.8vw, 2.55rem)/1 var(--display); letter-spacing: -.04em; }
.tool-summary-card small { color: #718093; font-size: .77rem; }
.tool-summary-card.accent-card { color: var(--white); background: var(--ink); }
.tool-summary-card.accent-card span, .tool-summary-card.accent-card small { color: #9dabb9; }
.tool-summary-card.accent-card strong { color: var(--aqua); }

.tool-card { padding: clamp(1.35rem, 2.6vw, 2.2rem); background: var(--white); border: 1px solid var(--line-dark); }
.tool-card.dark-card { color: var(--white); background: var(--ink); border-color: var(--line); }
.interpretation-card { border-top: 3px solid var(--orange); }
.validation-card { border-top: 3px solid var(--aqua); }
.table-wrap { overflow-x: auto; }
.tool-card table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tool-card th, .tool-card td { padding: .75rem .65rem; border-bottom: 1px solid var(--line-dark); text-align: right; white-space: nowrap; }
.tool-card th:first-child, .tool-card td:first-child { text-align: left; }
.tool-card th { color: var(--muted-dark); font-size: .67rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tool-card tbody tr:last-child td { border-bottom: 0; }
.positive { color: #18806b; }
.negative { color: #b83d31; }
.dark-card .positive { color: var(--aqua); }
.dark-card .negative { color: var(--orange-light); }

.chart { min-height: 430px; overflow-x: auto; }
.chart svg { min-width: 720px; }
.axis text { fill: var(--muted-dark); font-family: var(--body); font-size: 12px; }
.axis path, .axis line { stroke: rgba(7,17,31,.22); }
.grid line { stroke: rgba(7,17,31,.09); }
.grid path { display: none; }
.dark-card .axis text { fill: #a7b3c1; }
.dark-card .axis path, .dark-card .axis line { stroke: rgba(255,255,255,.2); }
.dark-card .grid line { stroke: rgba(255,255,255,.08); }
.legend { fill: var(--muted-dark); font-family: var(--body); font-size: 12px; }
.interpretation { max-width: 900px; font-size: 1.05rem; line-height: 1.72; }
.interpretation p { margin: 0; }
.validation-status { margin-top: 1rem; padding: .9rem 1rem; border-left: 3px solid var(--aqua); background: #eef4f2; font-size: .88rem; }
.validation-status.warning { border-left-color: var(--orange); background: #fff3ed; }
.tooltip { position: fixed; z-index: 1000; max-width: 300px; padding: .7rem .8rem; pointer-events: none; color: var(--white); background: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .8rem; line-height: 1.5; }
.hidden { display: none !important; }

@media (max-width: 1080px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-input-card { position: static; }
  .period-inputs { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (max-width: 760px) {
  .tool-hero { padding: 116px 0 52px; }
  .tool-hero-grid { grid-template-columns: 1fr; }
  .tool-hero h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
  .period-inputs, .tool-summary-grid { grid-template-columns: 1fr; }
  .tool-summary-card { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .tool-summary-card:last-child { border-bottom: 0; }
  .tool-card { padding: 1.1rem; }
  .chart { min-height: 360px; }
}
#waterfallChart .lab {
  fill: #ffffff !important;
}