
/* =========================================================
   DEMO24 UI 2.0 / V7
   Desktop-first three-column application + mobile-first cards
   ========================================================= */

:root {
  --v7-brand-width: clamp(230px, 19vw, 290px);
  --v7-summary-width: clamp(250px, 21vw, 320px);
  --v7-gap: 0px;
  --v7-touch: 48px;
}

body {
  overflow-x: hidden;
}

.container {
  width: min(1560px, calc(100% - 24px));
}

.app-shell {
  grid-template-columns:
    var(--v7-brand-width)
    minmax(540px, 1fr)
    var(--v7-summary-width);
  min-height: 0;
}

.intro-panel {
  padding: clamp(24px, 2.4vw, 36px);
}

.intro-panel h1 {
  font-size: clamp(38px, 4vw, 62px);
}

.wizard-panel {
  min-width: 0;
  border-right: 1px solid var(--border);
  padding: clamp(22px, 2.3vw, 34px);
}

.summary-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 2vw, 28px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 107, 26, .09), transparent 28%),
    #0b111c;
}

.summary-panel__head {
  display: grid;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.summary-panel__head span {
  font-size: 13px;
  font-weight: 850;
}

.summary-panel__head small {
  color: var(--muted);
  font-size: 11px;
}

.wizard-content {
  display: block;
}

.card {
  width: 100%;
  min-height: 420px;
  padding: clamp(24px, 3vw, 42px);
}

.question__title {
  max-width: 900px;
  margin-bottom: 28px;
  font-size: clamp(30px, 3.1vw, 48px);
  line-height: 1.05;
  overflow: visible;
}

.question__description {
  max-width: 760px;
}

/* Adaptive answer grid */
.options {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.options--count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.options--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.options--count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.options--count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.options--count-5,
.options--count-6,
.options--count-7 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option {
  min-width: 0;
  min-height: 144px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 22px;
  overflow: visible;
  text-align: left;
}

.option__icon {
  margin-bottom: auto;
  font-size: 34px;
  line-height: 1;
}

.option__title {
  width: 100%;
  overflow: visible;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.option__hint {
  width: 100%;
  min-height: 0;
  margin-top: 7px;
  display: block;
  overflow: visible;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.option__check {
  top: 14px;
  right: 14px;
}

.live-summary {
  position: static;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.live-summary__head {
  display: none;
}

.live-summary__rows {
  gap: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
}

.live-summary__rows div {
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.live-summary__rows div:last-child {
  border-bottom: 0;
}

.live-summary__rows strong {
  max-width: 58%;
  overflow-wrap: anywhere;
}

.live-summary__price {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(255,107,26,.28);
  border-radius: 18px;
  background: rgba(255,107,26,.065);
}

.service-tools {
  min-width: 0;
}

.service-selector {
  min-width: 0;
}

.service-chip {
  min-width: max-content;
}

.service-chip__icon svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controls {
  min-height: 72px;
}

.button {
  min-height: var(--v7-touch);
}

/* Desktop application shell */
@media (min-width: 1181px) {
  .calculator {
    min-height: auto;
    padding: 82px 0 18px;
  }

  .app-shell {
    height: min(720px, calc(100dvh - 100px));
    min-height: 620px;
    max-height: 720px;
    overflow: hidden;
  }

  .intro-panel,
  .wizard-panel,
  .summary-panel {
    height: 100%;
    min-height: 0;
  }

  .wizard-panel,
  .summary-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .controls {
    position: sticky;
    bottom: 0;
    z-index: 30;
  }
}

/* Compact desktop / small laptop widths */
@media (min-width: 981px) and (max-width: 1320px) {
  :root {
    --v7-brand-width: 225px;
    --v7-summary-width: 260px;
  }

  .container {
    width: calc(100% - 16px);
  }

  .app-shell {
    grid-template-columns:
      var(--v7-brand-width)
      minmax(470px, 1fr)
      var(--v7-summary-width);
  }

  .intro-panel {
    padding: 24px;
  }

  .intro-panel h1 {
    font-size: clamp(34px, 3.8vw, 48px);
  }

  .wizard-panel {
    padding: 22px;
  }

  .summary-panel {
    padding: 20px;
  }

  .options--count-3,
  .options--count-5,
  .options--count-6,
  .options--count-7 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet: hide marketing column, keep question + summary */
@media (min-width: 761px) and (max-width: 980px) {
  body {
    overflow: auto;
  }

  .container {
    width: min(940px, calc(100% - 20px));
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .intro-panel {
    display: none;
  }

  .wizard-panel {
    border-left: 0;
    padding: 24px;
  }

  .summary-panel {
    border-left: 1px solid var(--border);
    padding: 20px;
  }

  .options--count-3,
  .options--count-5,
  .options--count-6,
  .options--count-7 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls {
    position: sticky;
    bottom: 0;
  }
}

/* Mobile: one column, large touch cards, summary below the form */
@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .page,
  .calculator,
  .container {
    width: 100%;
    min-height: 0;
    height: auto;
  }

  .calculator {
    display: block;
    padding: 0;
  }

  .container {
    margin: 0;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .intro-panel {
    display: none;
  }

  .wizard-panel {
    order: 1;
    width: 100%;
    height: auto;
    overflow: visible;
    padding:
      max(76px, env(safe-area-inset-top))
      16px
      calc(96px + env(safe-area-inset-bottom));
    border: 0;
  }

  .summary-panel {
    order: 2;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 20px 16px 30px;
    border-top: 1px solid var(--border);
  }

  .wizard-topbar {
    padding-bottom: 16px;
  }

  .wizard-topbar strong {
    font-size: 15px;
  }

  .service-tools {
    gap: 10px;
  }

  .service-selector {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 12px 1px;
    scroll-snap-type: x proximity;
  }

  .service-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .service-master-button {
    min-height: var(--v7-touch);
  }

  .progress {
    padding: 14px 0;
  }

  .progress-steps {
    margin-bottom: 10px;
  }

  .card {
    min-height: 0;
    padding: 22px 16px;
    border-radius: 22px;
  }

  .question__title {
    margin-bottom: 22px;
    font-size: clamp(27px, 8vw, 36px);
    line-height: 1.08;
  }

  .question__description {
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 14px;
  }

  .options,
  .options--multi,
  .options--count-1,
  .options--count-2,
  .options--count-3,
  .options--count-4,
  .options--count-5,
  .options--count-6,
  .options--count-7 {
    grid-template-columns: minmax(0, 1fr);
  }

  .option,
  .option--multi {
    min-height: 108px;
    padding: 18px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    text-align: left;
  }

  .option__icon {
    grid-row: 1 / 3;
    margin: 0;
    font-size: 30px;
  }

  .option__title {
    grid-column: 2;
    align-self: end;
    font-size: 16px;
  }

  .option__hint {
    grid-column: 2;
    align-self: start;
    margin-top: 4px;
    font-size: 12px;
  }

  .option__check {
    top: 12px;
    right: 12px;
  }

  .controls {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(110px, .8fr) minmax(160px, 1.2fr);
    gap: 10px;
    margin: 0;
    padding:
      12px
      16px
      calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(10, 15, 25, .96);
    backdrop-filter: blur(18px);
  }

  .controls .button[hidden] + .button {
    grid-column: 1 / -1;
  }

  .privacy-note {
    display: none;
  }

  .order-tray:not([hidden]) {
    position: static;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-card__price strong {
    font-size: clamp(30px, 9vw, 44px);
  }

  .summary-panel__head {
    margin-top: 4px;
  }
}

/* Very small phones */
@media (max-width: 390px) {
  .wizard-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .controls {
    padding-right: 12px;
    padding-left: 12px;
  }

  .button {
    padding-right: 13px;
    padding-left: 13px;
    font-size: 13px;
  }
}

/* Prevent accidental clipping everywhere */
.option,
.option *,
.service-chip,
.service-chip *,
.question,
.question * {
  text-rendering: optimizeLegibility;
}

.option__title,
.option__hint,
.wizard-topbar strong,
.live-summary__rows strong {
  max-height: none;
  -webkit-line-clamp: unset;
}
