/* LAYOUTREF batch 3. B0 sets the effective viewport: tablets use desktop rules. */
html body.unified-page .results-dialog :is(.results-count-summary, .results-sort-control, .results-sort-button, .results-filter-controls .compact-folder-btn, .results-refine-action) {
    box-sizing: border-box;
    height: var(--control-h-md) !important;
    min-height: var(--control-h-md) !important;
    border-radius: var(--radius-control) !important;
    font-size: var(--control-fs-sm) !important;
}
html body.unified-page .results-dialog .results-info,
html body.unified-page .results-dialog .results-filter-controls,
html body.unified-page .results-dialog .compact-folder-text {
    gap: var(--gap-inline) !important;
}
html body.unified-page .results-dialog .results-sort-control {
    display: flex;
    padding: 0;
    border: 0;
    background: transparent !important;
}
html body.unified-page .results-dialog .results-sort-control > span {
    display: none;
}
html body.unified-page .results-dialog .results-sort-button {
    min-width: 0;
    padding-inline: var(--space-3);
}
html body.unified-page .results-dialog :is(.compact-folder-caption, .compact-folder-count, .compact-folder-value, .result-sort-option) {
    font-size: var(--control-fs-sm) !important;
}
html body.unified-page .results-dialog .compact-filter-menu {
    gap: var(--space-1) !important;
    padding: var(--space-1) !important;
    border-radius: var(--radius-control) !important;
}
html body.unified-page .results-dialog .compact-filter-menu > button {
    min-height: var(--control-h-sm) !important;
    border-radius: var(--radius-control) !important;
    padding: var(--space-2) var(--space-3) !important;
}
html body.unified-page .results-dialog :is(.results-header, .refine-search-panel) {
    padding-inline: var(--page-gutter) !important;
}
html body.unified-page .results-dialog .results-grid {
    gap: var(--card-gap);
    padding: var(--space-4) var(--page-gutter) var(--space-6);
}
html body.unified-page .results-dialog .result-card {
    padding: var(--card-pad);
    gap: var(--space-3);
    border-radius: var(--radius-card);
}
html body.unified-page .results-dialog .result-card .card-header {
    gap: var(--gap-inline);
    margin-bottom: 0;
}
html body.unified-page .search-filter-dialog .filter-keyword-input-row {
    gap: var(--gap-inline);
}
html body.unified-page .search-filter-dialog :is(.filter-keyword-input, .filter-keyword-add-btn, .saved-filter-select, .sf-delete-btn) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
    border-radius: var(--radius-control);
    font-size: 14px;
}
html body.unified-page .search-filter-dialog .filter-keyword-input {
    min-width: 0;
}
html body.unified-page .search-filter-dialog .filter-keyword-add-btn {
    padding-inline: var(--space-4);
    background: var(--action-secondary-bg) !important;
    color: var(--action-secondary-fg) !important;
    border: 1px solid var(--action-secondary-border);
}
html body.unified-page .search-filter-dialog .amount-preset-row {
    gap: var(--gap-inline) !important;
    margin-top: var(--space-2) !important;
}
html body.unified-page .search-filter-dialog .amount-preset-btn {
    min-height: var(--control-h-sm);
    border-radius: var(--radius-control);
}
html body.unified-page .search-filter-dialog .amount-preset-btn:last-child,
html body.unified-page .search-filter-dialog .sf-delete-btn {
    color: #b91c1c !important;
}
html[data-theme="dark"] body.unified-page .search-filter-dialog .amount-preset-btn:last-child,
html[data-theme="dark"] body.unified-page .search-filter-dialog .sf-delete-btn {
    color: #fca5a5 !important;
}
html body.unified-page .results-dialog .no-results {
    padding: var(--space-8) var(--page-gutter);
}
html body.unified-page .results-dialog .no-results .hint {
    margin-top: var(--space-2);
    color: #64748b;
    font-size: var(--control-fs-sm);
    line-height: 1.5;
}
html[data-theme="dark"] body.unified-page .results-dialog .no-results .hint {
    color: #cbd5e1;
}
html body.unified-page .no-results-filter-action {
    margin-top: var(--space-4);
    padding: 0 var(--space-3);
    min-height: var(--control-h-md);
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--action-tertiary-fg);
    font-size: var(--control-fs-md);
    cursor: pointer;
}
html body.unified-page :is(.no-results-filter-action, .home-card-login):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
html body.unified-page .home-card-login {
    display: none;
}
@media (max-width: 767px) {
    html body.unified-page .results-dialog .results-header {
        grid-template-columns: minmax(0, 1fr) var(--icon-btn);
    }
    html body.unified-page .results-dialog .results-info {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
    html body.unified-page .results-dialog .results-refine-action {
        min-width: 0;
    }
}
@media (min-width: 768px) {
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) .search-bookmark-row {
        padding-right: var(--home-column-scroll-gutter, 0px) !important;
    }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection :is(.search-box, .search-buttons) {
        gap: var(--gap-inline) !important;
    }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection .search-buttons {
        width: 100% !important;
    }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection :is(#searchKeyword, #searchBtn, #shortSearchToggleBtn, #licenseFilterBtn, .compact-folder-btn, .compact-status-control, .compact-type-control, #homePrivateBidCreateAction, #infoPanelToggleBtn) {
        box-sizing: border-box;
        height: var(--control-h-md) !important;
        min-height: var(--control-h-md) !important;
        border-radius: var(--radius-control) !important;
        font-size: var(--control-fs-md) !important;
    }
    /* Keep the approved desktop control size when the older dark sheet loads.
       Its two-ID selector otherwise raises this button from 40px to 42px. */
    html[data-theme="dark"]:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection .search-buttons #licenseFilterBtn {
        height: var(--control-h-md) !important;
        min-height: var(--control-h-md) !important;
    }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection { padding: 0 !important; }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection .search-panel {
        gap: var(--space-3) !important;
        padding: var(--space-4) !important;
        border-radius: var(--radius-card) !important;
    }
    /* Only the main column owns scrolling. Reserving gutters on two nested
       containers previously displaced the cards from the search panel. */
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #dashboardSection {
        scrollbar-gutter: auto;
    }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #dashboardSection .dash-col-main {
        scrollbar-gutter: stable;
    }
    html:not([data-device-class="phone"]) body.unified-page #homeModules .dash-panel-header,
    html:not([data-device-class="phone"]) body.unified-page .search-bookmark-side-header {
        min-height: 48px;
        padding: var(--space-2) var(--space-3);
        gap: var(--gap-inline);
        box-sizing: border-box;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border-light);
    }
    html:not([data-device-class="phone"]) body.unified-page .search-bookmark-side-header {
        display: flex;
        align-items: center;
        font-size: 16px;
        font-weight: 600;
    }
    html:not([data-device-class="phone"]) body.unified-page #homeModules #dashCalendarPanel .dash-panel-header {
        margin: 0 0 var(--space-2);
        padding: var(--space-2) var(--space-3);
    }
    html:not([data-device-class="phone"]) body.unified-page #homeModules .dash-panel-title {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    html:not([data-device-class="phone"]) body.unified-page #homeModules .home-week-actions {
        gap: var(--space-1);
    }
    html:not([data-device-class="phone"]) body.unified-page #homeModules .dash-panel-action {
        flex: none;
        box-sizing: border-box;
        height: var(--control-h-sm);
        min-height: var(--control-h-sm);
        border-radius: var(--radius-control);
        font-size: var(--control-fs-sm);
        white-space: nowrap;
    }
    html:not([data-device-class="phone"]) body.unified-page #homeWeekMonthToggle {
        width: var(--control-h-sm);
        min-width: var(--control-h-sm);
        padding: 0;
        font-size: 0 !important;
    }
    html:not([data-device-class="phone"]) body.unified-page #homeWeekMonthToggle::before {
        content: '';
        display: inline-block;
        width: 7px;
        height: 7px;
        border-left: 2px solid currentColor;
        border-top: 2px solid currentColor;
        transform: translateY(2px) rotate(45deg);
    }
    html:not([data-device-class="phone"]) body.unified-page #homeWeekMonthToggle[aria-expanded="false"]::before {
        transform: translateY(-2px) rotate(225deg);
    }
    html:not([data-device-class="phone"]) body.unified-page .home-card-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: var(--control-h-sm);
        padding: 0 var(--space-3);
        border: 0;
        border-radius: var(--radius-control);
        background: transparent;
        color: var(--action-tertiary-fg);
        font-size: var(--control-fs-sm);
        cursor: pointer;
    }
}
html[data-device-class="phone"] body.unified-page .home-card-login {
    display: none;
}

