/* ==========================================================================
   UpSynQ — Integrated Business Planning solution page
   Requires foundation.css + home.css (reuses .demo, .scenario, .option,
   .decision__*, .review__*, .proof__value, .ai-line).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1 · Hero + ripple
   -------------------------------------------------------------------------- */
.ibp-hero { padding: clamp(28px, 4.5vw, 64px) 0 clamp(56px, 7vw, 96px); }
.ibp-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.ibp-hero__title { font-size: clamp(2.4rem, 1.3rem + 3.3vw, 4.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; max-width: 13ch; }
.ibp-hero .hero__lede { margin-top: 26px; }

.ripple { margin: 0; }
.ripple__list { list-style: none; margin: 0; padding: 0; position: relative; }
.ripple__list::before { content: ''; position: absolute; left: 7px; top: 14px; bottom: 30px; width: 1.5px; background: var(--ink); }
.ripple__list li { position: relative; padding: 0 0 22px 34px; display: grid; gap: 2px; }
.ripple__list li::before { content: ''; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--ink); }
.ripple__list li.is-end::before { background: var(--terracotta); border-color: var(--terracotta); }
.ripple__k { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.ripple__list b { font-family: var(--font-display); font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); letter-spacing: -0.015em; line-height: 1.25; }
.ripple__list b i { font-style: normal; color: var(--terracotta); padding: 0 .15em; }
.ripple__list li.is-end b { color: var(--terracotta); }
.ripple__v { font-size: .88rem; color: var(--ink-soft); }
.ripple figcaption { margin-top: 4px; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; max-width: 440px; }
.ripple figcaption .illustrative { margin-right: 6px; }
.js .ripple__list li { opacity: 0; transform: translateX(-6px); animation: rippleIn .5s var(--ease) forwards; }
.js .ripple__list li:nth-child(2) { animation-delay: .12s; } .js .ripple__list li:nth-child(3) { animation-delay: .24s; }
.js .ripple__list li:nth-child(4) { animation-delay: .36s; } .js .ripple__list li:nth-child(5) { animation-delay: .48s; }
@keyframes rippleIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .ripple__list li { animation: none; opacity: 1; transform: none; } }

@media (max-width: 960px) { .ibp-hero__grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .ibp-hero .hero__ctas .btn { flex: 1 1 100%; } }

/* --------------------------------------------------------------------------
   2 · Connected decision track
   -------------------------------------------------------------------------- */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); counter-reset: track; }
.track li { counter-increment: track; position: relative; padding: 44px 16px 0 0; }
.track li::before {
  content: counter(track, decimal-leading-zero); position: absolute; top: 0; left: 0; z-index: 1;
  width: 30px; height: 30px; display: grid; place-items: center; background: var(--cream-warm); border: 1.5px solid var(--ink);
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
}
.track li::after { content: ''; position: absolute; top: 15px; left: 30px; right: 0; height: 1.5px; background: var(--ink); }
.track li:last-child::after { display: none; }
.track li.is-end::before { background: var(--terracotta); border-color: var(--terracotta); color: var(--cream); border-radius: 50%; }
.track__step { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 14px; min-height: 2.5em; }
.track dl { margin: 0; display: grid; gap: 12px; }
.track dt { font-family: var(--font-mono); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.track dd { margin: 2px 0 0; font-size: .88rem; line-height: 1.45; color: var(--ink-mid); }
.track dl div:last-child dd { color: var(--ink); font-weight: 600; }

@media (max-width: 1100px) {
  .track { grid-template-columns: 1fr; }
  .track li { padding: 0 0 26px 52px; }
  .track li::after { top: 30px; left: 14.25px; right: auto; bottom: 0; width: 1.5px; height: auto; }
  .track__step { min-height: 0; margin: 4px 0 10px; }
  .track dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 640px) { .track dl { grid-template-columns: 1fr; gap: 8px; } }

/* --------------------------------------------------------------------------
   3 · Workbench
   -------------------------------------------------------------------------- */
.wb__controls { padding: 18px 20px 0; }
.wb__controls .demo__scenarios { padding: 0; }
.wb__note { margin-top: 10px; font-size: .9rem; color: var(--ink-mid); }

.wb-chain { list-style: none; margin: 16px 20px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--rule); background: #fff; }
.wb-chain li { padding: 12px 14px; display: grid; gap: 4px; align-content: start; position: relative; }
.wb-chain li + li { border-left: 1px solid var(--rule); }
.wb-chain li + li::before { content: '→'; position: absolute; left: -9px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--ink-soft); font-size: .8rem; line-height: 1; padding: 2px 0; }
.wb-chain span { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.wb-chain b { font-family: var(--font-mono); font-size: .9rem; line-height: 1.3; }
.wb-chain li.is-changed b { color: var(--terracotta); }
.wb-chain li:last-child { background: var(--ink); color: var(--cream); }
.wb-chain li:last-child span { color: var(--on-ink-soft); }
.wb-chain li:last-child b { color: var(--terracotta-light); }

.wb-tabs { display: flex; gap: 0; margin: 20px 20px 0; border-bottom: 1px solid var(--ink); overflow-x: auto; }
.wb-tabs [role="tab"] {
  flex: 0 0 auto; min-height: 46px; padding: 10px 18px; background: transparent; border: 1px solid transparent; border-bottom: 0;
  font-weight: 600; font-size: .94rem; color: var(--ink-mid); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px;
}
.wb-tabs [role="tab"] em { font-style: normal; }
.wb-tabs [role="tab"] span { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-soft); }
.wb-tabs [role="tab"]:hover { color: var(--ink); }
.wb-tabs [role="tab"][aria-selected="true"] { background: var(--cream); border-color: var(--ink); color: var(--ink); }
.wb-tabs [role="tab"][aria-selected="true"] span { color: var(--terracotta); }
.wb-panel { padding: 22px 20px 24px; }
.wb-panel:focus-visible { outline-offset: -3px; }

