/* Explicitly hide the enhancement when native dialog support is absent. */
.estimate-dialog:not([open]) { display: none; }
.estimate-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: min(1000px, calc(100vh - 32px));
  height: min(1000px, calc(100dvh - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  color: var(--navy);
  overscroll-behavior: contain;
}
.estimate-dialog-header { display: flex; flex: none; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: var(--cream); }
.estimate-dialog-header > div { flex: 1; min-width: 0; }
.estimate-dialog-header h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; }
.estimate-dialog-header p { margin: 8px 0 0; max-width: 650px; font-size: 12px; line-height: 1.6; }
.estimate-dialog-close { display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex: none; min-width: 80px; min-height: 44px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 600; }
.estimate-dialog-close span { font-size: 24px; line-height: 1; }
.estimate-dialog-form { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.estimate-dialog-form iframe { display: block; width: 100%; height: 100%; background: #fff; }
.estimate-dialog-fallback { flex: none; margin: 0; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--cream); font-size: 12px; line-height: 1.7; }
.estimate-dialog-fallback a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.estimate-dialog a:focus-visible, .estimate-dialog button:focus-visible { outline-offset: 2px; }
@media (max-width: 600px) {
  .estimate-dialog[open] { width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .estimate-dialog-header { padding: max(12px, env(safe-area-inset-top)) 14px 12px; gap: 10px; }
  .estimate-dialog-header p { font-size: 11px; }
  .estimate-dialog-fallback { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); font-size: 11px; }
}
@media (max-height: 450px) {
  .estimate-dialog-header { padding-top: 8px; padding-bottom: 8px; }
  .estimate-dialog-header p { display: none; }
  .estimate-dialog-fallback { padding-top: 6px; padding-bottom: 6px; }
}
