:root {
  --paper: #eeeae1;
  --paper-2: #f8f5ee;
  --white: #ffffff;
  --ink: #102a43;
  --ink-2: #334e68;
  --muted: #6b7c8f;
  --line: #d8d1c3;
  --line-soft: #e7e1d5;
  --teal: #0f766e;
  --teal-bright: #14b8a6;
  --teal-soft: #e6f3ef;
  --sand: #d9a441;
  --sand-soft: #f7eedb;
  --coral: #d96c4a;
  --coral-soft: #fbece7;
  --navy: #102a43;
  --shadow: 0 12px 32px rgba(16, 42, 67, 0.06);
  --radius: 16px;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.07), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(217, 164, 65, 0.08), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0 22px 16px;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  flex: 0 0 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.06em;
  box-shadow: 0 6px 14px rgba(16, 42, 67, 0.16);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 2px var(--navy);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1;
}

.brand-sub {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
}

.topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.topbar-claim {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 190px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.scenario-badge {
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--navy);
  color: var(--white);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ghost-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ghost-btn:hover {
  border-color: var(--ink-2);
  background: rgba(255, 255, 255, 0.45);
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.main-col {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  gap: 12px;
  min-height: 0;
}

.control-col {
  min-height: 0;
}

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */

.card,
.kpi {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  padding: 13px 15px;
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.kpi:nth-child(1) { animation-delay: 0.02s; }
.kpi:nth-child(2) { animation-delay: 0.06s; }
.kpi:nth-child(3) { animation-delay: 0.1s; }
.kpi:nth-child(4) { animation-delay: 0.14s; }
.kpi:nth-child(5) { animation-delay: 0.18s; }

.kpi-grid {
  display: grid;
  grid-template-columns: 1.22fr 1fr 1fr 0.95fr 1.08fr;
  gap: 10px;
}

.kpi-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.1vw, 34px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}

.kpi-sub {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.3;
}

.kpi-revenue {
  border-color: rgba(16, 42, 67, 0.8);
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.22), transparent 55%),
    var(--navy);
  color: var(--white);
}

.kpi-revenue .kpi-label,
.kpi-revenue .kpi-sub {
  color: rgba(255, 255, 255, 0.64);
}

.kpi-revenue .kpi-value {
  color: var(--white);
  font-size: clamp(28px, 2.5vw, 40px);
}

.kpi-ebitda {
  border-color: #c9e2db;
  background: var(--teal-soft);
}

.kpi-ebitda .kpi-value {
  color: var(--teal);
}

.kpi-capital {
  border-color: #e8d5b1;
  background: var(--sand-soft);
}

.kpi-capital .kpi-value {
  color: #8a5a00;
}

.kpi-breakeven {
  border-color: #f0d1c6;
  background: var(--coral-soft);
}

.kpi-breakeven .kpi-value {
  color: #a8462c;
}

.kpi-customers {
  background: var(--white);
}

.kpi-customers .kpi-value {
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Chart                                                                      */
/* -------------------------------------------------------------------------- */

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 14px 8px;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.card-head h2,
.card-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.card-head h2 {
  font-size: 21px;
}

.card-head h3 {
  font-size: 15px;
}

.card-head.compact {
  align-items: center;
}

.mini-note {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
  white-space: nowrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.swatch-teal {
  background: var(--teal);
}

.swatch-coral {
  background: var(--coral);
}

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 2px;
}

#chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 128px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  font-size: 9.5px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.18);
  transform: translate(-50%, calc(-100% - 12px));
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
}

.chart-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255, 255, 255, 0.72);
}

.chart-tooltip .tt-row b {
  color: var(--white);
  font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Bottom panels                                                              */
/* -------------------------------------------------------------------------- */

.bottom-grid {
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 12px;
  min-height: 148px;
}

.ladder-card,
.answers-card {
  padding: 11px 13px 10px;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
}

.ladder {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
}

.ladder-step {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 76px;
  padding: 8px 9px;
  border-radius: 11px;
}

.ladder-step .step-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.62;
}

