:root {
  /* JetReady brand — https://jetready.ddev.site/brand-guidelines */
  --jr-navy: #004078;
  --jr-navy-50: #f2f5f8;
  --jr-cyan: #02abde;
  --jr-cyan-100: #d9f2fa;
  --jr-lime: #e5f20d;
  --jr-ink: #002a4e;

  --color-ink: var(--jr-ink);
  --color-muted: #3d5a73;
  --color-surface: var(--jr-navy-50);
  --color-panel: #ffffff;
  --color-cta: var(--jr-lime);
  --color-cta-ink: var(--jr-navy);
  --color-accent: var(--jr-navy);
  --color-border: #d1dde7;
  --color-danger: #c62828;
  --color-danger-soft: #fef2f2;
  --color-success: var(--jr-navy);
  --color-success-soft: var(--jr-cyan-100);
  --color-ring: var(--jr-navy);
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.75rem;
  --space: 1rem;
  --radius: 0.5rem;
  --shadow: 0 1px 3px rgb(0 42 78 / 10%), 0 2px 4px -1px rgb(0 42 78 / 8%);
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Progressive disclosure — short “thinking” fade-ins */
  --motion-reveal-duration: 280ms;
  --motion-reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-reveal-stagger: 70ms;
  --motion-reveal-shift: 0.35rem;
  --color-divider: var(--jr-cyan);

  /* Web Awesome brand alignment (JetReady navy) */
  --wa-color-brand-95: #e8eef4;
  --wa-color-brand-90: #d1dde7;
  --wa-color-brand-80: #a3bbc9;
  --wa-color-brand-70: #6e94ad;
  --wa-color-brand-60: #3d5a73;
  --wa-color-brand-50: #004078;
  --wa-color-brand-40: #003560;
  --wa-color-brand-30: #002a4e;
  --wa-color-brand-20: #001f3a;
  --wa-color-brand-10: #001529;
  --wa-color-brand-05: #000c18;
  --wa-color-brand: var(--wa-color-brand-50);
  --wa-color-focus: var(--jr-navy);
}

/*
 * Hide WA’s required asterisk. Must win over the theme token on body
 * (.wa-theme-default), not only :root, or shadow-DOM labels still show *.
 */
:root,
body,
.wa-theme-default {
  --wa-form-control-required-content: none;
}

