/* Fioreva Tech · estimate module
   Configuration form on the left, a live plan on the right with a pixel timeline.
   Every class is prefixed es-. Chip grids follow the form's own width (container queries). */

.es {
  display: grid;
  gap: 40px;
  align-items: start;
}
@media (min-width: 960px) {
  .es {
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    column-gap: clamp(32px, 3.4vw, 56px);
  }
  /* the plan stays beside the form while you configure; a tall plan settles at the form's end */
  .es-result { position: sticky; top: calc(var(--nav-h) + 12px); }
}

/* ---------- form ---------- */
.es-form {
  container: es-form / inline-size;
  display: grid;
  gap: 36px;
  min-width: 0;
}
.es-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.es-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-2);
  font: 600 1rem/1.2 var(--mono);
  letter-spacing: -0.01em;
  color: var(--fg);
}
.es-legend + * { clear: both; }
.es-num {
  font: 500 .75rem/1 var(--mono);
  letter-spacing: 0;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.es-legend-h {
  margin-left: auto;
  font: 500 .75rem/1 var(--mono);
  letter-spacing: 0;
  color: var(--fg-3);
}

.es-grid { display: grid; gap: 8px; }
.es-grid-biz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.es-grid-sys, .es-grid-ext { grid-template-columns: minmax(0, 1fr); }
@container es-form (min-width: 520px) {
  .es-grid-sys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .es-wide { grid-column: 1 / -1; }
}

/* chips: a transparent input covers the face, so the whole chip is the target */
.es-chip { position: relative; display: block; min-width: 0; }
.es-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.es-face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--fg-2);
  transition: border-color .18s, background-color .18s, color .18s;
}
/* hover only where a pointer can hover, so a tapped chip does not stay lit on phones */
@media (hover: hover) {
  .es-chip:hover .es-face { border-color: var(--line-3); color: var(--fg); }
  .es-chip:hover .es-i-a { fill: var(--fg-2); }
}
.es-input:checked + .es-face {
  border-color: var(--red);
  background: rgba(255, 0, 37, .07);
  color: var(--fg);
}
.es-input:focus-visible + .es-face { outline: 2px solid var(--mint); outline-offset: 2px; }

