/* ==========================================================================
   Modern application shell (header, navigation, footer, page background).
   Loaded AFTER site.css and the DevExtreme theme, so it only overrides the
   page chrome. Individual pages and DevExtreme widgets are not restyled here.
   Change the colors below to re-theme the whole shell.
   ========================================================================== */

:root {
    --app-bg: #f5f7fb;
    --app-surface: #ffffff;
    --app-surface-2: #f0f3f9;
    --app-text: #162033;
    --app-muted: #5b6679;
    --app-border: #e2e7f0;
    --app-brand: #1f4e8c;
    --app-brand-hover: #173d6f;
    --app-brand-soft: #e6eefa;
    --app-on-brand: #ffffff;
    --app-focus: #4886c6;
    --app-radius: 10px;
    --app-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
}

/* ---------- page ---------- */
html {
    min-height: 100%;
}

body {
    margin-bottom: 0; /* site.css reserved room for an absolutely positioned footer */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--app-brand);
}

    a:hover {
        color: var(--app-brand-hover);
    }

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--app-focus);
    outline-offset: 2px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    z-index: 2000;
    background: var(--app-brand);
    color: var(--app-on-brand);
    padding: 8px 14px;
    border-radius: 8px;
}

    .skip-link:focus {
        top: 8px;
        color: var(--app-on-brand);
    }

.app-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 16px 32px;
}

/* ---------- header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .02), 0 6px 18px rgba(16, 24, 40, .05);
}

.app-nav {
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 16px;
    gap: 8px 24px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 8px;
}

    .app-brand #tob-image {
        width: 52px;
        height: auto;
        display: block;
    }

.app-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .app-title .TOB-navbar-header {
        font-size: 1.15rem;
        font-weight: 700;
        letter-spacing: -.2px;
        color: var(--app-text);
    }

    .app-title .TOB-navbar-sub-header {
        margin: 0;
        font-size: .8rem;
        font-weight: 500;
        font-style: normal;
        color: var(--app-muted);
    }

.app-nav .navbar-collapse {
    gap: 8px 16px;
}

.app-links {
    gap: 2px;
}

.app-nav .navbar-nav .nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--app-muted);
}

    .app-nav .navbar-nav .nav-link:hover,
    .app-nav .navbar-nav .nav-link.active {
        background: var(--app-brand-soft);
        color: var(--app-brand);
    }

.app-user {
    align-items: center;
    gap: 6px;
}

.app-welcome {
    color: var(--app-muted);
    font-weight: 500;
    padding: 8px 6px;
}

/* the logout form contains a button styled like a link */
.app-user form {
    margin: 0;
}

.app-user button.nav-link {
    border: 0;
    background: transparent;
    text-decoration: none;
}

.app-nav .navbar-nav .nav-link.app-btn {
    background: var(--app-brand);
    color: var(--app-on-brand);
}

    .app-nav .navbar-nav .nav-link.app-btn:hover {
        background: var(--app-brand-hover);
        color: var(--app-on-brand);
    }

.app-nav .navbar-toggler {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 6px 10px;
}

@media (min-width: 768px) {
    .app-nav .navbar-collapse {
        justify-content: space-between;
    }
}

/* Staff menu (six links) on narrower desktop windows: tighten it so the links and the user links fit on one row.
   The layout adds "app-nav-staff" for staff and administrators only; the vendor / public menu is not changed. */
@media (min-width: 768px) and (max-width: 1280px) {
    .app-nav.app-nav-staff {
        gap: 8px 12px;
    }

    .app-nav-staff .app-brand #tob-image {
        width: 44px;
    }

    .app-nav-staff .app-title .TOB-navbar-sub-header {
        display: none;
    }

    .app-nav.app-nav-staff .navbar-collapse {
        gap: 8px 8px;
    }

    .app-nav.app-nav-staff .navbar-nav .nav-link {
        padding: 8px 9px;
        font-size: .93rem;
    }
}

@media (max-width: 767.98px) {
    .app-nav .navbar-collapse {
        width: 100%;
        padding: 8px 0 4px;
        border-top: 1px solid var(--app-border);
        margin-top: 8px;
    }

    .app-links,
    .app-user {
        width: 100%;
    }
}

/* ---------- footer ---------- */
footer.app-footer {
    position: static; /* site.css pinned it to the bottom of the page */
    flex-shrink: 0;
    width: 100%;
    white-space: normal;
    line-height: 1.5;
    padding: 18px 16px;
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: .875rem;
}

    footer.app-footer .app-footer-inner {
        max-width: 1500px;
        margin: 0 auto;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 24px;
        justify-content: space-between;
    }

