/* Public page layout: readable controls, predictable gutters, and natural reflow.
   Account rules, hidden states, form submission and chat session layouts are untouched. */
:root { --dd-page-gutter: clamp(16px, 3vw, 36px); }
html { scrollbar-gutter: stable; }
/* One outer content width across public pages, including login and account pages. */
body:not(.chat-active) :is(.shell,.page-shell,.content-shell,.legal-shell,.account-page,.profile-center,.ad-create-shell,.public-advertiser-page,.auth-view,.chat-entry-page,.advertiser-login-layout,.advertiser-layout,.community-layout,#community-main.advertiser-page) {
  width: min(calc(100% - 2 * var(--dd-page-gutter)),1320px) !important;
  max-width: 1320px !important;
  margin-inline: auto !important;
  padding-inline: 0;
}
body.community-app:not(.chat-active) .community-layout > #community-main { width: 100%; margin-inline: 0; padding-inline: 24px 0; }
@media(max-width:900px) { body.community-app:not(.chat-active) .community-layout > #community-main { padding-inline: 0; } }
body.chat-active .dd-home-search-shell,
body:has(#chat:target) .dd-home-search-shell { display: none !important; }
body:not(.chat-active) { overflow-wrap: break-word; }
body:not(.chat-active) :where(main, section, form, fieldset, .hero-copy, .hero-side) { min-width: 0; }

body#home:not(.chat-active) :is(.hero, .dd-home-search-shell, .creator-spotlight) {
  width: min(calc(100% - 2 * var(--dd-page-gutter)), 1320px);
  margin-inline: auto;
}
body#home .hero { padding-block: clamp(28px,4vw,56px) 28px; gap: clamp(24px,4vw,56px); align-items: center; }
body#home { background: radial-gradient(ellipse at 10% 0%,var(--dd-pink-soft),transparent 45rem),var(--dd-bg); }
body#home .hero-copy { margin-left: 0; }
body#home .hero-side { transform: none; width: 100%; }
body#home .hero-copy h1 { font-size: clamp(2.25rem,4.2vw,3.75rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 18px; }
body#home .hero-copy h1 em { max-width: 100%; text-shadow: none; }
body#home .hero-lede { font-size: 1rem; line-height: 1.65; color: var(--dd-muted-strong,#d8ced9); }
body#home .coming-next { display: flex; flex-wrap: wrap; overflow: visible; gap: 8px; padding: 0; }
body#home .coming-next a { min-height: 44px; padding: 10px 14px; font-size: .8125rem; line-height: 1.35; }
body#home .signature-line { font-size: .8125rem; line-height: 1.6; font-weight: 500; }
body#home #guest-entry-card { padding: clamp(20px,2.5vw,32px); border-radius: 16px; background: linear-gradient(150deg,var(--dd-panel-top),var(--dd-panel-bottom)); box-shadow: 0 12px 32px #0002; }
body#home #guest-entry-card h2 { font-size: 1.5rem; line-height: 1.25; }
body#home #guest-entry-card .entry-card-subtitle { font-size: .9375rem; line-height: 1.6; }
body#home #guest-entry-card .button { min-height: 48px; font-size: .875rem; line-height: 1.4; white-space: normal; }
body#home #guest-entry-card .entry-welcome-note { margin-top: 20px; }
body#home #guest-entry-card .entry-welcome-note li { font-size: .8125rem; line-height: 1.5; }
body#home #guest-entry-error:empty { display: none; }
body#home .dd-home-search-shell { padding-inline: 0; }
body#home .dd-home-ad-filter { padding: clamp(16px,2vw,24px); background: var(--dd-surface,#18121d); box-shadow: none; }
body#home .dd-home-ad-categories :is(a,button) { min-height: 44px; font-size: .8125rem; line-height: 1.4; padding: 8px; }
body#home :is(.dd-home-ad-field > span,.dd-home-ad-label,.dd-home-ad-price legend,.dd-home-range-filter legend,.dd-home-extra-grid label > span) { font-size: .8125rem; }
body#home :is(.dd-home-ad-source,.dd-home-search-note) { font-size: .75rem; line-height: 1.6; }
body#home :is(.dd-home-more-filters,.dd-home-ad-submit,.dd-home-ad-reset) { min-height: 44px; font-size: .875rem; }
body#home .dd-listing-heading { align-items: start; flex-wrap: wrap; gap: 12px; }
body#home .dd-listing-heading :is(p,a) { font-size: .875rem; }

/* Keep all input text at a readable size, also avoiding focus zoom on iOS. */
body :is(.auth-view,.chat-entry-page,.advertiser-login-layout,.dd-home-ad-filter,#directory-filters) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  font-size: 16px !important;
}
body.community-app .auth-view {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: start;
  min-height: 0;
  padding-block: clamp(32px,5vw,64px);
  gap: clamp(24px,5vw,64px);
}
body.community-app .auth-view > div:first-of-type h1 { font-size: clamp(2rem,3.2vw,3rem); line-height: 1.15; }
body.community-app .auth-view > div:first-of-type > p { font-size: 1rem; line-height: 1.65; }
body.community-app .auth-view > .panel { max-width: 520px; }
body.community-app #account-form { display: grid; gap: 18px; }
body.community-app #registration-extra:not([hidden]) { display: grid; gap: 18px; }
body.community-app #account-form label { margin: 0; }
body.community-app #account-form h2 { margin: 0 0 6px; }
body.community-app #account-form p { margin-block: 0; }
body.community-app .auth-view > .panel label { font-size: .875rem; line-height: 1.5; }
body.community-app .auth-view > .panel label.check-row { display: flex; align-items: flex-start; gap: 10px; }
body.community-app .auth-view > .panel .check-row input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; }
body.community-app .auth-view > .panel :is(small,.muted-copy) { font-size: .8125rem; line-height: 1.6; }
body.community-app .auth-view > .panel .text-button { min-height: 44px; white-space: normal; }
body .chat-entry-page { align-items: start; gap: clamp(24px,5vw,64px); padding-block: clamp(32px,5vw,64px); }
body .chat-entry-intro h1 { font-size: clamp(2rem,3.5vw,3rem); line-height: 1.15; }
body .chat-entry-intro p { font-size: 1rem; line-height: 1.65; }
body .chat-entry-panel :is(label,button) { font-size: .875rem; line-height: 1.5; }
body .chat-entry-header { flex-wrap: wrap; gap: 12px; }
body .advertiser-login-layout { align-items: start; gap: clamp(24px,5vw,64px); padding-block: clamp(32px,5vw,64px); }
body .advertiser-login-layout h1 { font-size: clamp(2rem,3.5vw,3rem); line-height: 1.15; }
body .advertiser-top { flex-wrap: wrap; gap: 12px; }

