/*
 * Full-site responsive audit fixes
 * Safe overrides for legacy fixed widths, tables, dialogs and action buttons.
 */
html, body { min-width: 0; }
body.responsive-audited { overflow-x: hidden; }
body.responsive-audited #page,
body.responsive-audited .content,
body.responsive-audited .container-fluid,
body.responsive-audited .row { min-width: 0; max-width: 100%; }
body.responsive-audited .row { margin-left: 0; margin-right: 0; }
body.responsive-audited img,
body.responsive-audited video,
body.responsive-audited canvas,
body.responsive-audited iframe { max-width: 100%; }
body.responsive-audited .table-responsive,
body.responsive-audited .responsive-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
body.responsive-audited table { max-width: 100%; }
body.responsive-audited button,
body.responsive-audited .btn,
body.responsive-audited .newButton {
    white-space: nowrap;
    line-height: 1.35;
}
body.responsive-audited input,
body.responsive-audited select,
body.responsive-audited textarea { min-width: 0; }

/* active.html: table and pagination stay centered on phones */
body.active-page .contents-left {
    width: min(94%, 1100px);
    height: auto;
    margin: clamp(18px, 4vw, 48px) auto 24px !important;
    padding: 0;
}
body.active-page .active-table-scroll { margin: 0 auto; }
body.active-page .active-table-scroll table {
    width: 100%;
    min-width: 680px;
    margin: 0 auto;
}
body.active-page .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
body.active-page .pagination button,
body.active-page .pagination span { margin: 0 !important; }
body.active-page span { margin-left: 0; }
body.active-page .alerts {
    position: fixed;
    inset: 5vh 4vw auto;
    width: 92vw;
    max-width: 1100px;
    height: 90vh;
    margin: 0 auto;
}
body.active-page .backgrounds { position: fixed; inset: 0; width: 100%; height: 100%; }

/* situation.html: stable layout and inline service status */
body.situation-page .container-situation { margin-left: auto; margin-right: auto; }
body.situation-page .water-service-message {
    width: 100%;
    padding: 16px;
    border: 1px solid #d9e2e8;
    border-radius: 6px;
    background: #f7fafc;
    color: #52616b;
    text-align: center;
    line-height: 1.6;
}
body.situation-page .water-service-message.is-error {
    border-color: #e7c6c6;
    background: #fff8f8;
    color: #8a4b4b;
}

/* Dialogs and two-column legacy panels */
@media (max-width: 900px) {
    body.responsive-audited .let-feedReq,
    body.responsive-audited .right-cortrol,
    body.responsive-audited .basic,
    body.responsive-audited .nowMonitor,
    body.responsive-audited .nowFeed,
    body.responsive-audited .nowSell {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body.responsive-audited .light-contet { display: block; }
}

@media (max-width: 767px) {
    body.responsive-audited .content,
    body.responsive-audited .contents-left {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    body.responsive-audited h1,
    body.responsive-audited h2,
    body.responsive-audited h3 { overflow-wrap: anywhere; }
    body.responsive-audited .form-group { max-width: 100%; }
    body.responsive-audited .alerts {
        position: fixed !important;
        top: 3vh !important;
        left: 3vw !important;
        right: 3vw !important;
        width: 94vw !important;
        height: 94vh !important;
        padding: 14px !important;
    }
    body.active-page .contents-left { width: 100% !important; margin-top: 16px !important; }
    body.active-page .active-table-scroll { margin: 0 auto; }
    body.active-page .pagination button { flex: 1 1 72px; max-width: 110px; }
    body.active-page .pagination #pageInfo { flex: 1 1 100%; text-align: center; order: -1; }
}

@media (max-width: 420px) {
    body.responsive-audited button,
    body.responsive-audited .btn,
    body.responsive-audited .newButton { min-width: 0; }
    body.active-page .active-table-scroll table { min-width: 620px; }
}