/* ==========================================================================
   Shared components: status pills, buttons, chips, cards.
   (Used by the bid list; reuse them on other pages.)
   ========================================================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
    white-space: nowrap;
}

    .pill::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: currentColor;
    }

    .pill.ok {
        background: #dff5ea;
        color: #127a4b;
    }

    .pill.warn {
        background: #fdf0d5;
        color: #8a5200;
    }

    /* red: a closed bid */
    .pill.bad {
        background: #fde4e4;
        color: #a12020;
    }

    .pill.info {
        background: #e6eefa;
        color: #1f4e8c;
    }

    .pill.muted {
        background: #eef1f6;
        color: #4b5568;
    }

.type-tag {
    font-size: .75rem;
    font-weight: 700;
    color: var(--app-brand);
    background: var(--app-brand-soft);
    padding: 2px 8px;
    border-radius: 6px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
    font-weight: 600;
    text-decoration: none;
}

    .chip:hover {
        color: var(--app-brand);
        border-color: var(--app-brand);
        text-decoration: none;
    }

    .chip.on {
        background: var(--app-brand);
        border-color: var(--app-brand);
        color: var(--app-on-brand);
    }

/* ---------- bid list page ---------- */
.bl-page {
    max-width: 980px;
    margin: 0 auto;
}

.bl-head {
    margin-bottom: 18px;
}

    .bl-head h1 {
        margin: 0 0 4px;
        font-size: 1.9rem;
        letter-spacing: -.4px;
    }

    .bl-head p {
        margin: 0;
        color: var(--app-muted);
    }

.bl-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 18px;
}

.bl-search {
    flex: 1 1 280px;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 0 12px;
    box-shadow: var(--app-shadow);
}

    .bl-search:focus-within {
        border-color: var(--app-focus);
        box-shadow: 0 0 0 3px rgba(72, 134, 198, .25);
    }

    .bl-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        padding: 10px 0;
        font: inherit;
        color: var(--app-text);
    }

.bl-count {
    color: var(--app-muted);
    font-size: .9rem;
    margin-bottom: 12px;
}

.bl-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--app-shadow);
    transition: transform .12s ease, border-color .12s ease;
}

    .bl-card:hover {
        transform: translateY(-2px);
        border-color: var(--app-focus);
    }

.bl-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 6px;
}

.bl-due {
    margin-left: auto;
    font-size: .9rem;
    font-weight: 650;
    color: var(--app-muted);
}

    .bl-due.soon {
        color: #8a5200;
    }

.bl-card h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: -.2px;
}

    .bl-card h2 a {
        color: var(--app-text);
        text-decoration: none;
    }

        .bl-card h2 a:hover {
            color: var(--app-brand);
            text-decoration: underline;
        }

.bl-desc {
    margin: 8px 0 12px;
    color: var(--app-muted);
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bl-tag {
    background: var(--app-surface-2);
    color: var(--app-muted);
    padding: 2px 9px;
    border-radius: 6px;
    font-size: .8rem;
}

.bl-empty {
    text-align: center;
    padding: 48px 16px;
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: 14px;
    color: var(--app-muted);
}

/* ---------- buttons ---------- */
.abtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--app-brand);
    border-radius: var(--app-radius);
    background: var(--app-brand);
    color: var(--app-on-brand);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

    .abtn:hover {
        background: var(--app-brand-hover);
        border-color: var(--app-brand-hover);
        color: var(--app-on-brand);
        text-decoration: none;
    }

    .abtn.sec {
        background: var(--app-surface);
        border-color: var(--app-border);
        color: var(--app-text);
    }

        .abtn.sec:hover {
            background: var(--app-surface-2);
            border-color: var(--app-focus);
            color: var(--app-text);
        }

    .abtn.sm {
        padding: 6px 12px;
        font-size: .875rem;
        border-radius: 8px;
    }

/* ---------- bid detail page ---------- */
.bd-page {
    max-width: 1500px;
    margin: 0 auto;
}

.bd-crumbs {
    color: var(--app-muted);
    font-size: .875rem;
    margin-bottom: 12px;
}

.bd-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fdf0d5;
    color: #8a5200;
    font-weight: 600;
}

.bd-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 20px;
    margin-bottom: 20px;
}

.bd-title {
    flex: 1 1 420px;
    min-width: 0;
}

    .bd-title .bd-eyebrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

    .bd-title h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.25;
        letter-spacing: -.4px;
        overflow-wrap: anywhere;
    }

