/* CSOL Tech demo: owner's dashboard + customer portal.
   Same chassis as the site: white / parchment bands, one blue for actions,
   pill buttons, 17px body. Charts: grey structure, color only for data. */

@font-face {
  font-family: "Inter";
  src: url("../../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --raised: #ffffff;
  --well: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --hair: rgba(0, 0, 0, 0.1);
  --hair-soft: rgba(0, 0, 0, 0.06);
  --grid: rgba(0, 0, 0, 0.08);
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --btn: #0071e3;
  --btn-hover: #0077ed;
  --on-btn: #ffffff;

  --data: #0066cc;
  --data-soft: rgba(0, 102, 204, 0.1);
  --data-mid: rgba(0, 102, 204, 0.28);
  --data2: #5856d6;
  --warn: #b84f00;
  --warn-fill: #ff9500;
  --warn-soft: rgba(255, 149, 0, 0.14);
  --ok: #1f7a35;
  --ok-soft: rgba(52, 199, 89, 0.15);

  --brand: #a3245a;
  --brand-hover: #8f1d4d;
  --brand-ink: #a3245a;
  --brand-soft: rgba(163, 36, 90, 0.08);

  --bar-bg: rgba(255, 255, 255, 0.78);
  --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.02), 0 6px 24px rgba(0, 0, 0, 0.05);
  --job-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --lift-shadow: 0 18px 40px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  --radius-card: 18px;
  --radius-field: 12px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #101011;
    --card: #1c1c1e;
    --raised: #2c2c2e;
    --well: #141416;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --hair: rgba(255, 255, 255, 0.14);
    --hair-soft: rgba(255, 255, 255, 0.08);
    --grid: rgba(255, 255, 255, 0.1);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --data: #2997ff;
    --data-soft: rgba(41, 151, 255, 0.14);
    --data-mid: rgba(41, 151, 255, 0.36);
    --data2: #8e8cff;
    --warn: #ffab40;
    --warn-fill: #ff9f0a;
    --warn-soft: rgba(255, 159, 10, 0.16);
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, 0.16);
    --brand: #b8306c;
    --brand-hover: #c93a7a;
    --brand-ink: #ff7eb0;
    --brand-soft: rgba(255, 126, 176, 0.1);
    --bar-bg: rgba(22, 22, 23, 0.78);
    --card-shadow: none;
    --job-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --lift-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
a, button, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 9999px;
  font: inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--btn); color: var(--on-btn); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-lg { min-height: 48px; padding: 12px 26px; font-size: 17px; }

/* ---------- top bar ---------- */
.topbar { height: 56px; border-bottom: 1px solid var(--hair-soft); }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 14px; }
.brand {
  font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  text-decoration: none;
}
.brand span { margin-left: 4px; font-weight: 400; color: var(--muted); }
.demo-pill {
  font-size: 13px; line-height: 1; padding: 6px 10px; border-radius: 9999px;
  background: var(--bg-alt); color: var(--muted); white-space: nowrap;
}
.back { margin-left: auto; padding: 8px 2px; font-size: 14px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- intro ---------- */
.intro { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(32px, 5vw, 56px); text-align: center; }
.eyebrow { font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.intro h1 {
  font-size: clamp(40px, 6.4vw, 72px); line-height: 1.05; letter-spacing: -0.035em;
}
.intro h1 span { display: block; color: var(--muted); }
.lede {
  max-width: 640px; margin: 22px auto 0;
  font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--muted);
}

/* ---------- controls ---------- */
.controls {
  position: sticky; top: 0; z-index: 40;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hair-soft);
}
.controls-inner { min-height: 64px; display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.seg {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border-radius: 9999px; background: var(--hair-soft);
}
.seg-btn {
  position: relative; z-index: 1; min-width: 116px; min-height: 36px; padding: 6px 18px;
  border: 0; border-radius: 9999px; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color 0.25s var(--ease), transform 0.15s var(--ease);
}
.seg-btn:active { transform: scale(0.97); }
.seg-btn[aria-pressed="true"] { color: var(--ink); }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 9999px; background: var(--raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s var(--ease);
}
.seg[data-active="customer"] .seg-thumb { transform: translateX(100%); }
.seg-dot {
  position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--data); box-shadow: 0 0 0 2px var(--raised);
}
.clock-group { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock {
  display: flex; align-items: baseline; gap: 6px; margin-right: 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock-day { font-size: 15px; color: var(--muted); }
.clock-time { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; min-width: 5.2em; display: inline-block; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: var(--btn); color: var(--on-btn); cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--btn-hover); }
.icon-btn:active, .ctl-btn:active, .chip:active, .ask-go:active, .text-btn:active { transform: scale(0.97); }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn .ic[data-icon="play"] { fill: currentColor; stroke: none; }
.ctl-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--hair); border-radius: 9999px; background: var(--card); cursor: pointer;
  font-size: 15px; color: var(--ink);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.ctl-btn:hover { border-color: var(--muted); }
