/* v2.17.2.10A — Estimator Visual Cohesion Pass A.
   Shared presentation only. Photography and progressive behavior remain in
   estimator.css / estimator.js. No specialized Pass B component treatment. */

main {
  --cohesion-border: #31575b;
  --cohesion-surface: #101516;
  --cohesion-copy: #bac6c8;
  --cohesion-radius: 8px;
}

.intro { margin-bottom: 32px; }
.intro h1 { line-height: 1.04; letter-spacing: -.025em; }
.intro > p:last-child { font-size: 1rem; line-height: 1.6; }

#estimator .card {
  padding: 24px;
  margin: 24px 0;
  border-color: #293739;
  border-radius: var(--cohesion-radius);
}
#estimator .card h2 {
  margin: 0 0 16px;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.35;
  letter-spacing: .025em;
}
#estimator .card h2 .muted {
  color: var(--cohesion-copy);
  font-size: .8em;
  font-weight: 400;
  text-transform: none;
}
#estimator .eyebrow { line-height: 1.4; letter-spacing: .16em; }
#estimator .hint {
  color: var(--cohesion-copy);
  line-height: 1.55;
}
#estimator .card > .hint { margin: 0 0 20px; }
#estimator .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#estimator .grid > label { min-width: 0; }
#estimator label { font-size: .85rem; line-height: 1.45; letter-spacing: .035em; }

/* Match the photographic cards' restrained border and surface treatment.
   Exclude the hidden source selects and every non-text input explicitly. */
#estimator :is(input:not([type]), input[type=text], input[type=email],
  input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
  select:not(.choice-card-source), textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--cohesion-border);
  border-radius: var(--cohesion-radius);
  background: var(--cohesion-surface);
  color: var(--white);
  color-scheme: dark;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
}
#estimator textarea { resize: vertical; }
#estimator input::placeholder,
#estimator textarea::placeholder { color: #9eadaf; opacity: 1; }
#estimator :is(input:not([type]), input[type=text], input[type=email],
  input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
  select:not(.choice-card-source), textarea):hover {
  background: #172022;
  border-color: var(--teal);
}
#estimator :is(input:not([type]), input[type=text], input[type=email],
  input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
  select:not(.choice-card-source), textarea):focus {
  border-color: var(--teal);
  outline: 2px solid #85cbd1;
  outline-offset: 2px;
}

#estimator .project-item {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--cohesion-border);
  border-radius: var(--cohesion-radius);
}
#estimator .project-item + .project-item { margin-top: 24px; }
#estimator .item-header { gap: 16px; margin-bottom: 20px; }
#estimator .item-header h3 { font-size: 1.2rem; line-height: 1.3; }
#estimator .item-collapsed-summary { font-size: .9rem; line-height: 1.5; }
#estimator .project-item.is-collapsed { padding-block: 16px; }
#estimator .project-item.is-collapsed .item-header { margin-bottom: 0; }
#estimator .progressive-group-fields { gap: 16px; }
#estimator .progressive-step { padding: 16px; }
#estimator .subsection { margin-top: 24px; padding-top: 20px; }
#estimator .subsection h4 { font-size: .95rem; line-height: 1.45; margin-bottom: 16px; }
#estimator .scheme-subsection.progressive-step { padding: 16px; }
#estimator .grouping-guidance {
  display: block;
  margin-top: 8px;
  color: var(--cohesion-copy);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}
#estimator .choices label,
#estimator .toggle {
  border-width: 1px;
  border-radius: var(--cohesion-radius);
  padding: 16px;
  letter-spacing: normal;
}
#estimator .scheme-choices label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-content: start;
}
#estimator .scheme-choices label > input { grid-row: 1 / span 2; }
#estimator .scheme-choices label > small { grid-column: 2; margin-top: 0; }
#estimator .notes { margin-top: 20px; }
#estimator .need-by-card { margin: 24px 0; border-color: var(--cohesion-border); }
#estimator .need-by-card h3 { font-size: 1rem; line-height: 1.45; margin-bottom: 12px; }
#estimator .need-by-card > .hint { margin: 0 0 16px; }
#estimator .section-footer-actions { margin-top: 20px; }

/* Shared action styling; keep photo choices, swatches and component-specific
   Upload/Coupon/Estimate/Confirm layouts under their existing rules. */
#estimator :is(.secondary-button, .remove-item, .submit-button) {
  min-height: 48px;
  max-width: 100%;
  border-width: 1px;
  border-radius: var(--cohesion-radius);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .04em;
  justify-content: center;
  align-items: center;
}
#estimator :is(.secondary-button, .remove-item, .submit-button):focus-visible {
  outline: 2px solid #85cbd1;
  outline-offset: 3px;
}
#estimator .progress-next { margin-top: 16px; }
#estimator .complete-item { margin-top: 20px; }

@media (max-width: 700px) {
  main { padding-inline: 16px; }
  #estimator .card { padding: 18px; margin-block: 20px; }
  #estimator .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #estimator .project-item { padding: 14px; }
  #estimator .progressive-step,
  #estimator .scheme-subsection.progressive-step { padding: 12px; }
  #estimator .item-header-actions { gap: 8px; }
}

/* v2.17.2.10B — Mobile Control Containment Fix.
   Keep the desktop cascade and all vertical/control presentation unchanged. */
@media (max-width: 700px) {
  #estimator :is(.grid, .progressive-group-fields, .coupon-row) > * {
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
  }

  #estimator :is(input:not([type]), input[type=text], input[type=email],
    input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
    input[type=file], select:not(.choice-card-source), textarea) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
  }

  /* Let WebKit's native date value shrink with its outer control. */
  #estimator :is(input[type=date], input[type=datetime-local])::-webkit-date-and-time-value {
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
}

/* v2.17.2.10C — Safari Date/Time Control Fix.
   Keep native WebKit pickers and empty-value semantics; only restore readable
   native value/affordance rendering on Safari/iOS. */
@supports (-webkit-touch-callout: none) {
  #estimator :is(input[type=date], input[type=datetime-local]) {
    color: var(--white);
    -webkit-text-fill-color: var(--white);
  }

  #estimator :is(input[type=date], input[type=datetime-local])::-webkit-date-and-time-value {
    color: var(--white);
    -webkit-text-fill-color: var(--white);
    opacity: 1;
    text-align: left;
  }

  #estimator :is(input[type=date], input[type=datetime-local])::-webkit-calendar-picker-indicator {
    opacity: 1;
  }
}

/* v2.17.2.10D — Mobile Safari Date/Time Size Normalization.
   Preserve the native picker and visible value restored in 10C, but make
   date/datetime controls match the established estimator control height on
   narrow screens instead of inheriting oversized WebKit intrinsic sizing. */
@media (max-width: 700px) {
  @supports (-webkit-touch-callout: none) {
    #estimator :is(input[type=date], input[type=datetime-local]) {
      height: 48px;
      min-height: 48px;
      max-height: 48px;
      padding-block: 12px;
    }

    #estimator :is(input[type=date], input[type=datetime-local])::-webkit-date-and-time-value,
    #estimator :is(input[type=date], input[type=datetime-local])::-webkit-datetime-edit {
      min-height: 0;
      height: auto;
      line-height: 1.4;
      padding: 0;
    }
  }
}