.bd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .bd-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bd-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--app-shadow);
    margin-bottom: 20px;
}

    .bd-panel h2 {
        margin: 0 0 12px;
        font-size: .8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .6px;
        color: var(--app-muted);
    }

    .bd-panel .bd-panel-head {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }

        .bd-panel .bd-panel-head h2 {
            margin: 0;
        }

        .bd-panel .bd-panel-head .bd-panel-actions {
            margin-left: auto;
            display: flex;
            gap: 8px;
        }

.bd-desc {
    margin: 0 0 14px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.bd-side {
    position: static; /* not sticky: a sticky box floated over the full-width download history grid */
}

@media (max-width: 900px) {
    .bd-side {
        position: static;
    }
}

.bd-facts {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px 12px;
    margin: 0;
}

    .bd-facts dt {
        color: var(--app-muted);
        font-weight: 500;
    }

    .bd-facts dd {
        margin: 0;
        font-weight: 600;
    }

        .bd-facts dd small {
            display: block;
            color: var(--app-muted);
            font-weight: 400;
        }

.bd-files {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .bd-files li {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 0;
        border-bottom: 1px solid var(--app-border);
    }

        .bd-files li:first-child {
            padding-top: 2px;
        }

        .bd-files li:last-child {
            border-bottom: 0;
            padding-bottom: 2px;
        }

.bd-ficon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .3px;
    background: #6b7689;
}

    .bd-ficon.pdf {
        background: #d64545;
    }

    .bd-ficon.xls {
        background: #1f8f55;
    }

    .bd-ficon.doc {
        background: #2f6fd0;
    }

.bd-finfo {
    flex: 1 1 auto;
    min-width: 0;
}

    .bd-finfo .nm {
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .bd-finfo .ds {
        color: var(--app-muted);
        font-size: .9rem;
        overflow-wrap: anywhere;
    }

    .bd-finfo .ac {
        font-size: .8rem;
        font-weight: 600;
        color: var(--app-muted);
    }

        .bd-finfo .ac.locked {
            color: #8a5200;
        }

.bd-files .abtn {
    flex: 0 0 auto;
}

.bd-empty {
    color: var(--app-muted);
    padding: 8px 0;
}

/* ---------- staff pages (summary tiles, page toolbar) ---------- */
.sp-page {
    max-width: 1400px;
    margin: 0 auto;
}

.sp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin-bottom: 18px;
}

    .sp-head h1 {
        margin: 0;
        font-size: 1.9rem;
        letter-spacing: -.4px;
    }

    .sp-head p {
        margin: 2px 0 0;
        color: var(--app-muted);
    }

    .sp-head .sp-actions {
        margin-left: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

.sp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.sp-stat {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: var(--app-shadow);
}

    .sp-stat .n {
        font-size: 1.75rem;
        font-weight: 700;
        letter-spacing: -.5px;
        line-height: 1.2;
    }

    .sp-stat .l {
        color: var(--app-muted);
        font-size: .9rem;
    }

    .sp-stat.attn .n {
        color: #8a5200;
    }

.sp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    margin-bottom: 12px;
}

.sp-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--app-text);
    font-weight: 500;
    cursor: pointer;
}

    .sp-check input {
        width: 18px;
        height: 18px;
        accent-color: var(--app-brand);
    }

.sp-gridcard {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: var(--app-shadow);
    overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* Grids that should always fit their container: let long words (emails, names) wrap */
.sp-grid-fit .dx-datagrid .dx-row > td {
    overflow-wrap: anywhere;
}

.sp-grid-fit .dx-datagrid {
    max-width: 100%;
}

/* Bid detail: a panel that spans both columns of .bd-grid (the download history grid) */
.bd-grid > .bd-wide {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

/* Tall download-history grid (its height, 70vh, is set on the grid itself): never shorter than 420px */
#grid-bid-file-delivery-history.bd-tall-grid {
    min-height: 420px;
}

/* The other tall grids on the bid page (registered vendors, email notices) */
.bd-tall-grid {
    min-height: 420px;
}

/* Bid page: tabs that switch between the grids (staff) */
.bd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-tab {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-muted);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

    .bd-tab:hover {
        background: var(--app-surface-2);
        color: var(--app-text);
    }

    .bd-tab:focus-visible {
        outline: 2px solid var(--app-focus);
        outline-offset: 2px;
    }

    .bd-tab.on {
        background: var(--app-brand);
        border-color: var(--app-brand);
        color: var(--app-on-brand);
    }

.bd-tabpane[hidden] {
    display: none;
}

.bd-tabnote {
    margin: 0 0 10px;
    color: var(--app-muted);
    font-size: .88rem;
}

/* ---------- Staff dashboard ---------- */
.db-section {
    margin: 0 0 8px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--app-muted);
}

.db-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

    .db-grid > .bd-panel {
        margin-bottom: 0;
        min-width: 0;
    }