.ctl-btn .ic { width: 18px; height: 18px; color: var(--muted); }
.dayline { height: 2px; background: var(--hair-soft); }
.dayline span { display: block; height: 100%; width: 0; background: var(--data); transform-origin: left; }

/* ---------- stage + views ---------- */
.stage { background: var(--bg-alt); padding: clamp(20px, 3vw, 40px) 0 clamp(48px, 6vw, 80px); }
.view { display: grid; gap: 16px; }
.view.is-entering { animation: viewIn 0.5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-note { font-size: 15px; color: var(--muted); text-align: center; margin: 4px 0 4px; }

.card {
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  padding: clamp(18px, 2.2vw, 28px);
  transition: box-shadow 0.4s var(--ease), opacity 0.4s var(--ease);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card-meta { font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* focus rings driven by "Ask your data" */
.is-match-card { box-shadow: var(--card-shadow), 0 0 0 2px var(--data); }

/* ---------- ask ---------- */
.ask { padding: clamp(14px, 1.8vw, 20px); }
.ask-form {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--hair); border-radius: var(--radius-field); background: var(--card);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ask-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--data-soft); }
.ask-ic { color: var(--muted); }
.ask-form input {
  flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; color: var(--ink);
}
.ask-form input::placeholder { color: var(--muted); }
.ask-form input:focus-visible { outline: none; }
.ask-go {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: var(--btn); color: var(--on-btn); cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.ask-go:hover { background: var(--btn-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  min-height: 36px; padding: 7px 14px; border: 1px solid var(--hair); border-radius: 9999px;
  background: transparent; cursor: pointer; font-size: 14px; color: var(--ink);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s, transform 0.15s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-current="true"] { background: var(--data-soft); border-color: transparent; color: var(--accent); }

.answer { margin-top: 16px; padding: 18px 4px 4px; border-top: 1px solid var(--hair-soft); }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.answer-q { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.answer-text { font-size: 19px; line-height: 1.45; letter-spacing: -0.015em; max-width: 68ch; min-height: 1.45em; }
.answer-text .caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em;
  background: var(--data); animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.answer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 14px; }
.answer-list:empty { display: none; }
.answer-list li {
  padding: 10px 14px; border-radius: var(--radius-field); background: var(--well);
  animation: itemIn 0.45s var(--ease) both;
}
.answer-list li b { display: block; font-size: 15px; font-weight: 600; }
.answer-list li span { display: block; font-size: 13px; color: var(--muted); }
.answer-list li.tone-warn span { color: var(--warn); }
.answer-list li.tone-ok span { color: var(--ok); }
@keyframes itemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.text-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 8px; margin: -4px -8px;
  border: 0; background: transparent; cursor: pointer; border-radius: 9999px;
  font-size: 14px; color: var(--accent);
  transition: transform 0.15s var(--ease), background-color 0.2s;
}
.text-btn:hover { background: var(--data-soft); }
.text-btn .ic { width: 16px; height: 16px; }
.answer-show { margin-top: 14px; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px 22px; }
.kpi-label { font-size: 14px; color: var(--muted); }
.kpi-value { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.kpi-num {
  font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 40px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums;
  transition: color 0.6s var(--ease);
}
.kpi-num.is-bump { color: var(--data); transition-duration: 0.1s; }
.kpi[data-kpi="overdue"] .kpi-num.is-bump { color: var(--ok); }
.kpi-of { font-size: 17px; color: var(--muted); }
.kpi-sub { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 1.4em; }

/* ---------- jobs board ---------- */
.board-card { padding-bottom: clamp(14px, 1.8vw, 20px); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.col { min-width: 0; border-radius: 14px; background: var(--well); padding: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.col-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.col[data-col="progress"] .col-head h3::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: var(--data); vertical-align: 2px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.col-count {
  min-width: 26px; height: 22px; padding: 0 8px; border-radius: 9999px; display: grid; place-items: center;
  background: var(--card); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.col-list {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  height: 452px; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -4px; padding: 2px 4px 8px;
  scrollbar-width: thin; scrollbar-color: var(--hair) transparent;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 22px), transparent);
}
.job {
  position: relative; flex: none;
  padding: 12px 14px; border-radius: 12px; background: var(--raised); box-shadow: var(--job-shadow);
  transition: opacity 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.job-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.job-who { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-amt { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.job-what { font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 22px; }
.job-meta:empty { display: none; }
.job-bar { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--hair-soft); overflow: hidden; }
.job-bar[hidden] { display: none; }
.job-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--data); transition: width 0.3s linear; }
.job.is-late .job-bar i { background: var(--warn-fill); }
.job[data-col="done"] { padding-top: 10px; padding-bottom: 10px; }
.job[data-col="done"] .job-who { font-weight: 500; }
.job.is-arrived { animation: arrive 1.4s var(--ease); }
@keyframes arrive { 0% { box-shadow: var(--job-shadow), 0 0 0 2px var(--data); } 100% { box-shadow: var(--job-shadow), 0 0 0 2px transparent; } }
.job.is-flash { animation: flash 2.4s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: var(--job-shadow), 0 0 0 3px var(--data); } 100% { box-shadow: var(--job-shadow), 0 0 0 3px transparent; } }
.job-ghost {
  list-style: none;
  position: fixed; z-index: 60; margin: 0; pointer-events: none;
  box-shadow: var(--lift-shadow);
}
.avatar {
  width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--bg-alt); color: var(--ink); font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px var(--hair-soft);
}
.job .avatar { width: 22px; height: 22px; }
.who-line { display: inline-flex; align-items: center; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 9999px;
  font-size: 13px; line-height: 1; white-space: nowrap; background: var(--hair-soft); color: var(--muted);
}
.tag .ic { width: 13px; height: 13px; stroke-width: 2; }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-data { background: var(--data-soft); color: var(--accent); }
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* dimming when an answer is in focus */
.is-focusing .job:not(.is-match),
.is-focusing .inv-row:not(.is-match),
.is-focusing .sched-row:not(.is-match) { opacity: 0.32; }
.is-focusing .job.is-match { box-shadow: var(--job-shadow), 0 0 0 2px var(--data); }
.is-focusing .inv-row.is-match { background: var(--data-soft); }
.is-focusing .blk.is-match .seg-run, .is-focusing .blk.is-match .seg-plan { box-shadow: 0 0 0 2px var(--data); }

/* ---------- charts ---------- */
.chart-card { display: flex; flex-direction: column; }
.chart { position: relative; width: 100%; height: 280px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font-family: var(--font); font-size: 13px; fill: var(--muted); letter-spacing: 0; }
.chart .t-ink { fill: var(--ink); font-weight: 600; }
.chart .t-big { font-size: 17px; }
.chart .t-data { fill: var(--data); font-weight: 600; }
.chart .t-data2 { fill: var(--data2); font-weight: 600; }
.chart .t-warn { fill: var(--warn); font-weight: 600; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--hair); stroke-width: 1; shape-rendering: crispEdges; }
.chart .line { fill: none; stroke: var(--data); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#cashFill); }
.chart .stop-a { stop-color: var(--data); stop-opacity: 0.22; }
.chart .stop-b { stop-color: var(--data); stop-opacity: 0; }
.chart .dot { fill: var(--card); stroke: var(--data); stroke-width: 2; }
.chart .dot-end { fill: var(--data); }
.chart .halo { fill: var(--data); opacity: 0.18; }
.chart .bar { fill: var(--data); }
.chart .bar-live { fill: var(--data); }
.chart .bar-empty { fill: var(--hair-soft); }
.chart .tick2 { stroke: var(--data2); stroke-width: 3; stroke-linecap: round; }
.chart .tick2-in { animation: tickIn 0.6s var(--ease) both; }
@keyframes tickIn { from { opacity: 0; } to { opacity: 1; } }
.chart .mark-portal { stroke: var(--data); stroke-width: 1; stroke-dasharray: 3 3; }

/* ---------- crew schedule strip ---------- */
.sched { --name-w: 210px; position: relative; }
.sched-hours { position: relative; height: 22px; margin-left: var(--name-w); }
.sched-hours span {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sched-hours span:first-child { transform: none; }
.sched-hours span:last-child { transform: translateX(-100%); }
.sched-rows { position: relative; }
.sched-row {
  display: grid; grid-template-columns: var(--name-w) 1fr; align-items: center;
  min-height: 64px; border-top: 1px solid var(--hair-soft);
  transition: opacity 0.35s var(--ease);
}
.sched-who { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 16px; }
.sched-who .avatar { width: 32px; height: 32px; font-size: 12px; }
.sched-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.sched-status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-status.is-on { color: var(--accent); }
.sched-status.is-late { color: var(--warn); }
.track { position: relative; height: 40px; }
.track::before { /* hour grid */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: calc(100% / 11) 100%;
  opacity: 0.8;
}
.blk { position: absolute; top: 5px; bottom: 5px; left: 0; right: 0; pointer-events: none; }
.blk > i { position: absolute; top: 0; bottom: 0; border-radius: 8px; }
.seg-plan { box-shadow: inset 0 0 0 1.5px var(--data-mid); }
.seg-run { background: var(--data-mid); }
.blk.is-on .seg-run {
  background-color: var(--data-mid);
  background-image: repeating-linear-gradient(-45deg, transparent 0 6px, var(--data-soft) 6px 12px);
  background-size: 34px 34px;
  animation: stripes 1.2s linear infinite;
}
.blk.is-on:not(.is-over) .seg-run { box-shadow: inset -3px 0 0 var(--data); }
@keyframes stripes { to { background-position: 34px 0; } }
.blk.is-done .seg-run { background: var(--data-soft); }
.seg-over { background: var(--warn-soft); box-shadow: inset 0 0 0 1.5px var(--warn-fill); }
.blk.is-on .seg-over { box-shadow: inset 0 0 0 1.5px var(--warn-fill), inset -3px 0 0 var(--warn-fill); }
.blk-label {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-style: normal; line-height: 1.2; white-space: nowrap; overflow: hidden;
  color: var(--ink); pointer-events: none;
}
.blk.is-done .blk-label { color: var(--muted); }
.track .now {
  position: absolute; top: -6px; bottom: -6px; width: 0; z-index: 3;
  border-left: 1.5px solid var(--ink); pointer-events: none;
}
.track .now::before {
  content: ""; position: absolute; top: -3px; left: -4.25px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink);
}

/* ---------- invoices + feed ---------- */
.list-card { min-width: 0; }
.inv { display: flex; flex-direction: column; }
.inv-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 16px;
  padding: 11px 10px; margin: 0 -10px; border-radius: 12px; border-top: 1px solid var(--hair-soft);
  transition: opacity 0.35s var(--ease), background-color 0.35s var(--ease);
}
.inv-row:first-child { border-top-color: transparent; }
.inv-who { font-size: 15px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-amt { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.inv-row.is-paid .inv-amt { color: var(--muted); }
.inv-row.is-flash { animation: rowFlash 2.6s var(--ease); }
@keyframes rowFlash { 0%, 40% { background: var(--ok-soft); } 100% { background: transparent; } }

.feed { display: flex; flex-direction: column; }
.feed li {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--hair-soft);
}
.feed li:first-child { border-top-color: transparent; }
.feed li.is-new { animation: itemIn 0.5s var(--ease) both; }
.feed time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed p { font-size: 15px; line-height: 1.4; }
.feed p b { font-weight: 600; }
.feed .f-ok { color: var(--ok); }
.feed .f-warn { color: var(--warn); }
.feed .f-brand { color: var(--brand-ink); }
.feed-empty { font-size: 15px; color: var(--muted); padding: 10px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 70;
  width: min(520px, calc(100% - 32px)); transform: translateX(-50%);
  padding: 14px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-size: 15px; line-height: 1.4;
  animation: toastIn 0.5s var(--ease) both;
}
.toast.is-leaving { animation: toastOut 0.35s var(--ease) both; }
.toast b { font-weight: 600; }
.toast p + p { margin-top: 4px; }
.toast .toast-k { font-size: 13px; opacity: 0.7; margin-bottom: 4px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- customer portal ---------- */
.portal {
  max-width: 1040px; width: 100%; margin: 0 auto;
  border-radius: 24px; overflow: hidden; background: var(--card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03), 0 24px 60px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--hair-soft);
}
.portal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(18px, 3vw, 32px); border-bottom: 1px solid var(--hair-soft);
}
.portal-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.portal-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--brand); color: #fff;
}
.portal-mark .ic { width: 18px; height: 18px; }
.portal-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.avatar-brand { width: 30px; height: 30px; font-size: 11px; background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.portal-body { padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 44px) clamp(22px, 4vw, 44px); }
.portal-hero { margin-bottom: clamp(22px, 3vw, 32px); }
.portal-kicker { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.portal-kicker .ic { width: 16px; height: 16px; }
.portal-title { margin-top: 8px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.028em; max-width: 22ch; }
.p-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.p-side { display: grid; gap: 16px; }
.p-card { border-radius: var(--radius-card); background: var(--well); padding: clamp(18px, 2.4vw, 26px); }
.p-photos { grid-column: 1 / -1; }
.p-label { font-size: 15px; font-weight: 600; }
.p-progress-head { display: flex; align-items: baseline; justify-content: space-between; }
.p-pct { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--brand-ink); }
.p-track { height: 8px; margin-top: 14px; border-radius: 8px; background: var(--hair-soft); overflow: hidden; }
.p-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand); transition: width 0.5s var(--ease); }
.p-eta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.steps { margin-top: 22px; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { /* connector */
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--hair);
}
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--brand); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); box-shadow: inset 0 0 0 1.5px var(--hair); color: transparent;
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.step-dot .ic { width: 16px; height: 16px; stroke-width: 2; }
.step.is-done .step-dot { background: var(--brand); box-shadow: none; color: #fff; }
.step.is-now .step-dot { box-shadow: inset 0 0 0 2px var(--brand); }
.step.is-now .step-dot .ic { display: none; }
.step.is-now .step-dot::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
  animation: pulse 1.6s ease-in-out infinite;
}
.step-name { font-size: 15px; font-weight: 500; padding-top: 3px; }
.step:not(.is-done):not(.is-now) .step-name { color: var(--muted); font-weight: 400; }
.step-time { font-size: 13px; color: var(--muted); padding-top: 5px; font-variant-numeric: tabular-nums; }
.p-tech { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair-soft); }
.p-tech .avatar { width: 40px; height: 40px; font-size: 13px; background: var(--card); }
.p-tech-name { font-size: 15px; font-weight: 600; }
.p-tech-sub { font-size: 13px; color: var(--muted); }

