html:has(.detail-dialog[open]) { overflow: hidden; }

.detail-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #cfddd4;
  border-radius: 18px;
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 28px 88px #0b221c49;
}
.detail-dialog::backdrop { background: #091c15a8; }
.detail-dialog [hidden] { display: none; }
.detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 5vw, 30px);
  border-bottom: 1px solid #dce7e0;
  background: #f0f5f2;
}
.detail-head h2 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.8rem); line-height: 1.15; letter-spacing: -.025em; }
.detail-close {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #cbdad1;
  border-radius: 7px;
  background: var(--white);
  color: var(--green-deep);
  font-size: .875rem;
  font-weight: 750;
}
.detail-close:hover { background: #e8f1eb; }
.detail-dialog :focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.detail-body { display: grid; gap: 16px; padding: 22px clamp(16px, 5vw, 30px); }
.detail-body p { margin: 0; color: #42544b; line-height: 1.55; }
.detail-list { display: grid; gap: 12px; padding: 0; margin: 0; }
.detail-list li {
  display: grid;
  gap: 4px;
  padding: 0 0 0 12px;
  border-left: 2px solid #aac9b5;
  line-height: 1.45;
}
.detail-list li span { color: #42544b; }
.detail-body .detail-note { padding: 12px 14px; border-radius: 8px; background: #f0f5f2; }
.detail-note strong { color: var(--green-dark); }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px clamp(16px, 5vw, 30px) max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid #dce7e0;
}
.detail-actions .detail-link { color: var(--green-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.detail-card-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; }
.detail-card-cta::after {
  content: "";
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border: 1px solid #d7e5db;
  border-radius: 50%;
  background: linear-gradient(var(--green), var(--green)) center / 9px 1.5px no-repeat,
    linear-gradient(var(--green), var(--green)) center / 1.5px 9px no-repeat, #eff5f1;
}
:is(.service-card, .vehicle-rates > div):is(:hover, :focus-within) .detail-card-cta::after { border-color: #88b49a; }

@media (max-width: 640px) {
  .detail-dialog {
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 91vh;
    max-height: 91dvh;
    border-radius: 18px 18px 0 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .detail-dialog[open] { animation: detail-enter .28s cubic-bezier(.2,.75,.2,1) both; }
  .detail-dialog[open]::backdrop { animation: detail-fade .25s ease-out both; }
  .detail-card-cta::after { transition: transform .2s ease, border-color .2s ease; }
  :is(.service-card, .vehicle-rates > div):is(:hover, :focus-within) .detail-card-cta::after { transform: rotate(90deg); }
}
@keyframes detail-enter { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes detail-fade { from { opacity: 0; } to { opacity: 1; } }
