/* Shared layout and interactions. Palette remains owned by each theme. */
body[data-theme-area="frontend"] {
    --df-type-page-title: clamp(26px, 2.2vw, 32px);
    --df-type-section-title: 20px;
}
body[data-theme-area="frontend"] :is(.breadcrumbs, .breadcrumb-bar) {
    padding-block: 10px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    background: transparent;
}
body[data-theme-area="frontend"] :is(.page-head, .page-head-compact, .section-head, .panel-head, .catalog-head) { background-color: transparent; }
body[data-theme-area="frontend"] .page-head .page-lead { max-width: none; font-size: 15px; line-height: 1.75; }
body[data-theme-area="frontend"] :is(.section-head, .panel-head) { gap: 12px; align-items: baseline; }
body[data-theme-area="frontend"] :is(.query-bar, .compact-query-bar) { box-shadow: none; }
body[data-theme-area="frontend"] .query-grid-compact { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
body[data-theme-area="frontend"] .query-grid-compact > .query-control { flex: 1 1 160px; }
body[data-theme-area="frontend"] .query-grid-compact > .query-control:has(input[name="keyword"]) { flex: 3 1 280px; }
body[data-theme-area="frontend"] .query-grid-compact > .d-flex { flex: 0 0 auto; align-items: end; }
body[data-theme-area="frontend"] .query-grid > .query-control { min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
body[data-theme-area="frontend"] :is(.form-control, .form-select) { min-height: 40px; }
body[data-theme-area="frontend"] :is(.form-control, .form-select)::placeholder { opacity: 1; color: var(--ink-muted, #64748b); }
body[data-theme-area="frontend"] :is(.btn, button, input, select, textarea, summary, a):focus-visible { outline: 2px solid var(--border-focus, var(--accent, #2563eb)); outline-offset: 3px; }
body[data-theme-area="frontend"] .btn:not(.btn-sm) { min-height: 40px; }
body[data-theme-area="frontend"] :is(.catalog-title, .package-line-title, .tool-card-title, .writeup-card-title) { overflow-wrap: anywhere; }
body[data-theme-area="frontend"].route-home .dfb-page > .dfb-container { max-width: 1440px; margin-inline: auto; }
body[data-theme-area="frontend"].route-home .df-hero :is(.search-shell, .search-main) { min-width: 0; }
body[data-theme-area="frontend"].route-home .df-hero .home-search-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
body[data-theme-area="frontend"].route-home .df-hero .home-search-button { width: auto; min-width: 76px; min-height: 46px; margin: 0; }
body[data-theme-area="frontend"] .tool-index-meta-row { flex: 0 0 100%; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
body[data-theme-area="frontend"] .tool-index-meta-row .page-meta { margin: 0; }
@media (max-width: 768px) {
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .dfb-header .dfb-header-inner { grid-template-columns: minmax(0, 1fr) 44px 40px !important; gap: 8px !important; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .dfb-header-inner > .site-search-trigger { grid-row: 1 !important; grid-column: 2 !important; margin: 0; width: 44px; min-height: 44px; padding: 0; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .dfb-header-inner > .dfb-mobile-toggle { grid-column: 3 !important; min-height: 44px; height: 44px !important; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .dfb-brand-text > span { display: none !important; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .dfb-header.is-open .dfb-nav { max-height: 50dvh; overflow-y: auto !important; box-shadow: none !important; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) :is(.form-control, .form-select) { font-size: 16px !important; min-height: 44px; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .query-grid-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .query-grid-compact .form-select { width: 100%; max-width: none; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .query-grid-compact .query-control:has(input[name="keyword"]) { grid-column: 1 / -1; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .query-grid-compact > .d-flex { grid-column: 1 / -1; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .query-grid-compact > .d-flex .btn { flex: 1; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .btn { min-height: 44px; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .site-search-close { width: 44px; height: 44px; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .site-search-submit, body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .site-search-scope select { min-height: 40px; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark).route-home .df-hero .home-search-shell { grid-template-columns: minmax(0, 1fr); }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark).route-home .df-hero .home-search-button { width: 100%; }
    body[data-theme-area="frontend"]:is(.theme-light, .theme-dark) .tool-index-meta-row { flex-wrap: wrap; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    body[data-theme-area="frontend"] :is(.dfb-page, .surface, .catalog-line, .df-entry, .feature-band) { animation: none !important; }
    body[data-theme-area="frontend"] :is(.btn, .dfb-user-menu-popover, .dfb-theme-switcher-menu) { transition-duration: 0ms !important; }
}
@media (max-width: 768px) {
    body[data-theme-area="frontend"].route-home .df-hero .df-hero-title { display: block !important; font-size: 32px !important; line-height: 1.25; margin: 0 0 8px; }
    body[data-theme-area="frontend"].route-home .df-hero .df-hero-lead { display: block !important; font-size: 15px; margin: 0 0 12px; }
    body[data-theme-area="frontend"].route-home .df-hero-entries { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
    body[data-theme-area="frontend"].route-home .df-entry { padding: 12px 10px; }
    body[data-theme-area="frontend"].route-home .df-entry-kicker { display: none; }
    body[data-theme-area="frontend"].route-home .df-entry h2 { font-size: 15px !important; line-height: 1.5; margin: 0 0 6px; }
    body[data-theme-area="frontend"].route-home .df-entry p { font-size: 12px !important; line-height: 1.6; min-height: 38px; margin: 0; }
    body[data-theme-area="frontend"].route-home .df-entry .section-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
}