.p-h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.p-sub { font-size: 13px; color: var(--muted); }
.p-kicker2 { font-size: 13px; font-weight: 600; color: var(--brand-ink); margin-bottom: 6px; }
.p-text { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.p-amount { margin-top: 14px; font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.p-amount small { font-family: var(--font); font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: -0.01em; margin-left: 6px; }
.p-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border: 1px solid transparent; border-radius: 9999px; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 500;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
}
.p-btn:hover { background: var(--brand-hover); }
.p-btn:active { transform: scale(0.97); }
.p-btn-ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.p-btn-ghost:hover { background: var(--hair-soft); }
.p-btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.p-btn-wide { flex: 1; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.p-method {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 12px 14px; border-radius: var(--radius-field); background: var(--card); border: 1px solid var(--hair);
}
.p-method .ic { color: var(--muted); }
.p-method p { font-size: 15px; }
.p-method small { display: block; font-size: 13px; color: var(--muted); }
.p-reveal { animation: itemIn 0.45s var(--ease) both; }
.p-state { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; }
.p-state p { font-size: 15px; }
.p-state small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.okmark { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; }
.okmark .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.paid { text-align: center; padding: 8px 0 4px; }
.paid-ring { width: 76px; height: 76px; margin: 4px auto 14px; display: block; }
.paid-ring circle { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 0.7s var(--ease) forwards; transform: rotate(-90deg); transform-origin: 50% 50%; }
.paid-ring path { fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 0.45s 0.55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.paid h3 { font-size: 21px; letter-spacing: -0.02em; }
.paid p { font-size: 14px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* photos made from shapes */
.p-photos-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo { margin: 0; }
.photo figcaption { margin-top: 8px; font-size: 14px; font-weight: 500; }
.photo figcaption small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.scene {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #e7e2d9 0%, #ddd6ca 68%, #c9c0b2 68%, #bfb5a6 100%);
}
.scene i { position: absolute; display: block; }
.photo.is-new .scene { animation: develop 1.2s var(--ease) both; }
@keyframes develop { from { filter: saturate(0) brightness(1.4); opacity: 0.3; } to { filter: none; opacity: 1; } }
.scene .duct { left: 44%; top: 0; width: 12%; height: 22%; background: linear-gradient(90deg, #a9adb3, #d7dade 45%, #9da1a8); }
.scene .unit {
  left: 33%; top: 22%; width: 34%; height: 50%; border-radius: 4px;
  background: linear-gradient(90deg, #d9dce0, #f4f5f7 40%, #c9cdd2);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.18);
}
.scene .vent {
  left: 39%; top: 46%; width: 22%; height: 14%;
  background: repeating-linear-gradient(180deg, #8f949b 0 2px, transparent 2px 6px);
  opacity: 0.7;
}
.scene .pipe { left: 70%; top: 34%; width: 3.5%; height: 38%; background: linear-gradient(90deg, #b87333, #e3a46b 50%, #a5652b); border-radius: 2px; }
.scene .outline { left: 33%; top: 22%; width: 34%; height: 50%; border: 2px dashed rgba(60, 50, 40, 0.45); border-radius: 4px; }
.scene .old {
  left: 6%; top: 40%; width: 24%; height: 34%; border-radius: 3px; transform: rotate(-8deg);
  background: linear-gradient(90deg, #8d8170, #a99b86 45%, #7c715f);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}
.scene .rust { left: 10%; top: 50%; width: 9%; height: 10%; border-radius: 40%; background: rgba(120, 60, 20, 0.5); transform: rotate(-8deg); }
.scene .led { left: 59%; top: 28%; width: 4%; aspect-ratio: 1; border-radius: 50%; background: #34c759; box-shadow: 0 0 10px 3px rgba(52, 199, 89, 0.7); }
.scene .tstat {
  left: 78%; top: 24%; width: 14%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1d1d1f 58%, #d0d3d8 60%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.scene .tstat::after {
  content: "70°"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 clamp(9px, 1.2vw, 13px) var(--font); color: #ffb340;
}
.scene .shine { inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.16) 50%, transparent 60%); }
.scene-locked {
  background: var(--card); display: grid; place-items: center; text-align: center; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.scene-locked .ic { width: 22px; height: 22px; margin: 0 auto 6px; }
.scene-locked p { font-size: 13px; padding: 0 10px; }
@media (prefers-color-scheme: dark) {
  .scene { background: linear-gradient(180deg, #4a4640 0%, #423e38 68%, #35312c 68%, #2e2a25 100%); }
}

/* ---------- CTA ---------- */
.cta { text-align: center; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(64px, 9vw, 112px); }
.cta-line { font-size: 17px; color: var(--muted); margin-bottom: 20px; }
/* the closing button is a whole question: on a narrow phone it wraps instead of pushing the page wide */
.cta .btn { max-width: 100%; white-space: normal; text-align: center; }
.more-demos { display: block; width: fit-content; margin: 18px auto 0; padding: 10px 4px; font-size: 15px; color: var(--accent); text-decoration: none; }
.more-demos:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-list { height: 360px; }
}
@media (max-width: 860px) {
  .p-grid { grid-template-columns: 1fr; }
  .sched { --name-w: 0px; }
  .sched-row { grid-template-columns: 1fr; gap: 8px; padding: 12px 0; }
  .sched-hours span:nth-child(even) { display: none; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px 16px; }
  .controls-inner { flex-wrap: wrap; gap: 10px; }
  .seg { width: 100%; }
  .seg-btn { min-width: 0; }
  .clock-group { margin-left: 0; width: 100%; }
  .clock { margin-right: auto; }
  .chart { height: 240px; }
  .photos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
  .col-list { height: auto; max-height: 340px; }
  .ctl-btn { padding: 8px 12px; }
  .answer-text { font-size: 17px; }
  .inv-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .inv-row > div { grid-column: 1; grid-row: 1; }
  .inv-row .inv-amt { grid-column: 2; grid-row: 1; padding-top: 1px; }
  .inv-row .tag { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .col[data-col="progress"] .col-list { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .feed li { grid-template-columns: 64px 1fr; }
  .photos { grid-template-columns: 1fr; }
  .scene { aspect-ratio: 16 / 9; }
  .scene.scene-locked { aspect-ratio: auto; height: 88px; }
}
@media (max-width: 400px) {
  .ctl-btn span { display: none; }
  .ctl-btn { width: 40px; padding: 0; justify-content: center; }
}

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

/* ---------- call to action in the top bar ---------- */
.btn.top-cta { min-height: 34px; padding: 6px 16px; font-size: 14px; flex: none; }
.cta-narrow { display: none; }
@media (max-width: 640px) {
  .cta-wide { display: none; }
  .cta-narrow { display: inline; }
  .btn.top-cta { padding: 6px 13px; }
}
/* on a phone the way back stays and the "Demo" pill gives up its place: the page itself says it is sample data */
@media (max-width: 400px) { .demo-pill { display: none; } }
@media (max-width: 480px) { .pill-more, .back-more { display: none; } }
/* small phones (360px): let the tiles shrink instead of pushing the page wide */
.view { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 400px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi { padding-left: 14px; padding-right: 14px; }
  .kpi-label, .kpi-sub { white-space: normal; }
}
