/* TOMBALL_CHAT_DENSITY_PILOT_R1
   Tomball.pro only. Load after the existing R2 outer stylesheet and after
   base/R2/R3 inside the chat. Scoped presentation changes; no JS changes. */

/* Desktop shell. Keep the existing full-screen mobile geometry and launcher. */
@media (min-width: 601px) {
  #ce-city-ask-dialog-r2 {
    width: min(400px, calc(100vw - 32px));
    height: min(700px, calc(var(--ceask-r2-vh, 100dvh) - 40px));
    border-radius: 14px;
    box-shadow: 0 12px 36px #0e254e33;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-header {
    padding: 8px 12px;
    gap: 8px;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-brand {
    gap: 8px;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-brand img {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-brand strong {
    font-size: 15px;
    font-weight: 650;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-close {
    border-radius: 9px;
    font-size: 24px;
  }
  #ce-city-ask-dialog-r2 .ceask-r2-links {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Fine-pointer footer density; retain the existing touch-first target size. */
@media (min-width: 601px) and (hover: hover) and (pointer: fine) {
  #ce-city-ask-dialog-r2 .ceask-r2-links a {
    min-height: 32px;
  }
}

/* Retain the subtitle on short screens, where the older sheet hid it. */
#ce-city-ask-dialog-r2 .ceask-r2-brand span {
  display: block;
}

/* Preserve the existing high-contrast treatment. */
@media (forced-colors: active) {
  #ce-city-ask-dialog-r2 {
    box-shadow: none;
  }
}

/* Keep the app's normal single transcript scroller at the 596px target frame. */
body.embedded #chat {
  padding: 8px 12px 0;
}
body.embedded .message {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

/* Match the existing winning :not(.widget-managed) selector. Do not declare
   display here: lead-open must continue to hide this navigation normally. */
body.embedded:not(.widget-managed) .next-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 10px;
}
body.embedded:not(.widget-managed) .next-steps > .text-button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 5px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

body.embedded .panel-head .text-button {
  min-height: 32px;
  line-height: 1.4;
}
body.embedded .suggestions {
  gap: 5px;
  padding: 4px 12px 6px;
}
body.embedded .suggestions button {
  min-height: 32px;
  border-radius: 8px;
}

/* Explicit label/hint line heights and block textarea remove inherited leading
   and inline baseline space without reducing text or control hit areas. */
body.embedded #ask {
  padding: 6px 12px;
}
body.embedded #ask > label[for="question"] {
  display: block;
  margin: 0 0 3px;
  font-size: 11px;
  line-height: 1.4;
}
body.embedded #ask #question {
  display: block;
  width: 100%;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 16px;
  line-height: 1.45;
  overflow-y: auto;
  resize: none;
}
body.embedded #ask .compose-bottom {
  margin-top: 4px;
}
body.embedded #ask .compose-bottom > span {
  display: block;
  line-height: 1.4;
}
body.embedded #ask .compose-bottom .button {
  min-height: 38px;
  border-radius: 9px;
}
body.embedded .request-shortcut {
  padding: 4px 12px;
}
body.embedded .request-shortcut .button {
  min-height: 36px;
  border-radius: 9px;
}

/* Device-based typography, not an iframe width proxy for the parent viewport.
   Fine-pointer desktop remains user-zoomable; touch-first inputs stay 16px. */
@media (hover: hover) and (pointer: fine) {
  body.embedded #ask #question {
    font-size: 15px;
  }
}

/* Reverse only height-based suppression of the NORMAL chat interface.
   The existing :has(.user-message) suggestion rule is more specific and still
   hides introductory suggestions after the conversation starts. No rule here
   reveals marketing sections, honeypots, or lead-open state-hidden controls. */
body.embedded:not(.lead-open) .panel-head {
  display: flex;
}
body.embedded:not(.lead-open) .suggestions {
  display: flex;
}
body.embedded:not(.lead-open) main > details.privacy {
  display: block;
}
body.embedded:not(.lead-open) main > footer {
  display: flex;
}

/* Height is the useful iframe measurement. Keep all normal-view controls
   reachable when the keyboard/zoom/short viewport leaves too little room.
   The transcript retains its own bounded scroller for existing JS autoscroll;
   the containing main scroller makes the composer and remaining controls
   reachable. Lead-open continues using its existing form scroller. */
@media (max-height: 520px) {
  body.embedded:not(.lead-open) main {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.embedded:not(.lead-open) .assistant {
    flex: 0 0 auto;
    min-height: calc(100% - 60px);
    overflow: visible;
  }
  body.embedded:not(.lead-open) #chat {
    flex: 0 0 auto;
    min-height: 120px;
    max-height: 240px;
    overflow-y: auto;
  }
}