.db-span-2 { grid-column: span 2; }
.db-span-3 { grid-column: span 3; }
.db-span-4 { grid-column: span 4; }
.db-span-6 { grid-column: 1 / -1; }

@media (max-width: 1000px) {
    .db-span-2,
    .db-span-3,
    .db-span-4 {
        grid-column: 1 / -1;
    }
}

.db-avg {
    padding: 12px 0;
    border-bottom: 1px solid var(--app-border);
}

    .db-avg .n {
        margin-top: 6px;
        font-size: 2rem;
        font-weight: 700;
        letter-spacing: -.5px;
        line-height: 1.15;
    }

        .db-avg .n small {
            font-size: 1rem;
            font-weight: 600;
            color: var(--app-muted);
        }

    .db-avg .l {
        color: var(--app-muted);
        font-size: .88rem;
    }

.db-note {
    margin: 10px 0 0;
    color: var(--app-muted);
    font-size: .84rem;
}

.db-details {
    margin-top: 8px;
}

    .db-details summary {
        cursor: pointer;
        color: var(--app-brand);
        font-size: .88rem;
        font-weight: 600;
    }

.db-tablewrap {
    overflow-x: auto;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

    .db-table th,
    .db-table td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--app-border);
        text-align: left;
        vertical-align: top;
    }

    .db-table thead th {
        font-size: .78rem;
        font-weight: 700;
        color: var(--app-muted);
        vertical-align: bottom;
        white-space: normal;
    }

    .db-table tbody th {
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .db-table tbody tr:last-child th,
    .db-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .db-table .num {
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .db-table thead .num {
        white-space: normal;
    }

    .db-table .db-barcol {
        width: 34%;
        min-width: 120px;
    }

.db-sub {
    font-weight: 400;
    font-size: .85rem;
    color: var(--app-muted);
}

.db-nowrap {
    white-space: nowrap;
}

/* Small category tags under a vendor in the top-10 list: "Construction 5" */
.db-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.db-cat {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--app-surface-2);
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.5;
}

    .db-cat b {
        margin-left: 3px;
        font-weight: 700;
        color: var(--app-text);
    }

/* A number with a bar behind it showing its size against the largest value in the column */
.db-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-bar-fill {
    display: block;
    flex: 0 0 auto;
    height: 12px;
    min-width: 2px;
    max-width: calc(100% - 44px);
    border-radius: 0 4px 4px 0;
    background: #2a78d6;
}

.db-bar-n {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Create / Edit bid form: the "registered vendors" grid under the bid fields */
.bd-form-grid {
    min-height: 380px;
}

/* Tall staff grids (their height, 75vh, is set on the grid itself): never shorter than 480px */
.sp-tall-grid {
    min-height: 480px;
}

/* Grid footer "Count: N": pinned to the far right edge of the footer row, whatever column it belongs to.
   (DevExtreme cannot draw a summary inside the buttons column, so it is positioned with CSS instead.) */
.dx-datagrid-total-footer {
    position: relative;
}

    .dx-datagrid-total-footer .dx-row > td {
        height: 38px;
    }

.dx-datagrid-summary-item.grid-count-right {
    position: absolute;
    right: 16px;
    white-space: nowrap;
    font-weight: 600;
}

/* ---------- simple forms (Announcement page) ---------- */
.fm-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

label.sp-check.fm-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 20px;
}

.fm-label {
    margin: 0;
    font-weight: 600;
}

.fm-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c9d1de;
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    font: inherit;
}

    .fm-input:focus {
        outline: 0;
        border-color: var(--app-focus);
        box-shadow: 0 0 0 3px rgba(72, 134, 198, .25);
    }

textarea.fm-input {
    resize: vertical;
    min-height: 120px;
}

.fm-hint {
    color: var(--app-muted);
    font-size: .875rem;
}

.fm-error,
.fm-errors {
    color: #b3261e;
    font-size: .875rem;
    font-weight: 600;
}

    .fm-errors ul {
        margin: 0 0 12px;
        padding-left: 18px;
    }

.fm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* ---------- home page pop-up message ---------- */
dialog.ha-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: 0 24px 64px rgba(16, 24, 40, .35);
    overflow: hidden;
}

    dialog.ha-dialog[open] {
        display: flex;
        flex-direction: column;
    }

    dialog.ha-dialog::backdrop {
        background: rgba(16, 24, 40, .55);
    }

.ha-head {
    padding: 18px 24px;
    background: var(--app-brand);
    color: var(--app-on-brand);
}

.ha-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ha-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.ha-message {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 1.02rem;
    line-height: 1.55;
}

.ha-foot {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--app-border);
}
