/* ==========================================================================
   Custom Software page only (custom-software.html, _build/software_page.py,
   behaviour in assets/software.js). Loaded after signals.css, paid.css,
   organic.css and reactivate.css, which supply the hero card, icon tabs,
   panels, marquee, pill toggle, citation cards, stops and stage card. Same
   outbound-style vocabulary throughout.
   ========================================================================== */

#builds { padding-bottom: clamp(36px, 4.5vw, 60px); }

/* ---- shared bits of the drawn screens ------------------------------------ */
.cs-u { max-width: 384px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 14px 34px -14px rgba(0, 0, 0, .24); overflow: hidden; }
.cs-chrome { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #ececec; background: #f6f6f4; }
.cs-chrome span { display: flex; gap: 5px; }
.cs-chrome span i { width: 8px; height: 8px; border-radius: 50%; background: #d6d6d2; }
.cs-chrome b { flex: 1; padding: 3px 10px; border-radius: 100px; background: #fff; font-size: 10.5px; font-weight: 400; color: #70757a; text-align: center; }
/* the brand's monogram, as on the other pages */
.cs-dash aside > i, .cs-portal__top i, .cs-app aside > i {
  display: grid; place-items: center; flex: none; border-radius: 7px; color: #fff; font-weight: 700; font-style: normal;
  background: conic-gradient(from 200deg, #E2520F, #F2C230, #7FB8F0, #2F5BD3, #E2520F);
}
.cs-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.cs-filters span { padding: 3px 9px; border-radius: 100px; border: 1px solid #e3e3e0; font-size: 10.5px; color: #555; }
.cs-filters span.is-on { border-color: #202124; background: #202124; color: #fff; }
.cs-chip { display: inline-block; padding: 2px 8px; border-radius: 100px; font-style: normal; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.cs-chip--ok, .cs-chip--paid { background: #e6f2ea; color: #1d6b3c; }
.cs-chip--low, .cs-chip--quote { background: #fdf1d6; color: #8a5a00; }
.cs-chip--out { background: #fde4da; color: #B4400A; }
.cs-chip--ship { background: #e6edfb; color: #2F5BD3; }
.cs-chip--conf { background: #efeff0; color: #444; }

/* dashboard */
.cs-dash { display: grid; grid-template-columns: 92px 1fr; min-height: 300px; }
.cs-dash aside { padding: 12px 10px; border-right: 1px solid #efefef; background: #fafaf8; }
.cs-dash aside > i { width: 24px; height: 24px; margin-bottom: 12px; font-size: 12px; }
.cs-dash ul, .cs-app ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cs-dash li, .cs-app li { padding: 5px 8px; border-radius: 6px; font-size: 11.5px; color: #5f6368; }
.cs-dash li.is-on, .cs-app li.is-on { background: rgba(226, 82, 15, .1); color: #202124; font-weight: 700; }
.cs-dash__main { padding: 12px 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.cs-dash__h { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.cs-dash__h b { font-size: 15px; }
.cs-dash__h small, .cs-dash__chart small { font-size: 10.5px; color: #70757a; }
.cs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cs-kpis span { display: grid; gap: 1px; padding: 8px; border-radius: 8px; border: 1px solid #efefef; }
.cs-kpis small { font-size: 9.5px; color: #70757a; line-height: 1.2; }
.cs-kpis b { font-size: 19px; line-height: 1.2; }
.cs-kpis em { font-style: normal; font-size: 10px; font-weight: 700; }
.cs-up { color: #1d6b3c; }
.cs-warn { color: #B4400A; }
.cs-dash__chart { padding: 8px 10px 4px; border-radius: 8px; border: 1px solid #efefef; }
.cs-dash__chart p { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 11.5px; }
.cs-spark { display: block; width: 100%; height: 64px; }
.cs-spark__a { fill: rgba(226, 82, 15, .12); }
.cs-spark__l { fill: none; stroke: #E2520F; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cs-dash__act { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; color: #444; }
.cs-dash__act i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #8C95A0; color: #fff; font-size: 10px; font-weight: 700; font-style: normal; }
.cs-dash__act small { margin-left: auto; color: #8a8f94; }

/* inventory */
.cs-stock { padding: 12px 14px 10px; display: grid; gap: 9px; }
.cs-stock__bar { display: flex; gap: 8px; }
.cs-search { flex: 1; padding: 7px 12px; border-radius: 8px; border: 1px solid #e3e3e0; font-size: 11.5px; color: #8a8f94; }
.cs-stock__bar button { padding: 7px 12px; border: 0; border-radius: 8px; background: #202124; color: #fff; font: inherit; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.cs-stock table, .cs-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.cs-stock th, .cs-tbl th { padding: 6px 4px; border-bottom: 1px solid #ececec; font-size: 10px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: #8a8f94; text-align: left; }
.cs-stock td { padding: 7px 4px; border-bottom: 1px solid #f3f3f1; vertical-align: middle; }
.cs-stock td:first-child { display: flex; align-items: center; gap: 9px; }
.cs-stock td span { display: grid; }
.cs-stock td small { font-size: 10px; color: #8a8f94; }
.cs-thumb { width: 30px; height: 30px; flex: none; border-radius: 6px; }
.cs-thumb--0 { background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .6), transparent 55%), linear-gradient(135deg, #E2520F, #F2C230); }
.cs-thumb--1 { background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .5), transparent 55%), linear-gradient(135deg, #2F5BD3, #7FB8F0); }
.cs-thumb--2 { background: radial-gradient(circle at 40% 60%, rgba(255, 255, 255, .5), transparent 55%), linear-gradient(135deg, #8C95A0, #d6d6d2); }
.cs-thumb--3 { background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, .55), transparent 55%), linear-gradient(135deg, #F2C230, #7FB8F0); }
.cs-stock__foot { margin: 0; font-size: 10.5px; color: #8a8f94; }

/* client portal on a phone */
.cs-u--portal { max-width: none; background: none; box-shadow: none; overflow: visible; display: grid; place-items: center; }
.cs-phone {
  position: relative; width: 218px; height: 404px; padding: 30px 14px 14px; box-sizing: border-box; border-radius: 34px; border: 7px solid #1d1d1f;
  background: #f7f6f2; box-shadow: 0 18px 38px -16px rgba(0, 0, 0, .4); display: grid; align-content: start; gap: 9px; overflow: hidden;
}
.cs-phone__notch { position: absolute; top: 7px; left: 50%; width: 64px; height: 16px; border-radius: 100px; background: #1d1d1f; transform: translateX(-50%); }
.cs-portal__top { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; margin: 0; }
.cs-portal__top i { grid-row: 1 / 3; width: 24px; height: 24px; font-size: 11px; }
.cs-portal__top b { font-size: 12px; line-height: 1.1; }
.cs-portal__top small { font-size: 9.5px; color: #70757a; }
.cs-portal__hi { margin: 2px 0 0; font-family: var(--font-display); font-size: 21px; line-height: 1.1; letter-spacing: -.02em; }
.cs-portal__card { padding: 10px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }
.cs-portal__card p { display: grid; margin: 0 0 8px; }
.cs-portal__card small { font-size: 9.5px; color: #70757a; }
.cs-portal__card b { font-size: 12.5px; }
.cs-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.cs-steps li { position: relative; display: grid; justify-items: center; gap: 4px; font-size: 9px; color: #8a8f94; }
.cs-steps li i { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d6d6d2; background: #fff; }
.cs-steps li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: #d6d6d2; }
.cs-steps li:first-child::before { display: none; }
.cs-steps li.is-done { color: #202124; }
.cs-steps li.is-done i { border-color: #E2520F; background: #E2520F; }
.cs-steps li.is-done::before { background: #E2520F; }
.cs-portal__k { margin: 2px 0 0; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #70757a; }
.cs-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.cs-docs li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: #fff; }
.cs-docs i { display: grid; place-items: center; width: 24px; height: 28px; border-radius: 4px; background: #fde4da; color: #B4400A; font-size: 7.5px; font-weight: 700; font-style: normal; }
.cs-docs span { display: grid; }
.cs-docs b { font-size: 11px; }
.cs-docs small { font-size: 9px; color: #8a8f94; }
.cs-portal__btn { margin-top: 2px; padding: 9px; border-radius: 100px; background: #202124; color: #fff; font-size: 10.5px; font-weight: 700; text-align: center; }

/* booking calendar */
.cs-book { padding: 12px 14px; display: grid; gap: 10px; }
.cs-cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cs-cal > div { display: grid; gap: 5px; }
.cs-cal b { font-size: 10px; font-weight: 400; color: #8a8f94; text-align: center; }
.cs-slot { height: 30px; border-radius: 6px; border: 1px dashed #d6d6d2; }
.cs-slot--taken { border: 0; background: #ececea; }
.cs-slot--new { border: 0; background: linear-gradient(135deg, #E2520F, #F2C230); box-shadow: 0 0 0 3px rgba(226, 82, 15, .2); }
.cs-book__new { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; background: rgba(226, 82, 15, .07); }
.cs-book__new i { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: #8C95A0; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; }
.cs-book__new span { display: grid; }
.cs-book__new b { font-size: 12px; }
.cs-book__new small { font-size: 10px; color: #70757a; }

/* ---- from spreadsheet to system ---------------------------------------------- */
.cs-flip { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cs-flip__left { display: grid; gap: 14px; min-width: 0; }
.cs-seg { justify-self: start; }
.cs-win { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; color: #202124; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .2); overflow: hidden; }
.cs-flip[data-state="before"] .cs-view--after, .cs-flip[data-state="after"] .cs-view--before { display: none; }
.cs-flip[data-state="before"] .og-cite [data-view="after"], .cs-flip[data-state="after"] .og-cite [data-view="before"] { display: none; }
.sg-js .cs-view { animation: sg-fade 380ms var(--ease); }
html:not(.sg-js) .cs-view { display: block !important; }
html:not(.sg-js) .cs-view + .cs-view { border-top: 1px solid #ddd; }
html:not(.sg-js) .og-cite [data-view] { display: block !important; }
html:not(.sg-js) .cs-seg { display: none; }

/* the spreadsheet */
.cs-xl__bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #1f6e43; color: #fff; }
.cs-xl__bar > i { width: 16px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, .85); }
.cs-xl__bar b { font-size: 12.5px; font-weight: 700; }
.cs-xl__bar small { margin-left: auto; font-size: 11px; opacity: .8; white-space: nowrap; }
.cs-xl__fx { display: flex; gap: 10px; margin: 0; padding: 6px 12px; border-bottom: 1px solid #e2e2e2; font-size: 12px; color: #444; }
.cs-xl__fx span { min-width: 34px; padding-right: 10px; border-right: 1px solid #e2e2e2; color: #777; }
.cs-xl__fx code { font-family: Consolas, Menlo, monospace; font-size: 12px; }
.cs-xl__scroll { overflow-x: auto; }
.cs-xl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cs-xl th { padding: 3px 6px; border: 1px solid #e2e2e2; background: #f3f3f3; font-weight: 400; font-size: 11px; color: #777; }
.cs-xl tbody th, .cs-xl__h th { width: 24px; }
.cs-xl td { padding: 6px 8px; border: 1px solid #e8e8e8; white-space: nowrap; }
.cs-xl td:nth-child(6) { text-align: right; }
.cs-xl td:nth-child(7) { color: #888; font-style: italic; }
.cs-xl__h td { font-weight: 700; background: #fafafa; }
.cs-sheet__total td { background: #fafafa; }
.cs-xl__tabs { padding: 6px 8px 0; border-top: 1px solid #e2e2e2; background: #f3f3f3; }
.cs-xl__tabs > span { display: flex; flex-wrap: wrap; gap: 2px; }
.cs-xl__tabs span span { padding: 5px 10px; border-radius: 4px 4px 0 0; font-size: 11px; color: #555; }
.cs-xl__tabs span span.is-on { background: #fff; color: #1f6e43; font-weight: 700; }

/* the system */
.cs-app { display: grid; grid-template-columns: 116px 1fr; min-height: 330px; }
.cs-app aside { display: flex; flex-direction: column; padding: 12px 10px; border-right: 1px solid #efefef; background: #fafaf8; }
.cs-app aside > i { width: 26px; height: 26px; margin-bottom: 12px; font-size: 12px; }
.cs-app__who { margin: auto 0 0; }
.cs-app__who .cs-hl { display: grid; padding: 6px 8px; }
.cs-app__who b { font-size: 12px; }
.cs-app__who small { font-size: 10px; color: #70757a; }
.cs-app__main { padding: 12px 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.cs-app__h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-app__h > b { font-size: 16px; }
.cs-tbl td { padding: 7px 4px; border-bottom: 1px solid #f3f3f1; white-space: nowrap; }
.cs-tbl .cs-num { text-align: right; }
.cs-mono { font-family: Consolas, Menlo, monospace; color: #70757a; }
.cs-badge { margin-left: 6px; padding: 1px 6px; border-radius: 100px; background: #eef1fb; color: #2F5BD3; font-style: normal; font-size: 10px; font-weight: 700; }
.cs-app__foot { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.cs-app__foot p { display: grid; gap: 1px; margin: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid #efefef; font-size: 11.5px; }
.cs-app__foot small { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: #8a8f94; }
.cs-app__foot b { font-size: 12.5px; }
.cs-app__foot p:first-child b { font-size: 18px; }
.cs-app__foot em { font-style: normal; font-size: 10.5px; color: #8a8f94; }

/* the highlights, in both views; the cards' hover lights them up */
.cs-hl {
  border-radius: 3px; background: rgba(226, 82, 15, .07); box-shadow: inset 0 -2px 0 rgba(226, 82, 15, .35);
  outline: none; cursor: help; transition: background var(--fast), box-shadow var(--fast);
}
p.cs-hl { box-shadow: inset 0 0 0 1px rgba(226, 82, 15, .3); }
.cs-hl.is-hot { background: rgba(226, 82, 15, .2); box-shadow: inset 0 -2px 0 #E2520F; }
p.cs-hl.is-hot { box-shadow: inset 0 0 0 1.5px #E2520F; }
.cs-flip.is-focused .cs-hl:not(.is-hot) { background: transparent; box-shadow: none; }
.cs-flip.is-focused .og-cite:not(.is-hot) { opacity: .45; }
.cs-flip .og-cite p { margin-top: 4px; }

/* ---- the branch map, as a staircase of build lanes ----------------------------
   The Blueprint is every bar dashed; the live layer is the same bars in the
   ember, sunflower, light blue gradient, clipped to how far the build has got.
   Faint weekly columns and a "now" line make the position easy to read. */
.cs-map { --climb-bg: var(--ink); --climb-ink: var(--text); --climb-dim: var(--text-3); --climb-line: var(--line-2); position: relative; }
.cs-map__fig { position: relative; width: 100%; }
.cs-map__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; font-family: var(--font-mono); }
.cs-grid path { stroke: var(--line); stroke-width: 1; }
.cs-plan .cs-trunk { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: .7; }
.cs-plan .cs-bar, .cs-legend .cs-plan { fill: rgba(var(--ov), .03); stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 4 4; }
.cs-plan .cs-drop { stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: .7; }
.cs-live .cs-trunk { fill: none; stroke: url(#csLine); stroke-width: 6; stroke-linecap: round; }
/* a built bar's own stroke covers the dashed outline of the plan beneath it */
.cs-live .cs-bar, .cs-bar--key { fill: url(#csLine); stroke: url(#csLine); stroke-width: 2.5; }
.cs-live .cs-drop { stroke: url(#csLine); stroke-width: 2.5; }
.cs-live .cs-bar--data, .cs-bar--data.cs-bar--key { fill: rgba(47, 91, 211, .16); stroke: var(--cobalt); stroke-width: 1.4; stroke-dasharray: 2 3; }
.cs-live .cs-drop--data { stroke: var(--cobalt); stroke-dasharray: 2 4; }
.cs-bar--key { fill: #EE8A22; }
.cs-merge { fill: var(--text); stroke: var(--ink); stroke-width: 2; }
/* a halo in the page colour keeps the weekly columns from cutting through the labels */
.cs-lab { fill: var(--text-3); font-size: 11.5px; letter-spacing: .1em; stroke: var(--ink); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; transition: fill var(--mid); }
.cs-lab.is-live { fill: var(--text); }
.cs-lab--data, .cs-lab--data.is-live { fill: var(--cobalt); }
.cs-map__axis path { fill: none; stroke: var(--text-3); stroke-width: 1; }
.cs-map__axis text, .cs-legend text { fill: var(--text-3); font-size: 11px; letter-spacing: .08em; }
.cs-end circle:first-child { fill: var(--ink); stroke: var(--text-3); stroke-width: 1.5; }
.cs-end circle + circle { fill: var(--text-3); }
.cs-end text { fill: var(--text-3); font-size: 11px; letter-spacing: .1em; }
.cs-map.is-done .cs-end circle:first-child { stroke: #7FB8F0; stroke-width: 3; }
.cs-map.is-done .cs-end circle + circle { fill: #7FB8F0; }
.cs-map.is-done .cs-end text { fill: var(--text); }
.cs-map__hit { fill: transparent; cursor: ew-resize; touch-action: pan-y; }
.cs-marker { pointer-events: none; }
.cs-marker__now { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 3 4; }
.cs-marker__t { fill: var(--orange); font-size: 10.5px; letter-spacing: .14em; }
.cs-marker__ring { fill: none; stroke: var(--orange); stroke-width: 1.5; opacity: .6; }
.cs-marker__pulse { fill: rgba(226, 82, 15, .14); transform-box: fill-box; transform-origin: center; animation: cs-pulse 2.2s var(--ease) infinite; }
@keyframes cs-pulse { 50% { transform: scale(1.35); opacity: .4; } }
.cs-map .og-stop circle { fill: var(--ink); }
.cs-map .og-stop.is-on circle { fill: var(--orange); }
.cs-card { min-height: 0; }
.cs-map.is-ready:not(.is-drawn) .og-stop, .cs-map.is-ready:not(.is-drawn) .cs-card, .cs-map.is-ready:not(.is-drawn) .cs-marker { opacity: 0; }
.cs-map .og-stop, .cs-card, .cs-marker { transition: opacity .6s var(--ease); }
html:not(.sg-js) .cs-marker { display: none; }

/* ---- small screens -------------------------------------------------------- */
@media (max-width: 900px) {
  .cs-flip { grid-template-columns: 1fr; }
  .cs-card { position: static; width: auto !important; min-height: 0 !important; margin-top: 16px; }
  /* the card has moved under the map, so its empty headroom is cropped off the top */
  .cs-map .pd-ridge__scroll { overflow-x: auto; overflow-y: hidden; }
  .cs-map__fig { margin-top: calc(var(--crop) * -100%); }
}
@media (max-width: 640px) {
  .cs-map__fig { width: 720px; margin-top: calc(var(--crop) * -720px); }
  .cs-tbl th:nth-child(3), .cs-tbl td:nth-child(3) { display: none; }
  /* the sheet drops Date and Notes, so the #REF! total stays on screen */
  .cs-xl tr > :nth-child(4), .cs-xl tr > :nth-child(7) { display: none; }
  .cs-xl { font-size: 11.5px; }
  .cs-xl td { padding: 6px 5px; }
  .cs-app__h .cs-filters span:last-child { display: none; }
  .cs-app { grid-template-columns: 1fr; }
  .cs-app aside { display: none; }
  .cs-app__foot { grid-template-columns: 1fr; }
  .cs-xl__bar small { display: none; }
  .cs-dash { grid-template-columns: 1fr; }
  .cs-dash aside { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-marker__pulse { animation: none; }
  .sg-js .cs-view { animation: none; }
}
