body.catalog-home #request-dialog {
  --request-default-height: 100vh;
  --request-height: var(--request-viewport-height, var(--request-default-height));
  --request-width: var(--request-viewport-width, 100vw);
  --request-gap: clamp(2px, calc(var(--request-height) * .035), 16px);
  --request-padding: clamp(4px, calc(var(--request-width) * .04), 24px);
  --request-action-padding: min(8px, calc(var(--request-height) * .035));
  --request-action-bottom: max(var(--request-action-padding), env(safe-area-inset-bottom));
  --request-max-width: 36rem;
  position: fixed;
  inset: auto;
  top: var(--request-viewport-y, calc(var(--request-default-height) / 2));
  left: var(--request-viewport-x, 50vw);
  width: min(var(--request-max-width), calc(var(--request-width) - 2 * var(--request-gap)));
  /* The shared mobile stylesheet sets both limits with !important. */
  max-width: none !important;
  max-height: calc(var(--request-height) - 2 * var(--request-gap)) !important;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid var(--home-line, var(--line));
  border-radius: 18px;
  background: #fff;
  color: var(--home-ink, var(--ink));
  box-shadow: 0 18px 60px #10282038;
  overflow: hidden;
}

@supports (height: 100dvh) {
  body.catalog-home #request-dialog { --request-default-height: 100dvh; }
}

body.catalog-home.home-keyboard-open #request-dialog {
  --request-action-bottom: var(--request-action-padding);
}

body.catalog-home #request-dialog[open] {
  display: flex;
  flex-direction: column;
}

body.catalog-home #request-dialog.trip-receipt-open {
  --request-max-width: 28rem;
  overflow: auto;
}

body.catalog-home #request-dialog .dialog-heading {
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
  padding: min(12px, calc(var(--request-height) * .04)) var(--request-padding);
  border-bottom: 1px solid var(--home-line, var(--line));
  overflow: auto;
}

body.catalog-home #request-dialog .dialog-heading h2 {
  margin: 0;
  font-size: clamp(1rem, calc(var(--request-width) * .0625), 1.65rem);
  line-height: 1.14;
  overflow-wrap: anywhere;
}

body.catalog-home #request-dialog .dialog-heading > button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--home-accent, var(--dark));
  background: #eaf2ee;
}

body.catalog-home #request-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

body.catalog-home .home-request-fields {
  padding-inline: var(--request-padding);
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  scroll-padding-block: 6px;
}

body.catalog-home .home-request-fields::before,
body.catalog-home .home-request-fields::after {
  display: block;
  height: min(14px, calc(var(--request-height) * .025));
  content: '';
}

body.catalog-home #request-context {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #edf4ef;
  color: var(--home-accent, var(--dark));
  font-size: 1rem;
  line-height: 1.35;
}

body.catalog-home #request-dialog .pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0 12px;
}

body.catalog-home #request-dialog .home-request-fields :is(label, p, summary) {
  color: var(--home-ink, var(--ink));
  font-size: 1rem;
  line-height: 1.4;
}

body.catalog-home #request-dialog :is(#request-name, #request-phone, #request-comment, #request-preview) {
  width: 100%;
  min-height: 46px;
  border: 1px solid #839b91;
  border-radius: 8px;
  background: #fff;
  color: var(--home-ink, var(--ink));
  font-size: 16px;
  line-height: 1.3;
}

body.catalog-home #request-dialog .check.consent {
  min-height: 44px;
  align-items: start;
  font-size: 1rem !important;
}

body.catalog-home #request-consent {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
}

body.catalog-home #request-dialog .request-actions {
  margin: 0;
  padding: var(--request-action-padding) var(--request-padding) var(--request-action-bottom);
  border-top: 1px solid var(--home-line, var(--line));
  background: #fff;
}

body.catalog-home #request-form button[type="submit"],
body.catalog-home #copy-request {
  min-width: 0;
  min-height: 46px;
  padding: 5px min(14px, calc(var(--request-width) * .045));
  border-radius: 9px;
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body.catalog-home #request-form button[type="submit"] {
  width: 100%;
  padding-inline: clamp(1px, calc((var(--request-width) - 100px) * .06), 14px);
  border-color: var(--home-accent, var(--green));
  background: var(--home-accent, var(--green));
}

/* With little room above the keyboard, put Close beside Submit to leave a taller field area. */
body.catalog-home #request-dialog.home-request-compact {
  --request-close-width: clamp(26px, calc(var(--request-width) * .23), 44px);
}

body.catalog-home #request-dialog.home-request-compact .dialog-heading {
  position: absolute;
  right: var(--request-padding);
  bottom: var(--request-action-bottom);
  z-index: 1;
  padding: 0;
  border: 0;
  overflow: visible;
}

body.catalog-home #request-dialog.home-request-compact .dialog-heading > :not(button) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

body.catalog-home #request-dialog.home-request-compact .dialog-heading > button {
  width: var(--request-close-width);
  min-width: 0;
}

body.catalog-home #request-dialog.home-request-compact .request-actions {
  padding-right: calc(var(--request-padding) + var(--request-close-width) + 5px);
}

body.catalog-home #request-dialog.home-request-compact #request-form button[type="submit"] {
  padding-block: 2px;
  /* Physical text size stays readable at narrow visual widths reached by pinch zoom. */
  font-size: clamp(.625rem, calc(var(--request-width) * .09), 1.125rem) !important;
  line-height: 1.05;
}

body.catalog-home #request-status:empty { display: none; }
body.catalog-home #request-status.error { color: #9b302a; }

body.catalog-home #request-dialog summary {
  display: list-item;
  min-height: 44px;
  padding-block: 11px;
}

body.catalog-home.home-field-focused #catalog-quick-bar,
body.catalog-home.home-keyboard-open #catalog-quick-bar {
  visibility: hidden;
}
