/* Match home quality layer. Replaces the former inline responsive polish block.
   Scoped to the home shell; existing IDs, hidden states and product flows remain. */
.dm-app {
  --dm-quality-border: #2c3c54;
  --dm-quality-muted: #adbed3;
  --dm-quality-panel: #101c2e;
  --dm-quality-accent: #d4c5ff;
}
.dm-app .dm-layout,
.dm-app .dm-stage,
.dm-app .dm-profile-area,
.dm-app .dm-deck-column,
.dm-app .dm-details { min-width: 0; }
.dm-app [hidden] { display: none !important; }
.dm-app .dm-layout {
  width: min(1320px, calc(100% - 48px)) !important;
  max-width: 1320px !important;
  grid-template-columns: 310px minmax(0, 1fr) !important;
  gap: 24px !important;
  padding-top: 28px !important;
}
.dm-app .dm-sidebar {
  padding: 24px !important;
  background: linear-gradient(155deg, #142138, #101a2c) !important;
  border-color: var(--dm-quality-border) !important;
}
.dm-app .dm-sidebar h1 { font-size: clamp(2rem, 2.8vw, 2.6rem); line-height: 1.12; letter-spacing: -.055em; margin-bottom: 16px; }
.dm-app .dm-sidebar > p { color: var(--dm-quality-muted); line-height: 1.65; font-size: .925rem; }
.dm-app .dm-kicker { color: var(--dm-quality-accent); font-size: .68rem; letter-spacing: .13em; font-weight: 800; }
.dm-app .dm-search label { color: #edf3ff; font-size: .875rem; margin-bottom: 10px; }
.dm-app .dm-search-row { flex-wrap: wrap; background: #091425; border-color: #45536b; border-radius: 15px; transition: border-color .16s ease, box-shadow .16s ease; }
.dm-app .dm-search-row:focus-within { border-color: #b9a2f6 !important; box-shadow: 0 0 0 3px #a78bfa26 !important; }
.dm-app .dm-search textarea { flex: 1 1 calc(100% - 44px); min-width: 0; font-size: 1rem; line-height: 1.5; min-height: 78px; color: #f1f5ff; }
.dm-app .dm-search textarea::placeholder { color: #9aaec8; opacity: 1; }
.dm-app .dm-search button { min-height: 46px; border-radius: 11px; font-weight: 800; }
.dm-app .dm-search button[type="submit"] { flex: 1 0 100%; }
.dm-app .dm-search .dm-search-clear { flex: 0 0 38px; min-width: 38px !important; }
.dm-app .dm-search-hint { margin: 10px 0 0; font-size: .78rem; line-height: 1.5; color: var(--dm-quality-muted); }
.dm-app .dm-search-status { font-size: .8rem; line-height: 1.5; }
.dm-app .dm-chips { gap: 8px; margin-top: 8px; }
.dm-app .dm-chips button { min-height: 42px; border-color: #354760; color: #d6e2f4; background: #132136; padding: 8px 12px; font-size: .79rem; cursor: pointer; }
.dm-app .dm-location { min-height: 48px; border-color: #655784; background: #302441; color: #eee4ff; border-radius: 13px; font-size: .875rem; }
.dm-app #dmLocationStatus { color: var(--dm-quality-muted); font-size: .75rem; line-height: 1.5; }
.dm-app .dm-agent-card { background: #102a2b; border-color: #2d5351; border-radius: 16px; }
.dm-app .dm-agent-card span { color: #bfd2d4; font-size: .78rem; line-height: 1.55; }
.dm-app .dm-company-cta { padding: 17px; border-color: #4b4165; background: #241e37; }
.dm-app .dm-company-cta span { color: #c2bad3; line-height: 1.55; font-size: .78rem; }
.dm-app .dm-company-cta a { color: #f0cded; font-size: .8rem; line-height: 1.5; }
.dm-app .dm-results-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.dm-app .dm-results-toolbar h2 { margin: 7px 0 0; font-size: clamp(1.35rem, 2vw, 1.7rem); letter-spacing: -.035em; line-height: 1.2; }
.dm-app .dm-result-view-switch { display: inline-flex; flex-shrink: 0; gap: 4px; padding: 4px; border: 1px solid var(--dm-quality-border); border-radius: 13px; margin: 0; background: #0c1728; }
.dm-app .dm-result-view-switch button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 9px; background: transparent; color: #bccde2; font-size: .8rem; font-weight: 750; cursor: pointer; }
.dm-app .dm-result-view-switch button[aria-pressed="true"] { background: #d4c5ff; color: #1b1631; box-shadow: 0 2px 7px #0002; }
.dm-app .dm-profile-area { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr) !important; gap: 20px !important; align-items: start; }
.dm-app .dm-deck { width: min(100%, 430px); }
.dm-app .dm-card { border-radius: 25px; border-color: #3a465c; box-shadow: 0 18px 40px #0004; }
.dm-app .dm-deck::before,
.dm-app .dm-deck::after { border-radius: 25px; }
.dm-app .dm-body { padding: 0 22px 24px; }
.dm-app .dm-body h2 { font-size: 1.6rem; line-height: 1.2; margin-top: 8px; }
.dm-app .dm-body .dm-address { color: #b7c7dc; line-height: 1.5; }
.dm-app .dm-bio { color: #c6d3e6; }
.dm-app .dm-source,
.dm-app .dm-distance { max-width: calc(50% - 24px); overflow-wrap: anywhere; font-size: .67rem; line-height: 1.4; }
.dm-app .dm-details { background: var(--dm-quality-panel) !important; border-color: var(--dm-quality-border) !important; padding: 22px; }
.dm-app .dm-details-head { gap: 12px; align-items: start; padding-bottom: 15px; border-bottom: 1px solid var(--dm-quality-border); }
.dm-app .dm-details-head h2 { font-size: 1.3rem; line-height: 1.3; overflow-wrap: anywhere; }
.dm-app .dm-details-head button { width: 42px; height: 42px; min-width: 42px; border-radius: 12px; color: #d4e1f4; background: #1c2a40; border-color: #42516a; cursor: pointer; }
.dm-app .dm-detail-grid { gap: 10px; }
.dm-app .dm-detail-grid > div { min-width: 0; border-color: #304158; background: #0c1727; border-radius: 12px; }
.dm-app .dm-detail-grid small,
.dm-app .dm-detail-item > span,
.dm-app .dm-detail-section > span { color: #aebfd5; }
.dm-app .dm-detail-grid strong { overflow-wrap: anywhere; }
.dm-app .dm-detail-section p { font-size: .9rem; line-height: 1.7; color: #ced9e8; }
.dm-app .dm-detail-links a,
.dm-app .dm-owner-box a { border-radius: 11px; min-height: 44px; display: inline-flex; align-items: center; }
.dm-app .dm-detail-source { color: #aebfd5; line-height: 1.5; }
.dm-app .dm-actions { gap: 16px; }
.dm-app .dm-action { border-color: #3a4b65; box-shadow: 0 8px 20px #0003; }
.dm-app .dm-counter { color: #b8c8dd; font-size: .8rem; min-height: 20px; }
.dm-app .dm-agent-match-hint { width: min(100%, 430px); margin-top: 14px; padding: 13px 15px; border: 1px solid #304158; border-radius: 13px; background: #0d192b; color: #adbed3; font-size: .8rem; line-height: 1.6; }
.dm-app .dm-agent-match-hint strong { display: block; color: #d9e6f8; }
.dm-app .dm-agent-match-hint span { margin-left: 0 !important; }
.dm-app .dm-result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; max-height: 650px; overscroll-behavior: contain; }
.dm-app .dm-result-list[hidden],
.dm-app .dm-profile-area[hidden] { display: none !important; }
.dm-app .dm-result-list > p { grid-column: 1 / -1; margin: 0; padding: 28px; border: 1px dashed #52607b; border-radius: 18px; color: #c5d4e8; text-align: center; }
.dm-app .dm-result-list button { min-width: 0; min-height: 92px; padding: 17px; border: 1px solid #354861; border-radius: 16px; background: #112036; color: #edf4ff; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dm-app .dm-result-list button strong,
.dm-app .dm-result-list button small { display: block; min-width: 0; overflow-wrap: anywhere; }
.dm-app .dm-result-list button strong { font-size: .95rem; line-height: 1.4; }
.dm-app .dm-result-list button small { margin-top: 6px; font-size: .79rem; line-height: 1.5; color: #adbed5; }
.dm-app .dm-empty { border-color: #465974; background: #111d30; border-radius: 24px; }
.dm-app .dm-empty h2 { font-size: 1.45rem; line-height: 1.3; }
.dm-app .dm-empty p { font-size: .9rem; line-height: 1.6; color: #bdccdf; }
.dm-app .dm-seo-copy { width: min(1320px, calc(100% - 48px)) !important; max-width: 1320px !important; padding: 28px !important; border-color: var(--dm-quality-border) !important; }
.dm-app .dm-seo-copy h2 { font-size: 1.3rem; letter-spacing: -.025em; }
.dm-app .dm-seo-copy > p { max-width: 85ch; color: #bccce1; line-height: 1.7; }
.dm-app .dm-seo-copy summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: #deebfb; }
.dm-app .dm-seo-copy details p { color: #bccce1; line-height: 1.6; }
.dm-app .dm-seo-copy a { color: #d4c5ff; }
.dm-app :is(button, a, input, textarea, select):focus-visible { outline: 3px solid #93c5fd !important; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .dm-app .dm-result-list button:hover { border-color: #ad97e8; background: #192942; }
  .dm-app .dm-result-view-switch button:not([aria-pressed="true"]):hover { background: #21304a; color: #fff; }
  .dm-app .dm-chips button:hover { background: #24344e; border-color: #9b83d0; }
}
@media (max-width: 1100px) {
  .dm-app .dm-layout { width: min(940px, calc(100% - 40px)) !important; grid-template-columns: minmax(0, 1fr) !important; }
  .dm-app .dm-sidebar { position: static !important; }
  .dm-app .dm-sidebar h1 { max-width: 18ch; font-size: 2.3rem; }
  .dm-app .dm-sidebar > p { max-width: 68ch; }
  .dm-app .dm-search-row { flex-direction: row; flex-wrap: nowrap; align-items: center; }
  .dm-app .dm-search textarea { min-height: 58px; }
  .dm-app .dm-search button { min-width: 96px; }
  .dm-app .dm-search button[type="submit"] { flex: 0 0 110px; }
  .dm-app .dm-location { width: auto; padding-inline: 20px; }
  .dm-app .dm-details { position: static !important; width: 100%; }
  .dm-app .dm-agent-card { max-width: 620px; }
  .dm-app .dm-seo-copy { width: min(940px, calc(100% - 40px)) !important; }
}
@media (max-width: 700px) {
  .dm-app .dm-layout { width: calc(100% - 24px) !important; gap: 24px !important; padding-top: 14px !important; }
  .dm-app .dm-sidebar { padding: 20px !important; border-radius: 20px !important; }
  .dm-app .dm-sidebar h1 { font-size: clamp(1.9rem, 8vw, 2.3rem); }
  .dm-app .dm-search-row { flex-wrap: wrap; align-items: stretch; padding: 6px; }
  .dm-app .dm-search textarea { min-width: 0; flex: 1 1 calc(100% - 44px); min-height: 76px; font-size: 16px; }
  .dm-app .dm-search button[type="submit"] { flex-basis: 100%; min-height: 46px; }
  .dm-app .dm-search .dm-search-clear { flex: 0 0 38px; min-width: 38px !important; }
  .dm-app .dm-location { width: 100%; }
  .dm-app .dm-chips button { min-height: 44px; }
  .dm-app .dm-results-toolbar { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 16px; }
  .dm-app .dm-result-view-switch { display: flex; }
  .dm-app .dm-result-view-switch button { flex: 1; min-height: 44px; }
  .dm-app .dm-profile-area { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .dm-app .dm-details { padding: 20px; }
  .dm-app .dm-deck-column { width: 100%; }
  .dm-app .dm-result-list { grid-template-columns: minmax(0, 1fr); }
  .dm-app .dm-seo-copy { width: calc(100% - 24px) !important; padding: 20px !important; }
  /* Keep the existing commercial contact reachable without covering card titles. */
  body:has(.dm-app > .dm-layout) .product-whatsapp { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  body:has(.dm-app > .dm-layout) .product-whatsapp > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dm-app .dm-search-row,
  .dm-app .dm-result-list button,
  .dm-app .dm-result-view-switch button,
  .dm-app .dm-action,
  .dm-app .dm-card { transition: none !important; }
  .dm-app .dm-radar i,
  .dm-app .dm-match-flash > div { animation: none !important; }
}