/* #450-100: adopted search cards; retain the original topic/paging/history DOM. */
html body.unified-page #resultsSection.ui-flow {
    --flow-canvas:#f6f7f9; --flow-surface:#fff; --flow-border:#e3e6eb;
    --flow-text:#12151a; --flow-text-secondary:#4b5361;
}
html[data-theme="dark"] body.unified-page #resultsSection.ui-flow {
    --flow-canvas:#0c0e11; --flow-surface:#14171b; --flow-border:#353b44;
    --flow-text:#eceef2; --flow-text-secondary:#a7aeba;
}
html body.unified-page #resultsSection.ui-flow .results-header {
    gap:8px; padding:8px 12px !important; border-bottom:1px solid var(--flow-border);
}
html body.unified-page #resultsSection.ui-flow #resultsTitle {
    font-size:18px !important; line-height:1.4 !important; overflow-wrap:anywhere;
}
html body.unified-page #resultsSection.ui-flow .results-info { gap:6px !important; }
html body.unified-page #resultsSection.ui-flow .results-grid {
    gap:8px; padding:8px;
    max-width:1440px; margin-inline:auto; width:100%; box-sizing:border-box;
}
@media (min-width:1600px) {
    html body.unified-page #resultsSection.ui-flow #resultsGrid {
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    }
}
html body.unified-page #resultsSection.ui-flow .result-card {
    padding:6px 8px; gap:3px; border:1px solid var(--flow-border); border-radius:8px;
    box-shadow:none; min-width:0; background:var(--flow-surface); color:var(--flow-text);
}
html body.unified-page #resultsSection.ui-flow .result-card .card-header {
    min-height:24px; height:auto; margin:0; align-items:center; gap:4px;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-title {
    margin:0; padding:0; font-size:16px; line-height:20px; min-width:0;
    white-space:normal; overflow:hidden; text-overflow:ellipsis; overflow-wrap:anywhere;
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-info {
    display:grid; grid-template-columns:minmax(0,1fr); gap:1px;
    padding:0; min-width:0; font-size:13px; line-height:1.5;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-info .info-row {
    font-size:10.5px !important; line-height:15px;
}
html body.unified-page #resultsSection.ui-flow #resultsGrid .result-card .deadline {
    font-size:10.5px !important; line-height:15px;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-info .info-value.budget {
    font-size:14px;
}
html body.unified-page #resultsSection.ui-flow .result-card :is(.info-row,.info-value) {
    min-width:0; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere;
}
html body.unified-page #resultsSection.ui-flow .result-card .info-row { align-items:baseline; gap:6px; }
html body.unified-page #resultsSection.ui-flow .result-card .card-summary-primary .budget {
    flex:0 0 auto; max-inline-size:65%; text-align:end; line-height:18px;
}
html body.unified-page #resultsSection.ui-flow .result-card :is(.card-summary-org, .card-summary-reference .info-value) {
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-summary-reference .info-value {
    flex:0 1 auto; color:var(--flow-text-secondary);
}
html body.unified-page #resultsSection.ui-flow .result-card .card-summary-reference .info-value + .info-value {
    border-inline-start:1px solid var(--flow-border); padding-inline-start:6px;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-detail-metadata { display:none; }
