/* Shared responsive refinements for public, member and administrator pages. */
.community-theme .heritage-banner {
    background-position: center, right top;
}
.hero-landscape { background-position: right top; }
.community-theme h1, .community-theme h2, .admin-theme h1,
.panel, .admin-main, .admin-content { overflow-wrap: break-word; min-width: 0; }
.table-responsive { max-width: 100%; -webkit-overflow-scrolling: touch; }
.member-workspace-nav form, .member-business-table form { margin-bottom: 0; }

@media (max-width: 767.98px) {
    .community-theme, .admin-theme { font-size: .875rem; line-height: 1.55; }
    .community-theme .container { padding-left: 16px; padding-right: 16px; }
    .community-theme .community-section, .community-theme .section { padding: 30px 0; }
    .community-theme .panel, .admin-theme .panel { padding: 16px; border-radius: 12px; }
    .community-theme .page-banner { padding: 25px 0 28px; }
    .community-theme .heritage-banner { background-position: center, right top; }
    .community-theme .page-banner h1 {
        font-size: clamp(1.65rem, 6vw, 2.1rem);
        line-height: 1.18;
        overflow-wrap: anywhere;
    }
    .community-theme .page-banner p { font-size: .82rem; margin-bottom: 0; }
    .community-theme .page-banner .eyebrow { font-size: .62rem; margin-top: 0; letter-spacing: .13em; }
    .community-theme h2, .community-theme .section-head h2 { font-size: 1.5rem; line-height: 1.25; }
    .community-theme h3, .admin-theme h3 { font-size: 1.1rem; }
    .community-theme .btn, .admin-theme .btn {
        font-size: .75rem; padding: 8px 12px; min-height: 38px;
        gap: 8px; white-space: normal; max-width: 100%; line-height: 1.35;
    }
    .community-theme .btn svg, .admin-theme .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
    .section-head { gap: 12px; flex-wrap: wrap; align-items: center; }
    .section-head .btn { flex-shrink: 0; }
    .member-workspace-nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px !important;
    }
    .member-workspace-nav .btn { width: 100%; font-size: .72rem; padding: 8px; }
    .member-workspace-nav form { width: 100%; margin: 0 !important; }
    .community-theme .metric, .admin-theme .metric { padding: 14px; height: 100%; }
    .community-theme .metric strong, .member-workspace-nav + .row .metric strong,
    .admin-theme .metric strong { font-size: 1.65rem; line-height: 1.3; }
    .metric small, .metric a { font-size: .73rem; }
    .community-theme .table, .admin-theme .table { font-size: .75rem; line-height: 1.45; }
    .community-theme .table th, .community-theme .table td,
    .admin-theme .table th, .admin-theme .table td { padding: 9px 8px; }
    .badge-soft { font-size: .65rem; padding: 5px 7px; }
    .admin-theme .admin-content { padding: 16px 12px; }
    .admin-theme h1 { font-size: 1.5rem; }
    .admin-theme .admin-top { padding: 12px; gap: 10px; flex-wrap: wrap; font-size: .75rem; }
    .admin-theme .admin-top > div { display: flex; align-items: center; flex-wrap: wrap; }
    .admin-theme .sidebar { padding: 12px; }
    .admin-theme .sidebar nav.is-open { max-height: 70vh; overflow-y: auto; }
    .admin-theme .sidebar nav a { font-size: .76rem; padding: 9px; }
    .admin-theme .table-responsive > table { min-width: 580px; }
    .community-theme label, .admin-theme label, .form-text { font-size: .78rem; }
    /* 16px text inputs prevent automatic zoom on iOS. */
    .community-theme .form-control, .community-theme .form-select,
    .admin-theme .form-control, .admin-theme .form-select { font-size: 16px; padding: 9px 11px; max-width: 100%; }
    .community-theme img, .admin-theme img { max-width: 100%; }
}

@media (max-width: 575.98px) {
    /* Business records become compact cards, with actions on a separate row. */
    .member-business-table, .member-business-table tbody { display: block; width: 100%; }
    .member-business-table thead { display: none; }
    .member-business-table tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line);
    }
    .member-business-table tbody tr:last-child { border-bottom: 0; }
    .member-business-table tbody td { display: block; padding: 0 !important; border: 0; align-self: start; }
    .member-business-table tbody td:first-child { font-size: .85rem; }
    .member-business-table tbody td:last-child { grid-column: 1 / -1; }
    .member-business-table tbody td[colspan] { grid-column: 1 / -1; }
    .member-business-table .btn { font-size: .72rem; padding: 7px 12px; min-height: 34px; }
    .member-business-table .badge-soft { display: inline-block; white-space: normal; }
    .community-theme .hero-landscape { background-position: right top; }
    .community-theme .heritage-hero h1 { font-size: 2rem; line-height: 1.12; }
    .community-theme .hero-content p { font-size: .85rem; }
}