@media (max-width: 900px) {
  body.community-app .auth-view { grid-template-columns: minmax(0,1fr); max-width: 640px; }
  body.community-app .auth-view > .panel { max-width: none; }
}
@media (max-width: 600px) {
  body#home .hero { padding-top: 28px; gap: 24px; }
  body#home .hero-copy h1 { font-size: clamp(1.875rem,8.2vw,2.625rem); line-height: 1.1; }
  body#home .coming-next { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  body#home .coming-next a { justify-content: center; text-align: center; padding-inline: 8px; }
  body#home #guest-entry-card { padding: 20px; }
  body#home .dd-home-ad-categories { gap: 8px; }
  body#home .dd-home-ad-categories > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  body.community-app .auth-view { width: calc(100% - 32px); padding-block: 28px 40px; gap: 24px; }
  body.community-app .auth-view > div:first-of-type h1 { font-size: 2rem; }
  body.community-app .auth-view > .panel { padding: 20px; }
  body .chat-entry-page { width: calc(100% - 32px); margin-inline: auto; padding-inline: 0; }
  body .chat-entry-panel { padding: 20px; border-radius: 16px; }
  body .chat-entry-intro .entry-note { padding: 16px; font-size: .875rem; }
  body .compact-footer-inner { padding-block: 28px; }
  body .compact-footer-inner nav { gap: 8px 16px; }
  body .compact-footer-inner nav a { display: inline-flex; align-items: center; min-height: 44px; }
}

html[data-theme="light"] body#home .dd-home-ad-filter { background: var(--dd-surface,#fff); }

/* One type scale shared by both advertisement search interfaces. */
body#home .dd-home-ad-filter,
body.dd-advertisements-page #directory-filters {
  font-family: Inter,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif !important;
  font-size: 14px;
  line-height: 1.5;
}
body#home .dd-home-ad-filter :is(input,select,textarea,button,a,summary),
body.dd-advertisements-page #directory-filters :is(input,select,textarea,button,a,summary) {
  font-family: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