.ladder-step strong {
  font-family: var(--font-display);
  font-size: clamp(10px, 0.88vw, 12px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
}

.ladder-step small {
  font-size: 8px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.68;
}

.step-bottom {
  background: #dceee9;
  color: var(--teal);
}

.step-core {
  background: var(--teal);
  color: var(--white);
}

.step-top {
  background: var(--navy);
  color: var(--white);
}

.step-addon {
  background: #f3e3be;
  color: #7a4f00;
}

.ladder-arrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.answer-list {
  display: grid;
  gap: 3px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.answer-list li {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 5px;
  align-items: start;
}

.answer-num {
  padding-top: 1px;
  color: var(--teal);
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.answer-list p {
  margin: 0;
  color: var(--ink-2);
  font-size: 9.3px;
  font-weight: 400;
  line-height: 1.28;
}

.answer-list strong {
  color: var(--ink);
  font-weight: 700;
}

/* -------------------------------------------------------------------------- */
/* Controls                                                                   */
/* -------------------------------------------------------------------------- */

.controls {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 15px 15px 12px;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.08s both;
}

.controls-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.controls-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(-25deg);
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-top: 12px;
  padding: 3px;
  border-radius: 10px;
  background: #e9e4d9;
}

.preset {
  min-width: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.preset:hover {
  color: var(--ink);
}

.preset.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(16, 42, 67, 0.08);
}

.controls-body {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  padding-right: 3px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.controls-body::-webkit-scrollbar {
  width: 4px;
}

.controls-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line);
}

.control-group {
  margin-bottom: 6px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.group-line {
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 3px;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-copy span {
  font-size: 10px;
  font-weight: 600;
}

.switch-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #c8c1b3;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.2);
  transition: transform 0.2s ease;
}

.switch[aria-checked="true"] {
  background: var(--teal);
}

.switch[aria-checked="true"]::after {
  transform: translateX(15px);
}

.control {
  display: block;
  padding: 3px 0;
  cursor: pointer;
}

.control-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 1px;
}

.control-label {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
}

.control-value {
  color: var(--teal);
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.control input[type="range"] {
  display: block;
  width: 100%;
  height: 4px;
  margin: 4px 0 3px;
  border-radius: 99px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--teal) 0 var(--pct, 50%), var(--line) var(--pct, 50%) 100%);
  cursor: pointer;
}

.control input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--paper-2);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s ease;
}

.control input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper-2);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}

.control input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.12);
}