.wb-h { font-family: var(--font-body); font-size: .98rem; font-weight: 700; letter-spacing: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.wb-muted { font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
.wb-note { display: block; margin-top: 3px; font-size: .76rem; font-weight: 500; color: var(--ink-soft); }
.wb-foot { margin-top: 12px; font-size: .84rem; color: var(--ink-soft); line-height: 1.5; }
.wb-foot b { color: var(--ink); }
.wb-foot + .wb-h { margin-top: 22px; }

.wb-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; }
.wb-side { display: flex; flex-direction: column; gap: 12px; }
.wb-side .wb-h { margin-top: 6px; }

.wb-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border: 1px solid var(--rule); }
.wb-table th, .wb-table td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.wb-table th[scope="row"], .wb-table thead th:first-child { text-align: left; font-weight: 500; }
.wb-table thead th { font-family: var(--font-mono); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); background: var(--cream); }
.wb-table td { font-family: var(--font-mono); font-size: .86rem; white-space: nowrap; }
.wb-table--source td { white-space: normal; }
.wb-table--demand th .wb-muted { white-space: nowrap; }
.wb-table tfoot th, .wb-table tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; }
.wb-table tr.is-focus th[scope="row"] { box-shadow: inset 3px 0 0 var(--terracotta); }
.wb-table tr.is-out { color: var(--ink-soft); }
.wb-table tr.is-added td { color: var(--terracotta); }
.wb-strong { font-weight: 700; }
.wb-trend { font-size: .72rem; }
.wb-trend.up { color: var(--positive); } .wb-trend.down { color: var(--ink-soft); }
.wb-flag { display: block; margin-top: 3px; font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--terracotta); white-space: normal; }