html body.unified-page #resultsSection.ui-flow .result-card .card-bookmark-btn {
    min-inline-size:28px; min-block-size:26px;
}
html body.unified-page #resultsSection.ui-flow .result-card .card-bookmark-btn:not(.active,:hover),
html body.unified-page #resultsSection.ui-flow .result-card .card-attachment-count {
    color:var(--flow-text-secondary);
}
html body.unified-page #resultsSection.ui-flow .result-card .card-attachment-count {
    font-size:10.5px; white-space:nowrap;
}
html body.unified-page #resultsSection.ui-flow .result-card .search-match-comment { margin:0; }
html body.unified-page #resultsSection.ui-flow .result-card .award-summary { grid-column:1/-1; }
html body.unified-page #resultsSection.ui-flow :is(.result-topic-tabs,.results-filter-controls) { flex-wrap:wrap; gap:4px; }
html body.unified-page #resultsSection.ui-flow .result-topic-tab {
    min-height:var(--section-header-height); padding:2px 8px; line-height:20px;
    border-radius:4px; box-shadow:none;
}
html body.unified-page #resultsSection.ui-flow .result-topic-tab[aria-selected="true"] {
    color:var(--action-tertiary-fg); background:var(--action-secondary-bg);
    box-shadow:inset 0 -2px 0 currentColor; border-color:var(--action-secondary-border);
}
html body.unified-page #resultsSection.ui-flow .search-type-progress {
    --progress-surface:var(--flow-canvas); --progress-panel:var(--flow-surface);
    --progress-line:var(--flow-border); --progress-text:var(--flow-text); --progress-muted:var(--flow-text-secondary);
}
@media (max-width:767px) {
    html body.unified-page #resultsSection.ui-flow .results-grid { padding:8px; }
    html body.unified-page #resultsSection.ui-flow .results-info { min-width:0; }
    html body.unified-page #resultsSection.ui-flow .results-heading { min-width:0; }
    html body.unified-page #resultsSection.ui-flow .result-card .card-bookmark-btn {
        min-inline-size:44px; min-block-size:44px;
    }
}
html body.unified-page #resultsSection.ui-flow .search-type-progress { padding:8px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__header { gap:4px; margin-bottom:8px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__group { padding:8px; border-radius:8px; box-shadow:none; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__group-heading { margin-bottom:4px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__group-heading h4 { min-height:var(--section-header-height); display:flex; align-items:center; font-size:13px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__topic { grid-template-rows:20px auto auto; min-block-size:76px; padding:4px; gap:2px; border-radius:4px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__icon { inline-size:20px; block-size:20px; font-size:16px; border-radius:4px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__label { font-size:12px; line-height:16px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__detail { font-size:10px; line-height:14px; }
html body.unified-page #resultsSection.ui-flow .search-type-progress__count { font-size:12px; line-height:16px; }

/* #450-101: two readable rows per status card; loading never stacks characters. */
@media(max-width:767px) {
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__items { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__topic { grid-template-columns:24px minmax(0,1fr); grid-template-rows:auto auto; gap:2px 6px; min-height:52px !important; padding:6px 8px !important; align-items:center; }
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__icon { grid-row:1 / 3; width:24px; height:24px; }
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__label,
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__count { font-size:12px !important; line-height:16px !important; white-space:nowrap; overflow-wrap:normal; text-align:left; }
 html body #resultsSection.ui-flow .search-type-progress__group[data-group="bid_status"] .search-type-progress__detail { display:none; }
}
html body #resultsSection.ui-flow :is(#relatedCompaniesProgressCard,#relatedInstitutionsProgressCard)[aria-busy="true"] { opacity:1 !important; color:#27577f !important; background:#eff6ff !important; border-color:#9ebdd8 !important; cursor:progress; }
html[data-theme="dark"] body #resultsSection.ui-flow :is(#relatedCompaniesProgressCard,#relatedInstitutionsProgressCard)[aria-busy="true"] { color:#c4e1ff !important; background:#1b3043 !important; border-color:#557a9c !important; }