.field__wa-select::part(form-control-label)::after,
.field__wa-select::part(label)::after {
  content: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  background: color-mix(in srgb, var(--jr-navy) 10%, #ffffff);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-ink);
  background: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  --header-logo-height: 3.15rem;
  width: min(40rem, calc(100% - (2 * var(--space))));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  padding: var(--space) 0;
}

.site-header__logo {
  display: block;
  width: auto;
  height: var(--header-logo-height);
  flex-shrink: 1;
  min-width: 0;
}

.site-header__title {
  margin: 0;
  flex-shrink: 0;
  height: var(--header-logo-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
  color: var(--color-ink);
}

.page {
  width: min(40rem, calc(100% - (2 * var(--space))));
  margin: 0 auto;
  padding: var(--space) 0;
  display: grid;
  gap: var(--space);
}

.banner {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid #c9b27a;
  border-radius: var(--radius);
  background: #fff8e8;
  color: #5c4a1d;
  font-size: var(--text-sm);
}

.banner:empty {
  display: none;
}

/* Reusable tip / guidance under a control (e.g. after Add more). */
.inline-help {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-ink);
  font-size: var(--text-base);
  line-height: 1.4;
}

.inline-help[hidden] {
  display: none;
}

.inline-help__label {
  margin-inline-end: 0.35em;
  font-weight: 750;
}

.inline-help__body {
  font-weight: 400;
}

.inline-help__body--emphasis {
  font-weight: 650;
}

.inline-help > p {
  margin: 0;
}

.inline-help__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.inline-help__action {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.inline-help__action--primary {
  border: 2px solid var(--jr-navy);
  background: var(--color-cta);
  color: var(--color-cta-ink);
}

.inline-help__share {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin: 0 0.2em 0 0.15em;
  vertical-align: -0.15em;
  color: var(--color-ink);
}

.quote-form,
.service-details,
.service-questions {
  display: grid;
  gap: var(--space);
}

.service-questions:empty {
  display: none;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field[hidden],
.service-details[hidden] {
  display: none;
}

@keyframes disclose-in {
  from {
    opacity: 0;
    transform: translateY(var(--motion-reveal-shift));
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field.is-entering,
.service-details.is-entering {
  animation: disclose-in var(--motion-reveal-duration) var(--motion-reveal-ease) both;
  animation-delay: calc(var(--motion-reveal-stagger) * var(--reveal-step, 0));
}

.field[data-reveal-step='0'],
.service-details[data-reveal-step='0'] {
  --reveal-step: 0;
}

.field[data-reveal-step='1'],
.service-details[data-reveal-step='1'] {
  --reveal-step: 1;
}

.field[data-reveal-step='2'],
.service-details[data-reveal-step='2'] {
  --reveal-step: 2;
}

.field[data-reveal-step='3'],
.service-details[data-reveal-step='3'] {
  --reveal-step: 3;
}

.field[data-reveal-step='4'],
.service-details[data-reveal-step='4'] {
  --reveal-step: 4;
}

.field.is-entering .field__control select,
.field.is-entering .field__control input:not([type='checkbox']),
.field.is-entering .field__wa-select,
.field.is-entering .field__wa-number {
  animation: disclose-in var(--motion-reveal-duration) var(--motion-reveal-ease) both;
  animation-delay: calc(
    var(--motion-reveal-stagger) * var(--reveal-step, 0) + 40ms
  );
}

@media (prefers-reduced-motion: reduce) {
  .field.is-entering,
  .service-details.is-entering,
  .field.is-entering .field__control select,
  .field.is-entering .field__control input:not([type='checkbox']),
  .field.is-entering .field__wa-select,
  .field.is-entering .field__wa-number {
    animation: none;
  }
}

.field__wa-select,
.field__wa-number {
  display: block;
  width: 100%;
}

/* Multi-select: no clear-all (omit with-clear); hide the chevron via the
   documented expand-icon part so tags keep the width. Per-tag remove stays. */
.field__wa-select[multiple]::part(expand-icon) {
  display: none;
}

/* WA number-input always renders an empty start slot with flex:1; collapse it
   and trim the default inline padding so Length/Width/Area stay readable. */
.field__wa-number::part(start) {
  display: none;
}

.field__wa-number::part(end) {
  flex: 0 0 auto;
  margin-inline-end: 0.4rem;
}

.field__wa-number::part(input) {
  text-align: center;
  padding-inline: 0.4rem 0;
}

.field__wa-number:focus-within::part(input)::placeholder {
  color: transparent;
}

.field--area {
  gap: 0.35rem;
}

.area-dims {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.area-dims__op {
  color: var(--color-muted);
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.field__unit {
  color: var(--wa-form-control-placeholder-color, var(--color-muted));
  font-size: inherit;
  line-height: inherit;
  user-select: none;
}

.field__control,
.toggle {
  box-sizing: border-box;
  height: 3.9375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.field__control {
  display: grid;
  align-content: center;
  gap: 0.15rem;
  padding: 0.4rem 0.75rem 0.45rem;
}

.field__caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  line-height: 1.2;
}

.field__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.field__hint:empty {
  display: none;
}

.field--toggle {
  gap: 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

.toggle input {
  width: 1.25rem;
  min-height: 1.25rem;
  margin: 0;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.toggle__label {
  flex: 1;
}

input,
select,
button {
  font: inherit;
}

.field__control input:not([type='checkbox']),
.field__control select {
  width: 100%;
  min-height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
}

.field__control:focus-within,
.toggle:focus-within {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.field__control input:focus-visible,
.field__control select:focus-visible,
.toggle input:focus-visible {
  outline: none;
}

.result {
  display: grid;
  gap: 0;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--jr-cyan);
  background: var(--color-success-soft);
}

.result--multi {
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  column-gap: 0.75rem;
  align-items: center;
}

.result--multi .result__title {
  grid-column: 1;
  grid-row: 1;
}

.result--multi .result__detail {
  grid-column: 1;
  grid-row: 2;
}

.result--multi .result__total {
  grid-column: 1;
  grid-row: 3;
}

.result--multi .result__meta {
  grid-column: 1 / -1;
  grid-row: 4;
}

.result__add {
  grid-column: 2;
  grid-row: 1 / 4;
  /* Top-align so empty space above the icon isn’t mistaken for the hit target. */
  align-self: start;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  line-height: 1.15;
  cursor: pointer;
}

.result__add[hidden] {
  display: none;
}

.result__add-icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

.result__add-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-muted);
  text-align: center;
}

.result__add-label[hidden] {
  display: none;
}

.result__add:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.result__lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.result__lines li {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 0.35rem;
  align-items: baseline;
}

.result__lines-price {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
}

.result__lines-service {
  margin: 0;
  min-width: 0;
}

.result.is-manual .result__lines-price {
  color: inherit;
}

.result__meta {
  --result-meta-line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  /* Custom elements don't expose a text baseline; top-align matching line boxes. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: 0.35rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-divider);
}

/* No orphan divider when Reset and View calculation are both hidden. */
.result__meta:not(:has(> :not([hidden]))) {
  display: none;
}

.result__reset {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--result-meta-line-height);
  text-decoration: none;
  cursor: pointer;
}

.result__reset[hidden] {
  display: none;
}

.result__reset:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

/* Quote total stays on screen even if an older cached script sets hidden. */
.result[hidden] {
  display: grid;
}

.result.is-manual {
  border-color: #c9b27a;
  background: #fff8e8;
  color: #5c4a1d;
}

.result.is-manual .result__detail {
  color: inherit;
}

.result__title {
  margin: 0;
  min-height: 1.5em;
  font-size: var(--text-base);
  font-weight: 700;
}

.result__title:empty {
  visibility: hidden;
}

.result__detail {
  margin: 0;
  min-height: 1.5em;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.result__detail:empty {
  visibility: hidden;
}

.result__total {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 750;
  line-height: 1.15;
  color: var(--color-success);
}

.result__calculation {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  /* plain still keeps WA panel border-width; zero it so text lines up with Reset. */
  border: 0;
  overflow: visible;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--result-meta-line-height);
}

.result__calculation[hidden] {
  display: none;
}

.result__calculation wa-accordion-item {
  --spacing: 0;
  display: block;
  width: 100%;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

/* Wording-sized hit target: ▾ View calculation, not full row width. */
.result__calculation wa-accordion-item::part(button) {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  gap: 0.3em;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
}

.result__calculation wa-accordion-item::part(label) {
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.result__calculation wa-accordion-item::part(icon) {
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: 1em;
}

/* Chevron-down flips to up; same box either way, so canvas=auto won’t clip. */
.result__calculation wa-accordion-item[expanded]::part(icon) {
  rotate: 180deg;
}

.result__calculation wa-icon[slot='icon'] {
  margin: 0;
  padding: 0;
  vertical-align: 0;
}

.result__calculation wa-accordion-item::part(panel) {
  width: 100%;
  font-weight: 400;
}

.result__calculation-body {
  display: grid;
  gap: 0.2rem;
  margin: 0.25rem 0 0;
}

.result__calculation-line {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.result__calculation-rule {
  width: 100%;
  height: 0;
  margin: 0.35rem 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
}