body#home .dd-home-ad-filter :is(label,legend,.dd-home-ad-label,.dd-home-ad-field > span,.dd-home-extra-grid label > span),
body.dd-advertisements-page #directory-filters :is(label,legend,.directory-range-title,.directory-disclosure-copy) {
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1.5 !important;
}
body#home .dd-home-ad-filter :is(input:not([type=checkbox]):not([type=radio]),select,textarea),
body.dd-advertisements-page #directory-filters :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  min-height: 48px !important;
  border-radius: 10px !important;
}
body#home .dd-home-ad-filter :is(button,a,summary),
body.dd-advertisements-page #directory-filters :is(button,a.button,summary) {
  min-height: 44px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
}
body#home .dd-home-ad-categories :is(button,a),
body.dd-advertisements-page #directory-filters .directory-categories a.button {
  font-size: 13px !important;
  white-space: normal !important;
  padding: 10px 8px !important;
  text-align: center;
}
body#home .dd-home-ad-filter :is(small,.dd-home-ad-source,.dd-home-location-status,.dd-home-taxonomy-copy),
body.dd-advertisements-page #directory-filters :is(small,.directory-range-unit,.directory-location-source,.directory-location-source a) {
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}
body.dd-advertisements-page #directory-filters .directory-filter-distance select { width: 100% !important; max-width: none !important; }
body.dd-advertisements-page #directory-filters .directory-filter-distance { width: 100% !important; max-width: none !important; }
body.dd-advertisements-page #directory-filters .directory-range-inputs { display: grid !important; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) !important; width: 100% !important; gap: 8px !important; }
body.dd-advertisements-page #directory-filters .directory-range-inputs :is(input,select) { width: 100% !important; min-width: 0 !important; max-width: none !important; padding-inline: 10px !important; }
@media (max-width: 620px) {
  body.dd-advertisements-page #community-main.advertiser-page { width: calc(100% - 32px) !important; }
  body.dd-advertisements-page #directory-filters .directory-categories > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Theme tokens also apply to the older homepage and directory components. */
html[data-theme="light"] body#home :is(.status-pill,.signature-line,.entry-card-subtitle,.entry-welcome-note li,.dd-listing-heading p) { color: var(--dd-muted-strong); }
html[data-theme="light"] body#home .coming-next a { color: var(--dd-text); background: var(--dd-surface); border-color: var(--dd-line); }
html[data-theme="light"] body#home .dd-home-ad-filter :is(label,legend,.dd-home-ad-label,.dd-home-ad-field > span),
html[data-theme="light"] body.dd-advertisements-page #directory-filters :is(label,legend,.directory-range-title,.directory-disclosure-copy) { color: var(--dd-label) !important; }
html[data-theme="light"] body#home .dd-home-ad-filter :is(input,select),
html[data-theme="light"] body.dd-advertisements-page #directory-filters :is(input,select) { background: var(--dd-input) !important; color: var(--dd-text) !important; border-color: var(--dd-line-strong) !important; }
html[data-theme="light"] body#home .dd-home-ad-categories :is(a,button),
html[data-theme="light"] body.dd-advertisements-page #directory-filters .directory-categories a.button { color: var(--dd-text) !important; background: var(--dd-surface) !important; border-color: var(--dd-line) !important; }
html[data-theme="light"] body.dd-advertisements-page #directory-filters :is(.directory-filter-panel,.directory-quickbar,.directory-filter-form,.directory-disclosure) { background: var(--dd-surface) !important; }
html[data-theme="light"] body#home :is(.dd-home-more-filters,.dd-home-ad-reset,.dd-home-location-button),
html[data-theme="light"] body.dd-advertisements-page #directory-filters :is(.directory-advanced-toggle,.directory-location-button,.directory-filter-reset,.directory-disclosure-button) { color: var(--dd-text) !important; background: var(--dd-surface-2) !important; border-color: var(--dd-line) !important; }

/* Dedicated destinations live in the header; four advertisement categories remain. */
html, body:not(.chat-active) { min-width: 0; }
body#home .dd-home-ad-categories,
body.dd-advertisements-page #directory-filters .directory-categories {
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
}
@media (max-width: 1200px) {
  body > header.dd-header { grid-template-columns: minmax(0,1fr) auto !important; gap: 8px !important; padding-block: 12px 8px !important; }
  body > header.dd-header > .header-actions { grid-column: 2; grid-row: 1; }
  body > header.dd-header > .site-navigation { grid-column: 1 / -1; width: 100% !important; justify-content: flex-start !important; }
  body > header.dd-header .brand-copy small { display: none !important; }
}
@media (max-width: 620px) {
  body#home .dd-home-ad-categories,
  body.dd-advertisements-page #directory-filters .directory-categories { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 600px) {
  body > header.dd-header > .site-navigation { column-gap: 2px !important; row-gap: 2px !important; }
  body > header.dd-header > .site-navigation > a { flex: 1 1 auto !important; }
  body > header.dd-header > .site-navigation > a:nth-child(-n+2) { flex: 1 1 calc(25% - 14px) !important; padding-inline: 3px !important; }
  body > header.dd-header > .site-navigation > a:nth-child(3),
  body > header.dd-header > .site-navigation > a:nth-child(4) { flex: 1 1 calc(25% + 10px) !important; padding-inline: 3px !important; }
}