.wb-seg { display: inline-flex; border: 1px solid var(--ink); }
.wb-seg button { min-height: 32px; min-width: 52px; padding: 4px 10px; border: 0; background: #fff; font-family: var(--font-mono); font-size: .8rem; cursor: pointer; }
.wb-seg button + button { border-left: 1px solid var(--ink); }
.wb-seg button[aria-checked="true"] { background: var(--ink); color: var(--cream); }

.wb-toggle {
  min-height: 44px; padding: 10px 14px; text-align: left; cursor: pointer; font-weight: 600; font-size: .9rem;
  background: #fff; border: 1px dashed var(--ink-soft); color: var(--ink);
}
.wb-toggle[aria-pressed="true"] { border-style: solid; border-color: var(--terracotta); color: var(--terracotta); }
.wb-recon { font-size: .86rem; line-height: 1.5; padding: 12px 14px; border-left: 3px solid var(--positive); background: #fff; }
.wb-recon.is-alert { border-left-color: var(--terracotta); }
.wb-recon b { font-weight: 700; }

.wb-table--calc th[scope="row"] { font-weight: 500; }
.wb-table--calc tr.is-sub th, .wb-table--calc tr.is-sub td { border-top: 1px solid var(--ink-soft); font-weight: 700; }
.wb-table--calc tr.is-total th, .wb-table--calc tr.is-total td { border-top: 1px solid var(--ink); font-weight: 700; background: var(--cream); }
.wb-table--calc td { vertical-align: middle; }
.wb-round { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 14px; background: var(--ink); color: var(--cream); }
.wb-round span { font-size: .88rem; color: var(--on-ink-soft); }
.wb-round b { font-family: var(--font-mono); font-size: 1.05rem; color: var(--terracotta-light); }
.wb-round small { grid-column: 1 / -1; font-size: .8rem; color: var(--on-ink-soft); }
.wb-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wb-flags li { font-size: .86rem; line-height: 1.45; padding-left: 14px; border-left: 2px solid var(--terracotta); color: var(--ink-mid); }
.wb-flags b { color: var(--ink); }
.wb-compare { font-size: .86rem; line-height: 1.5; padding: 12px 14px; background: #fff; border: 1px solid var(--rule); }
.wb-compare.is-changed { border-color: var(--terracotta); }

.wb-plant { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.wb-plant__decision { padding: 20px; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.options--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option__stats--3 { grid-template-columns: repeat(3, 1fr) !important; }

/* Gantt */
.gantt { display: grid; gap: 6px; padding: 14px; background: #fff; border: 1px solid var(--rule); }
.g-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; }
.g-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; color: var(--ink-mid); }
.g-track { position: relative; height: 28px; background: repeating-linear-gradient(90deg, var(--cream-warm) 0 calc(100% / 30 - 1px), #fff calc(100% / 30 - 1px) calc(100% / 30)); }
.g-track--mat { height: 18px; background: none; border-bottom: 1px dashed var(--rule); }
.g-batch, .g-block { position: absolute; top: 3px; bottom: 3px; display: grid; place-items: center; font-family: var(--font-mono); font-size: .66rem; font-weight: 700; transition: left .4s var(--ease), width .4s var(--ease); }
.g-batch { background: var(--ink); color: var(--cream); }
.g-batch--alt { background: var(--terracotta); }
.g-block { background: repeating-linear-gradient(135deg, var(--cream-deep) 0 4px, transparent 4px 8px); color: var(--ink-soft); font-weight: 500; border: 1px solid var(--rule); overflow: hidden; white-space: nowrap; }
.g-lot { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--terracotta); border: 2px solid #fff; }
.g-lot i { position: absolute; left: 12px; top: -4px; font-style: normal; font-family: var(--font-mono); font-size: .64rem; font-weight: 700; color: var(--terracotta); }
.g-late { position: absolute; right: 0; top: 0; font-size: .7rem; font-weight: 600; color: var(--terracotta); }
.g-axis { position: relative; height: 14px; }
.g-axis span { position: absolute; transform: translateX(-50%); font-family: var(--font-mono); font-size: .64rem; color: var(--ink-soft); }
.g-axis span:first-child { transform: none; }
.g-axis span:last-child { transform: translateX(-100%); }

@media (max-width: 1100px) {
  .wb-split, .wb-plant { grid-template-columns: 1fr; }
  .wb-chain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-chain li:nth-child(4) { border-left: 0; }
  .wb-chain li:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .wb-chain li:nth-child(4)::before { display: none; }
}
@media (max-width: 720px) {
  .wb__controls { padding: 14px 14px 0; }
  .wb-chain { margin: 14px 14px 0; grid-template-columns: 1fr 1fr; }
  .wb-chain li:nth-child(n) { border-left: 0; border-top: 0; }
  .wb-chain li + li::before { display: none; }
  .wb-chain li:nth-child(even) { border-left: 1px solid var(--rule); }
  .wb-chain li:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .wb-chain li:last-child { grid-column: 1 / -1; border-left: 0; }
  .wb-tabs { margin: 16px 14px 0; display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .wb-tabs [role="tab"] { padding: 10px 6px; font-size: .9rem; justify-content: center; }
  .wb-tabs [role="tab"] em { display: none; }
  .wb-panel { padding: 18px 14px 20px; }
  .wb-plant__decision { order: -1; }
  .options--grid { grid-template-columns: 1fr; }
  .g-row { grid-template-columns: 1fr; gap: 4px; }

  /* demand table → stacked rows */
  .wb-table--demand thead { display: none; }
  .wb-table--demand, .wb-table--demand tbody, .wb-table--demand tfoot { display: block; }
  .wb-table--demand tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .wb-table--demand th[scope="row"] { grid-column: 1 / -1; border: 0; padding: 4px 10px; }
  .wb-table--demand td { border: 0; text-align: left; padding: 4px 10px; white-space: normal; }
  .wb-table--demand td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
  .wb-table--demand tfoot tr { grid-template-columns: 1fr auto; }
  .wb-table--demand tfoot td:empty { display: none; }
  .wb-table--demand tfoot td::before { content: none; }
}

/* Mobile outcome bar — slim, sticky only within the workbench */
.wb-outcome { display: none; }
@media (max-width: 720px) {
  .wb-outcome {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; bottom: 0; z-index: 5;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--ink); color: var(--cream); border-top: 2px solid var(--terracotta-light);
  }
  .wb-outcome p { font-size: .8rem; line-height: 1.35; min-width: 0; }
  .wb-outcome span { display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terracotta-light); }
  .wb-outcome b { font-weight: 600; }
  .wb-outcome a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 6px 10px; font-size: .78rem; font-weight: 700; color: var(--ink); background: var(--cream); text-decoration: none; }
}
.wb-plant__decision:focus { outline: 2px solid var(--terracotta-light); outline-offset: 3px; }
.wb-bridge { margin-top: 28px; max-width: 760px; font-size: 1.05rem; line-height: 1.65; color: var(--ink-mid); padding-left: 16px; border-left: 3px solid var(--terracotta); }

/* --------------------------------------------------------------------------
   4 · Capabilities
   -------------------------------------------------------------------------- */
.caps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.cap { grid-column: span 2; padding: 24px 24px 28px 0; border-bottom: 1px solid var(--rule); }
.cap:nth-child(4), .cap:nth-child(5) { grid-column: span 3; }
.cap h3 { font-size: 1.12rem; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 10px; }
.cap p { font-size: .93rem; line-height: 1.6; color: var(--ink-mid); max-width: 520px; }
@media (max-width: 960px) { .caps { grid-template-columns: 1fr 1fr; } .cap, .cap:nth-child(4), .cap:nth-child(5) { grid-column: auto; } .cap:nth-child(5) { grid-column: 1 / -1; } }
@media (max-width: 640px) { .caps { grid-template-columns: 1fr; } .cap { padding-right: 0; } }

/* --------------------------------------------------------------------------
   5 · Proof
   -------------------------------------------------------------------------- */
.ibp-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.ibp-proof__item { padding: 24px clamp(18px, 3vw, 36px) 8px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ibp-proof__item:first-child { padding-left: 0; border-left: 0; }
.ibp-proof__item > p:not(.proof__value) { font-size: .95rem; line-height: 1.55; color: var(--ink-mid); }
.ibp-proof .proof__value { margin-top: 4px; }
@media (max-width: 860px) {
  .ibp-proof { grid-template-columns: 1fr; }
  .ibp-proof__item, .ibp-proof__item:first-child { padding: 22px 0; border-left: 0; border-top: 1px solid var(--rule); }
  .ibp-proof__item:first-child { border-top: 0; }
}

/* --------------------------------------------------------------------------
   6 · Configured, not rebuilt (on ink)
   -------------------------------------------------------------------------- */
.config { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: stretch; }
.config__col { padding: 24px; border: 1px solid var(--ink-line); }
.config__col--yours { border-style: dashed; }
.config__label { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; display: grid; gap: 4px; margin-bottom: 16px; }
.config__label small { font-family: var(--font-mono); font-weight: 500; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-ink-soft); }
.config ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.config li { padding: 9px 12px; background: var(--ink-raised); border: 1px solid var(--ink-line); font-size: .9rem; }
.config__col--yours li { background: transparent; }
.config__arrow { position: relative; }
.config__arrow::before { content: ''; position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; background: var(--terracotta-light); }
.config__arrow::after { content: ''; position: absolute; right: 10px; top: calc(50% - 5px); border: 5.5px solid transparent; border-left: 8px solid var(--terracotta-light); border-right: 0; }
@media (max-width: 860px) {
  .config { grid-template-columns: 1fr; }
  .config__arrow { height: 40px; }
  .config__arrow::before { left: 50%; right: auto; top: 6px; bottom: 6px; width: 1.5px; height: auto; }
  .config__arrow::after { right: auto; left: calc(50% - 5px); top: auto; bottom: 4px; border: 5.5px solid transparent; border-top: 8px solid var(--terracotta-light); border-bottom: 0; }
}

/* --------------------------------------------------------------------------
   7 · CTA
   -------------------------------------------------------------------------- */
.ibp-cta { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.ibp-cta h2 { font-size: var(--fs-h2); }
.ibp-cta .lede { margin-top: 18px; }
.ibp-cta__actions { display: grid; gap: 18px; justify-items: start; }
@media (max-width: 860px) { .ibp-cta { grid-template-columns: 1fr; align-items: start; } }
@media (max-width: 480px) { .ibp-cta__actions .btn { width: 100%; } }