.control input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.control-insight {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #cfe4dd;
  border-radius: 11px;
  background: linear-gradient(135deg, #e8f4ef, #f4f8f5);
}

.insight-label {
  display: block;
  color: var(--teal);
  font-size: 7.8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.control-insight p {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

.controls-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 8.3px;
  font-weight: 500;
  line-height: 1.25;
}

.pulse {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

/* -------------------------------------------------------------------------- */
/* Motion                                                                     */
/* -------------------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 326px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi {
    padding: 12px;
  }

  .kpi-sub {
    font-size: 8.5px;
  }

  .ladder-step strong {
    font-size: 10px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    padding: 0 16px 20px;
  }

  .topbar {
    height: 58px;
    flex-basis: 58px;
  }

  .topbar-center {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .main-col {
    grid-template-rows: auto 360px auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-revenue {
    grid-column: span 2;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    height: auto;
  }

  .controls-body {
    overflow: visible;
  }

  .control {
    padding: 5px 0;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 0 12px 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand-sub {
    display: none;
  }

  .topbar-actions {
    min-width: 0;
  }

  .ghost-btn {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-revenue {
    grid-column: auto;
  }

  .main-col {
    grid-template-rows: auto 300px auto;
  }

  .bottom-grid {
    min-height: 0;
  }

  .ladder {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ladder-arrow {
    display: none;
  }

  .ladder-step {
    min-height: 70px;
  }

  .chart-foot {
    display: none;
  }

  .legend {
    gap: 8px;
  }
}

@media (max-height: 800px) and (min-width: 981px) {
  .control-insight {
    margin-top: 6px;
    padding: 8px 9px;
  }

  .control-insight p {
    font-size: 9.5px;
  }

  .kpi {
    min-height: 100px;
    padding: 11px 13px;
  }

  .kpi-value {
    font-size: clamp(23px, 1.95vw, 31px);
  }

  .kpi-revenue .kpi-value {
    font-size: clamp(26px, 2.2vw, 35px);
  }

  .bottom-grid {
    min-height: 136px;
  }

  .ladder-step {
    min-height: 68px;
  }

  .card-head h2 {
    font-size: 19px;
  }

  .card-head h3 {
    font-size: 14px;
  }

  .controls {
    padding-top: 12px;
  }

  .preset-row {
    margin-top: 9px;
  }
}

/* -------------------------------------------------------------------------- */
/* View navigation                                                            */
/* -------------------------------------------------------------------------- */

.viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 36px;
  min-height: 36px;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #e8e3d8;
}

.view-tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.view-tab:hover {
  color: var(--ink);
}

.view-tab.active {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 7px rgba(16, 42, 67, 0.12);
}

.view-note {
  color: var(--muted);
  font-size: 8.3px;
  font-weight: 500;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Detail views                                                               */
/* -------------------------------------------------------------------------- */

.detail-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 2px 2px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.detail-view::-webkit-scrollbar {
  width: 5px;
}

.detail-view::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 14px;
}

.detail-head h1 {
  margin: 3px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.detail-lead {
  max-width: 760px;
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #e8e3d8;
}

.seg-btn {
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(16, 42, 67, 0.08);
}

.primary-btn {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.primary-btn:hover {
  background: var(--teal);
  transform: translateY(-1px);
}

.detail-callout {
  margin: -2px 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--coral);
  border-radius: 0 10px 10px 0;
  background: #fbede8;
  color: #7a3a26;
  font-size: 10px;
  line-height: 1.45;
}

.detail-callout strong {
  color: var(--ink);
}

.mini-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mini-kpi {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.mini-kpi-label {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mini-kpi strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.mini-kpi small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.25;
}

/* -------------------------------------------------------------------------- */
/* Data tables                                                                */
/* -------------------------------------------------------------------------- */

.table-card {
  margin-bottom: 12px;
  padding: 12px 14px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.table-note {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.table-scroll {
  overflow: auto;
  max-height: 520px;
  border-radius: 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.table-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.table-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-2);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: rgba(15, 118, 110, 0.035);
}

.data-table .num {
  text-align: right;
}

.data-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--paper-2);
  box-shadow: 2px 0 0 var(--line-soft);
  font-weight: 600;
  color: var(--ink);
}

.data-table th.sticky-col {
  z-index: 4;
}

.data-table .negative {
  color: var(--coral);
}

.data-table .positive {
  color: var(--teal);
}

.data-table .muted-cell {
  color: var(--muted);
}

.data-table .year-row td {
  border-top: 1px solid #cfe4dd;
  border-bottom: 1px solid #cfe4dd;
  background: #e9f2ee;
  color: var(--teal);
  font-weight: 700;
}

.data-table .year-row .sticky-col {
  background: #e9f2ee;
  color: var(--teal);
}

.data-table .total-row td {
  border-top: 1px solid var(--line);
  background: #f0ece2;
  color: var(--ink);
  font-weight: 700;
}

.data-table .total-row .sticky-col {
  background: #f0ece2;
}

.monthly-table {
  min-width: 1380px;
}

.mix-table {
  min-width: 760px;
}

.investment-table {
  min-width: 900px;
}

.team-table {
  min-width: 720px;
}

.assumption-table {
  min-width: 1000px;
}

.assumption-table td {
  white-space: normal;
  line-height: 1.35;
}

.assumption-table td:nth-child(2) {
  min-width: 220px;
}

.assumption-table td:nth-child(4),
.assumption-table td:nth-child(5) {
  min-width: 190px;
}

.assumption-table .num {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Notes and explanatory cards                                                */
/* -------------------------------------------------------------------------- */

.detail-grid.two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin-bottom: 12px;
}

.note-card {
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.note-card h2 {
  margin: 3px 0 6px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.note-card p {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.note-card p:last-child {
  margin-bottom: 0;
}

.note-card .note-strong {
  color: var(--ink);
  font-weight: 600;
}

.cash-note {
  background: linear-gradient(135deg, #e8f4ef, #f8f5ee);
}

.note-list,
.must-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.note-list li,
.must-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.4;
}

.note-list li::before,
.must-list li::before {
  flex: 0 0 14px;
  width: 14px;
}

.note-list li::before {
  content: "→";
  color: var(--teal);
  font-weight: 700;
}

.must-list li::before {
  content: "✓";
  color: var(--teal);
  font-weight: 700;
}

.must-list strong {
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Responsive detail views                                                    */
/* -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .view-note {
    display: none;
  }

  .detail-grid.two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .viewbar {
    flex: 0 0 auto;
    min-height: 34px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .view-tabs {
    flex: 0 0 auto;
  }

  .detail-view {
    overflow: visible;
    padding-bottom: 8px;
  }

  .detail-head {
    flex-direction: column;
    gap: 10px;
  }

  .detail-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mini-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-scroll {
    max-height: none;
  }

  .table-head {
    align-items: flex-start;
  }

  .table-note {
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .view-tab {
    padding: 5px 8px;
    font-size: 8.5px;
  }

  .detail-head h1 {
    font-size: 25px;
  }

  .mini-kpi-row {
    grid-template-columns: 1fr;
  }

  .mini-kpi strong {
    font-size: 19px;
  }

  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented {
    justify-content: space-between;
  }

  .seg-btn {
    flex: 1;
  }

  .primary-btn {
    width: 100%;
  }
}

/* -------------------------------------------------------------------------- */
/* Click feedback and touch targets                                           */
/* -------------------------------------------------------------------------- */

button,
.view-tab,
.preset,
.seg-btn,
.primary-btn,
.ghost-btn,
.icon-btn {
  touch-action: manipulation;
}

.view-tab {
  min-height: 28px;
}

.preset {
  min-height: 28px;
}

.seg-btn {
  min-height: 28px;
}

.primary-btn {
  min-height: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.24);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .view-tab,
  .preset,
  .seg-btn {
    min-height: 36px;
  }

  .primary-btn {
    min-height: 40px;
  }
}

/* -------------------------------------------------------------------------- */
/* Customer and cost model additions                                          */
/* -------------------------------------------------------------------------- */

.view-tabs {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.customer-chart-card {
  margin-bottom: 12px;
  min-height: 330px;
}

.customer-chart-card .chart-wrap {
  min-height: 250px;
}

.customer-ramp-table {
  min-width: 760px;
}

.customer-scenario-table {
  min-width: 980px;
}

.capacity-table {
  min-width: 560px;
}

.cost-card {
  margin-bottom: 12px;
}

.cost-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  padding-top: 4px;
}

.form-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-section i {
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-input {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.field-input input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.field-input em {
  flex: 0 0 auto;
  margin-left: 5px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.25;
}

.form-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #e9f2ee;
  color: var(--ink-2);
  font-size: 9px;
  line-height: 1.45;
}

.form-note strong {
  color: var(--ink);
}

.challenge-card {
  background: linear-gradient(135deg, #fbede8, #f8f5ee);
}

.challenge-card .must-list li::before {
  color: var(--coral);
}

.customer-scenario-table tr.total-row td {
  background: #e9f2ee;
  color: var(--ink);
  font-weight: 700;
}

.customer-scenario-table tr.total-row .sticky-col {
  background: #e9f2ee;
}

.customer-chart-card .chart-foot {
  padding-top: 4px;
}

@media (max-width: 980px) {
  .cost-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-note {
    display: none;
  }
}

@media (max-width: 620px) {
  .cost-form {
    grid-template-columns: 1fr;
  }

  .customer-chart-card {
    min-height: 300px;
  }

  .customer-chart-card .chart-wrap {
    min-height: 220px;
  }
}

.control-check {
  margin-top: 8px;
  padding: 10px 11px;
  border: 1px solid #f0d1c6;
  border-radius: 11px;
  background: #fbede8;
}

.check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.check-status {
  padding: 2px 6px;
  border-radius: 99px;
  background: #a8462c;
  color: var(--white);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.check-status.ok {
  background: var(--teal);
}

.check-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 5px;
  color: #7a3a26;
  font-size: 9px;
}

.check-line strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.check-vs {
  margin: 0 2px;
  color: #b88b78;
}

.check-bar {
  height: 5px;
  margin: 6px 0 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #f1d8cf;
}

.check-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: var(--coral);
  transition: width 0.25s ease, background 0.25s ease;
}

.check-bar i.ok {
  background: var(--teal);
}

.control-check small {
  display: block;
  color: #7a3a26;
  font-size: 7.8px;
  line-height: 1.3;
}

@media (min-width: 1100px) {
  .cost-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.inline-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
}

.inline-field span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.inline-field input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.inline-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.inline-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

/* Value ladder */
.value-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.value-table td {
  vertical-align: middle;
}

.value-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 500;
  line-height: 1.25;
}

.value-table .table-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.value-table .table-input {
  width: 74px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}

.value-table .table-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.10);
}

.value-table .table-input-wrap span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.retainer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 10px;
  padding: 10px 0 4px;
}

.retainer-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.retainer-field span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.retainer-field small {
  color: var(--muted);
  font-size: 7.3px;
  line-height: 1.25;
}

.retainer-field input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.retainer-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.10);
}

.retainer-math {
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.retainer-math-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9px;
}

.retainer-math-row strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.value-chart-card {
  min-height: 300px;
  margin-bottom: 8px;
}

.value-chart-card .chart-wrap {
  min-height: 210px;
}

.value-chart-card .card-head {
  flex: 0 0 auto;
}

@media (max-width: 1050px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .retainer-form {
    grid-template-columns: 1fr;
  }

  .value-table .table-input {
    width: 58px;
  }
}

.link-btn {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.data-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 500;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .view-tabs {
    max-width: 100%;
    overflow-x: auto;
    flex-shrink: 1;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .viewbar {
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .view-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  .view-tab {
    padding: 5px 7px;
    font-size: 8px;
  }
}

@media (max-width: 700px) {
  .viewbar {
    flex: 0 0 auto;
    height: auto;
    align-items: flex-start;
  }

  .view-tabs {
    height: auto;
  }
}

@media (max-width: 700px) {
  .view-tab {
    padding: 5px 5px;
    font-size: 7.5px;
  }
}

.capacity-calc-table td:nth-child(2) {
  width: 150px;
}

.capacity-calc-table .table-input {
  width: 92px;
}

.capacity-calc-table .calc-explain {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.35;
}

.capacity-calc-table .calc-row td {
  background: rgba(15, 118, 110, 0.035);
}

.capacity-calc-table .calc-row strong {
  color: var(--teal);
}

.capacity-calc-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(135deg, #e8f4ef, #f6f9f6);
}

.calc-result-copy {
  min-width: 0;
}

.calc-result-copy strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.calc-result-copy p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .capacity-calc-result {
    align-items: stretch;
    flex-direction: column;
  }

  .capacity-calc-result .primary-btn {
    width: 100%;
  }

  .capacity-calc-table td:nth-child(2) {
    width: 115px;
  }

  .capacity-calc-table .table-input {
    width: 66px;
  }
}

@media (max-width: 700px) {
  .capacity-calc-table th:nth-child(3),
  .capacity-calc-table td:nth-child(3) {
    display: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Guided tour                                                                */
/* -------------------------------------------------------------------------- */
.tour-launch {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--teal);
}

.tour-launch:hover {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.06);
}

body.tour-open {
  overflow: hidden;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 42, 67, 0.32);
  backdrop-filter: blur(2px);
}

.tour-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  border-left: 1px solid rgba(16, 42, 67, 0.12);
  background: var(--paper);
  box-shadow: -18px 0 50px rgba(16, 42, 67, 0.18);
  animation: tourSlide 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tour-drawer[hidden],
.tour-backdrop[hidden] {
  display: none !important;
}

@keyframes tourSlide {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.tour-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.tour-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.tour-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.tour-head-actions .ghost-btn {
  padding: 5px 8px;
  font-size: 8px;
}

.tour-progress {
  height: 4px;
  margin: 0 20px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line-soft);
}

.tour-progress span {
  display: block;
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.25s ease;
}

.tour-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 20px 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tour-body {
  flex: 1;
  min-height: 0;
  padding: 14px 20px 26px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.tour-step-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}

.tour-section {
  margin-top: 18px;
}

.tour-section h4,
.tour-discuss h4 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.tour-questions {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 0 0 17px;
}

.tour-questions li {
  color: var(--ink);
  font-size: 10.5px;
  line-height: 1.4;
}

.tour-questions li::marker {
  color: var(--teal);
  font-weight: 700;
}

.tour-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.tour-number {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.tour-number span {
  display: block;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tour-number strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.tour-number small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.25;
}

.tour-costs {
  padding: 11px 12px;
  border: 1px solid #e7dfd2;
  border-radius: 10px;
  background: #f7f3eb;
}

.tour-costs h4 {
  margin-bottom: 4px;
}

.tour-cost-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tour-cost-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(16, 42, 67, 0.08);
}

.tour-cost-list li:last-child {
  border-bottom: 0;
}

.tour-cost-list strong {
  display: block;
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
}

.tour-cost-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.25;
}