.es-chip-main { flex: 1; display: grid; gap: 4px; min-width: 0; }
.es-chip-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.es-chip-t {
  min-width: 0;
  font: 500 .8125rem/1.3 var(--mono);
  letter-spacing: -0.005em;
}
.es-chip-s { font: 400 .75rem/1.35 var(--sans); color: var(--fg-3); }
.es-chip-w {
  flex: none;
  margin-left: auto;
  font: 500 .75rem/1.3 var(--mono);
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.es-chip-w b { font-weight: 600; color: var(--fg-2); }
.es-input:checked + .es-face .es-chip-w b { color: var(--fg); }

/* business: pixel icon, label, a square radio pip */
.es-ico { flex: none; width: 22px; height: 22px; shape-rendering: crispEdges; }
.es-i-a { fill: var(--fg-3); transition: fill .18s; }
.es-i-b { fill: var(--line-3); transition: fill .18s; }
.es-input:checked + .es-face .es-i-a { fill: var(--red); }
.es-input:checked + .es-face .es-i-b { fill: var(--pure); }
.es-biz .es-chip-t { min-width: 0; text-wrap: balance; }
/* narrow forms: business chips become tiles, icon and pip on top, the label gets the full width */
@container es-form (max-width: 460px) {
  .es-biz .es-face {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 10px 8px;
    padding: 12px 12px 13px;
  }
  .es-biz .es-ico { grid-area: 1 / 1; }
  .es-biz .es-pip { grid-area: 1 / 2; margin: 2px 0 0; }
  .es-biz .es-chip-t { grid-area: 2 / 1 / 3 / 3; font-size: .78125rem; line-height: 1.35; }
}
/* unchecked boxes and pips use --fg-3 (5.3:1), the only sign that a chip is a radio or a checkbox */
.es-pip {
  flex: none;
  width: 10px;
  height: 10px;
  margin-left: auto;
  border: 1px solid var(--fg-3);
  transition: background-color .18s, border-color .18s;
}
.es-input:checked + .es-face .es-pip {
  border-color: var(--red);
  background: var(--red);
  box-shadow: inset 0 0 0 2px #000;
}

/* systems: square checkbox with a pixel tick */
.es-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--fg-3);
  border-radius: 2px;
  transition: background-color .18s, border-color .18s;
}
.es-tick { width: 14px; height: 10px; shape-rendering: crispEdges; opacity: 0; }
.es-tick rect { fill: #000; }
.es-input:checked + .es-face .es-box { border-color: var(--red); background: var(--red); }
.es-input:checked + .es-face .es-tick { opacity: 1; }
.es-sys .es-face { align-items: center; }

/* recommended mark: a hollow red square, the same one the hint above uses */
.es-recmark {
  display: none;
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border: 1px solid var(--red);
  vertical-align: 1px;
}
.es-sys.is-rec .es-chip-t .es-recmark { display: inline-block; }
.es-rec-t .es-recmark { display: inline-block; margin: 0 9px 0 0; }

.es-sys.is-flash .es-face { animation: es-flash .42s steps(3, end); }
@keyframes es-flash {
  0% { border-color: var(--pure); }
  100% { border-color: inherit; }
}

/* extras: switches with what they add to the timeline */
.es-track {
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  transition: background-color .18s, border-color .18s;
}
.es-track i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  background: var(--fg-3);
  transition: transform .2s steps(4, end), background-color .18s;
}
.es-input:checked + .es-face .es-track { border-color: var(--red); background: var(--red); }
.es-input:checked + .es-face .es-track i { background: #000; transform: translateX(16px); }
.es-eff { color: var(--fg-3); }
.es-eff.is-adds { color: var(--fg); }

/* the hint above the systems */
.es-rec {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 12px;
}
.es-rec-t {
  flex: 1;
  min-width: 0;
  padding-left: 16px;
  text-indent: -16px;
  font: 400 .8125rem/1.45 var(--sans);
  color: var(--fg-2);
  text-wrap: pretty;
}
.es-rec-t b { font-weight: 500; color: var(--fg); }
.es-mini {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--red);
  border-radius: var(--r-s);
  background: transparent;
  color: var(--fg);
  font: 600 .8125rem/1 var(--mono);
  transition: background-color .18s, color .18s;
}
.es-mini:hover, .es-mini:focus-visible { background: var(--red); color: #000; }

/* ---------- result ---------- */
.es-result {
  container: es-res / inline-size;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--surface);
}
.es-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-2);
  font: 500 .8125rem/1 var(--mono);
}
.es-led {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(0, 255, 194, .7);
  transition: background-color .15s, box-shadow .15s;
}
.es-led.is-busy { background: var(--red); box-shadow: 0 0 10px rgba(255, 0, 37, .75); }
.es-led.is-idle { background: var(--line-3); box-shadow: none; }
.es-bar-t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 .875rem/1.2 var(--mono);
  letter-spacing: 0;
}
.es-bar-m {
  flex: none;
  margin-left: auto;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.es-body { padding: 24px 28px 24px; }
.es-eyebrow {
  font: 500 .6875rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.es-fig {
  margin-top: 14px;
  font: 600 1.5rem/1 var(--mono);
  letter-spacing: -0.02em;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.es-fig-n {
  font-size: clamp(3.5rem, 2.1rem + 3.6vw, 5.75rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  color: var(--fg);
  transition: color .3s;
}
.es-fig-u { color: var(--fg-2); }
.es-fig.is-off .es-fig-n { color: var(--line-3); }
.es-result.is-armed .es-launch, .es-result.is-armed .es-chart-n { visibility: hidden; }
.es-launch {
  margin-top: 14px;
  font: 400 1rem/1.5 var(--sans);
  color: var(--fg-2);
}
.es-launch b { font-weight: 500; color: var(--fg); }

.es-empty { padding: 10px 0 4px; }
.es-empty-t {
  max-width: 24ch;
  font: 600 1.5rem/1.25 var(--mono);
  letter-spacing: -0.025em;
  color: var(--fg);
}
.es-empty .es-mini { margin-top: 18px; }

/* the pixel timeline */
.es-chart { margin-top: 26px; }
.es-chart-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.es-chart-h .es-eyebrow { white-space: nowrap; }
.es-chart-n {
  font: 500 .6875rem/1.3 var(--mono);
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.es-chart-host { position: relative; }
.es-svg { display: block; overflow: visible; shape-rendering: crispEdges; }
.es-svg text {
  font: 500 11px var(--mono);
  fill: var(--fg-2);
  font-variant-numeric: tabular-nums;
  transition: fill .2s;
}
.es-svg .es-t-dim, .es-svg .es-wk { fill: var(--fg-3); }
.es-tk { fill: var(--line-3); }
.es-tk.is-l { fill: var(--fg-3); }
.es-off { fill: rgba(255, 255, 255, .065); }
.es-off.is-l { fill: rgba(0, 255, 194, .09); }
.es-p-disc { fill: var(--gray); }
.es-p-design { fill: var(--red-deep); }
.es-p-build { fill: var(--red); }
.es-p-test { fill: var(--cream); }
.es-p-launch { fill: var(--mint); }
.es-chart-host.is-armed .es-on { opacity: 0; }
/* each cell: dark, then a white write head, then its colour. steps(1) holds every keyframe.
   backwards, not both: a finished cell falls back to its own style (the same look) and stops
   holding a composited animation, so a filled chart costs nothing at rest */
.es-svg.is-fill .es-on { animation: es-px .1s steps(1, end) backwards; animation-delay: var(--d, 0ms); }
@keyframes es-px {
  0% { opacity: 0; }
  4% { opacity: 1; fill: var(--pure); }
  100% { opacity: 1; }
}
/* hovering or focusing a system lights its row: the other rows' cells fade, their labels go
   to --fg-3 (5.3:1) instead of fading, so they stay readable */
.es-cells { transition: opacity .2s; }
.es-svg.has-hl .es-row:not(.is-hl) .es-cells { opacity: .28; }
.es-svg.has-hl .es-row:not(.is-hl) text { fill: var(--fg-3); }
.es-chart-host.is-empty .es-svg { opacity: .7; }

.es-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font: 500 .6875rem/1 var(--mono);
  color: var(--fg-2);
}
.es-key-i { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.es-sw { width: 8px; height: 8px; flex: none; }
.es-bg-disc { background: var(--gray); }
.es-bg-design { background: var(--red-deep); }
.es-bg-build { background: var(--red); }
.es-bg-test { background: var(--cream); }
.es-bg-launch { background: var(--mint); }
.es-result.is-empty .es-key { opacity: .5; }

/* what you get */
.es-get { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.es-get-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.es-get-n {
  font: 500 .6875rem/1 var(--mono);
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.es-get-list { display: grid; gap: 8px; margin-top: 14px; }
.es-li {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  column-gap: 12px;
  font: 400 .875rem/1.5 var(--sans);
  color: var(--fg-2);
  transition: color .2s;
}
.es-li b { font-weight: 500; color: var(--fg); transition: color .2s; }
.es-li-m { width: 6px; height: 6px; margin-top: .6em; background: var(--red); transition: opacity .2s; }
.es-li.is-extra .es-li-m { background: transparent; box-shadow: inset 0 0 0 1px var(--fg-3); }
/* the same highlight in the list: dim by colour, so the other items keep at least 5.3:1 */
.es-get-list.has-hl .es-li:not(.is-hl) { color: var(--fg-3); }
.es-get-list.has-hl .es-li:not(.is-hl) b { color: var(--fg-2); }
.es-get-list.has-hl .es-li:not(.is-hl) .es-li-m { opacity: .38; }

/* actions */
.es-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.es-copy { min-width: calc(10ch + 38px); }
.es-copy.is-done { border-color: var(--mint); color: var(--mint); }
.es-copy.is-fail { border-color: var(--cream); color: var(--cream); }
/* nothing to send yet: the actions go quiet instead of showing a muddy red */
.es-act[aria-disabled="true"], .es-act:disabled {
  pointer-events: none;
  opacity: 1;
  border-color: var(--line-2);
  background: transparent;
  color: var(--fg-3);
}
.es-note {
  margin-top: 12px;
  font: 400 .75rem/1.5 var(--sans);
  color: var(--fg-3);
}
.es-clip { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@container es-res (max-width: 520px) {
  .es-bar { padding: 0 14px; }
  .es-body { padding: 22px 18px 22px; }
  .es-fig { font-size: 1.25rem; }
  .es-chart { margin-top: 26px; }
  .es-actions .btn { flex: 1 1 auto; }
}

/* ---------- dock: the estimate stays in reach while the stacked form fills the screen ----------
   Narrow tablets get a compact card on the right, clear of the route prompt on the left. */
.es-dock { display: none; }
@media (max-width: 959px) {
  .es-dock {
    position: fixed;
    /* clear of the notch and the home indicator on a phone held sideways (viewport-fit=cover) */
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(360px, calc(100% - 32px));
    min-height: 54px;
    padding: 7px 7px 7px 14px;
    border: 1px solid var(--line-3);
    border-radius: var(--r-m);
    background: rgba(0, 0, 0, .88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: translateY(calc(100% + 28px));
    visibility: hidden;
    transition: transform .3s steps(5, end), visibility 0s linear .3s;
  }
  .es-dock.is-on {
    transform: none;
    visibility: visible;
    transition: transform .3s steps(5, end), visibility 0s;
  }
}
@media (max-width: 760px) {
  .es-dock {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}
.es-dock-k { font: 500 .6875rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
@media (max-width: 359px) { .es-dock-k { display: none; } }
.es-dock-v {
  font: 700 1rem/1 var(--mono);
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.es-dock-a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-left: auto;
  padding: 0 14px;
  border-radius: var(--r-s);
  background: var(--red);
  color: #000;
  font: 600 .8125rem/1 var(--mono);
  text-decoration: none;
  white-space: nowrap;
}

/* Reduced motion, and paused from the nav (the same rules below): changes still apply, shown in
   their final state. Every animated or transitioning part of the estimator is listed by name. */
@media (prefers-reduced-motion: reduce) {
  .es-svg.is-fill .es-on,
  .es-sys.is-flash .es-face { animation: none !important; }
  .es-face, .es-i-a, .es-i-b, .es-pip, .es-box, .es-track, .es-track i, .es-mini,
  .es-led, .es-fig-n, .es-svg text, .es-cells, .es-li, .es-li b, .es-li-m,
  .es-dock, .es-act, .es-act .btn-flag { transition: none !important; }
}
:root[data-motion="paused"] .es-svg.is-fill .es-on,
:root[data-motion="paused"] .es-sys.is-flash .es-face { animation: none !important; }
:root[data-motion="paused"] .es-face,
:root[data-motion="paused"] .es-i-a,
:root[data-motion="paused"] .es-i-b,
:root[data-motion="paused"] .es-pip,
:root[data-motion="paused"] .es-box,
:root[data-motion="paused"] .es-track,
:root[data-motion="paused"] .es-track i,
:root[data-motion="paused"] .es-mini,
:root[data-motion="paused"] .es-led,
:root[data-motion="paused"] .es-fig-n,
:root[data-motion="paused"] .es-svg text,
:root[data-motion="paused"] .es-cells,
:root[data-motion="paused"] .es-li,
:root[data-motion="paused"] .es-li b,
:root[data-motion="paused"] .es-li-m,
:root[data-motion="paused"] .es-dock,
:root[data-motion="paused"] .es-act,
:root[data-motion="paused"] .es-act .btn-flag { transition: none !important; }