.tour-cost-list b {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tour-discuss {
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid var(--coral);
  border-radius: 0 9px 9px 0;
  background: #fbede8;
}

.tour-discuss h4 {
  color: #9b4b32;
}

.tour-discuss ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 0 0 14px;
}

.tour-discuss li {
  color: #6f3a2a;
  font-size: 9px;
  line-height: 1.4;
}

.tour-jump-row {
  margin: 14px 0 0;
}

.tour-decision {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tour-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.tour-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
}

.tour-notes-label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tour-decision textarea {
  width: 100%;
  min-height: 92px;
  margin-top: 5px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: 10px/1.45 var(--font-body);
  resize: vertical;
}

.tour-decision textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--teal);
}

.tour-decision-line {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 9px;
  line-height: 1.4;
}

.tour-decision-line strong {
  color: var(--ink);
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.tour-footer .ghost-btn,
.tour-footer .primary-btn {
  min-width: 92px;
}

.tour-footer .primary-btn {
  flex: 1;
}

@media (max-width: 700px) {
  .tour-launch {
    padding: 5px 6px;
    font-size: 7.5px;
  }

  .tour-drawer {
    width: 100vw;
  }

  .tour-head {
    padding: 16px 16px 10px;
  }

  .tour-head h2 {
    font-size: 20px;
  }

  .tour-progress {
    margin: 0 16px;
  }

  .tour-meta {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tour-body {
    padding: 12px 16px 22px;
  }

  .tour-footer {
    padding: 10px 16px;
  }
}

@media (max-width: 620px) {
  .tour-launch {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 620px) {
  .tour-head-actions .ghost-btn,
  .tour-footer .ghost-btn {
    display: inline-flex;
    align-items: center;
  }
}

.capacity-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e7c9a5;
  border-radius: 10px;
  background: #fff5e8;
  color: #6f4a24;
  font-size: 9.5px;
  line-height: 1.4;
}

.capacity-warning[hidden] {
  display: none !important;
}

.capacity-warning strong {
  color: #8a4b12;
}

.capacity-warning .ghost-btn {
  flex: 0 0 auto;
  border-color: #d6ad80;
  color: #7a4a19;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .capacity-warning {
    align-items: flex-start;
    flex-direction: column;
  }
}

.capacity-formula {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #edf4f1;
  color: var(--ink-2);
  font-size: 8.5px;
  line-height: 1.45;
}

.capacity-formula strong {
  color: var(--teal);
}

@media (max-height: 800px) and (min-width: 981px) {
  .control {
    padding: 1px 0;
  }
  .control input[type="range"] {
    margin: 2px 0 1px;
  }
  .control-group {
    margin-bottom: 2px;
  }
  .group-head {
    margin: 2px 0 0;
  }
  .control-insight {
    display: none;
  }
}

.group-note {
  margin: 1px 0 2px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.3;
}

.sales-funnel {
  display: flex;
  align-items: stretch;
  gap: 5px;
  margin: 8px 0 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.funnel-step {
  flex: 1;
  min-width: 96px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #faf7ef;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.funnel-step span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-step strong {
  color: var(--teal);
  font-size: 15px;
  line-height: 1.1;
}

.funnel-step small {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.2;
}

.funnel-result {
  background: #e8f1ed;
  border-color: rgba(0, 91, 84, 0.25);
}

.sales-funnel > i {
  align-self: center;
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

@media (max-width: 700px) {
  .sales-funnel {
    flex-wrap: nowrap;
  }
  .funnel-step {
    min-width: 104px;
  }
}

/* Preset tooltip: visible on hover and keyboard focus */
.preset[data-tooltip] {
  position: relative;
}

.preset[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  left: 50%;
  width: 255px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.22);
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.preset[data-tooltip]::before {
  content: "";
  position: absolute;
  z-index: 61;
  top: calc(100% + 4px);
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--navy);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.preset[data-tooltip]:hover::after,
.preset[data-tooltip]:focus::after,
.preset[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.preset[data-tooltip]:hover::before,
.preset[data-tooltip]:focus::before,
.preset[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.preset[data-tooltip]:last-child::after {
  left: auto;
  right: 0;
  transform: translateY(-3px);
}

.preset[data-tooltip]:last-child:hover::after,
.preset[data-tooltip]:last-child:focus::after,
.preset[data-tooltip]:last-child:focus-visible::after {
  transform: translateY(0);
}

.preset[data-tooltip]:last-child::before {
  left: auto;
  right: 18px;
  transform: rotate(45deg);
}

@media (max-width: 700px) {
  .preset[data-tooltip]::after {
    width: min(255px, 72vw);
    font-size: 8px;
  }
}
