/* static/css/search_type_progress.css */
/* 통합 검색 결과 다이얼로그의 항목별 진행·선택 화면. */
.search-type-progress {
    --progress-surface: #f6f8fb;
    --progress-panel: #ffffff;
    --progress-line: #ccd8e5;
    --progress-text: #172f49;
    --progress-muted: #536b83;
    /* The result wrapper owns scrolling.  Keeping this panel as its first
     * document-flow child prevents a sibling flex calculation from shrinking
     * the whole progress surface to nothing when cards arrive. */
    display: block;
    min-block-size: auto;
    padding: 1rem;
    overflow: visible;
    border-bottom: 1px solid var(--progress-line);
    background: var(--progress-surface);
    color: var(--progress-text);
    box-sizing: border-box;
}

.search-type-progress[hidden] {
    display: none !important;
}

/* 결과 창 단위 제한은 유형별 집계 실패가 아니다. 남은 카드가 있을 때만
 * 목록 끝에 작게 이어 불러오기 동작을 제공한다. */
.search-results-load-more {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    width: 100%;
    max-width: 46rem;
    margin: 0 auto;
    padding: 0.75rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #d7e0e9;
    background: #f7fafc;
    color: #536b83;
    box-sizing: border-box;
    text-align: center;
}

.search-results-load-more[hidden] {
    display: none !important;
}

.search-results-load-more p {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
}

.search-results-load-more button {
    min-height: 44px;
    padding: 0.55rem 1rem;
    border: 1px solid #8db9dd;
    border-radius: 0.62rem;
    background: #ffffff;
    color: #15577f;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 820;
    cursor: pointer;
}

.search-results-load-more button:hover:not(:disabled) {
    border-color: #3a82b4;
    background: #eaf4fb;
}

.search-results-load-more button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    outline-offset: 2px;
}

.search-results-load-more button:disabled {
    border-color: #c5d2df;
    background: #edf2f6;
    color: #7a8ea3;
    cursor: wait;
}

/* The progress view and card results always share the same scroll surface.
 * Do not reintroduce a state that hides the results while counts settle. */
.results-virtual-wrapper > .search-type-progress {
    display: block;
    flex: none;
    min-block-size: auto;
    max-block-size: none;
}

.results-dialog .results-virtual-wrapper > .search-type-progress {
    position: relative;
    z-index: 2;
}

.search-type-progress__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    max-inline-size: 86rem;
    margin: 0 auto 0.85rem;
}

.search-type-progress__heading h3 {
    margin: 0;
    color: var(--progress-text);
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -0.025em;
}

.search-type-progress__status {
    min-inline-size: 0;
    margin: 0;
    color: var(--progress-muted);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.4;
    text-align: right;
}

.search-type-progress__groups {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 0.72fr);
    gap: 0.75rem;
    max-inline-size: 86rem;
    margin: 0 auto;
}

.search-type-progress__group {
    --group-rgb: 30, 112, 190;
    min-inline-size: 0;
    padding: 0.75rem;
    border: 1px solid var(--progress-line);
    border-radius: 0.9rem;
    background: var(--progress-panel);
    box-shadow: 0 5px 16px rgba(22, 48, 76, 0.06);
}

.search-type-progress__group[data-group="government_support"] {
    --group-rgb: 103, 75, 181;
}

.search-type-progress__group[data-group="iliya"] {
    --group-rgb: 0, 112, 88;
}

.search-type-progress__group-heading {
    min-inline-size: 0;
    margin-block-end: 0.6rem;
    padding-inline: 0.15rem;
}

.search-type-progress__group-heading h4 {
    margin: 0;
    color: var(--progress-text);
    font-size: 0.9rem;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.search-type-progress__group-heading p {
    margin: 0.12rem 0 0;
    color: var(--progress-muted);
    font-size: max(var(--font-meta-min, 0px), 0.69rem);
    font-weight: 600;
    line-height: max(var(--text-line-height-min, 0), 1.3);
}

.search-type-progress__items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.42rem;
}

.search-type-progress__group[data-group="government_support"] .search-type-progress__items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-type-progress__group[data-group="iliya"] .search-type-progress__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-type-progress__topic {
    display: grid;
    grid-template-rows: 2.15rem auto auto;
    justify-items: center;
    align-content: start;
    gap: 0.18rem;
    min-inline-size: 0;
    min-block-size: 6.2rem;
    margin: 0;
    padding: 0.52rem 0.32rem;
    border: 1px solid #d6e0ea;
    border-radius: 0.72rem;
    background: #f2f5f8;
    color: #425970;
    box-sizing: border-box;
    font: inherit;
    text-align: center;
    appearance: none;
    cursor: default;
    transition: border-color 220ms ease, background-color 220ms ease,
        color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.search-type-progress__icon {
    display: inline-grid;
    inline-size: 2.15rem;
    block-size: 2.15rem;
    place-items: center;
    border-radius: 0.68rem;
    background: #e3e9ef;
    font-size: 1.25rem;
    line-height: 1;
    filter: grayscale(1) saturate(0);
    opacity: 0.58;
    transition: filter 220ms ease, opacity 220ms ease, background-color 220ms ease,
        box-shadow 220ms ease, transform 220ms ease;
}

.search-type-progress__label,
.search-type-progress__detail,
.search-type-progress__count {
    inline-size: 100%;
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.search-type-progress__label {
    color: inherit;
    font-size: max(var(--font-meta-min, 0px), 0.74rem);
    font-weight: 820;
    line-height: max(var(--text-line-height-min, 0), 1.2);
}

.search-type-progress__detail {
    color: #61778d;
    font-size: max(var(--font-meta-min, 0px), 0.59rem);
    font-weight: 600;
    line-height: max(var(--text-line-height-min, 0), 1.2);
}

.search-type-progress__detail[hidden] {
    display: none;
}

.search-type-progress__count {
    align-self: end;
    color: #536a81;
    font-size: max(var(--font-meta-min, 0px), 0.68rem);
    font-variant-numeric: tabular-nums;
    font-weight: 760;
    line-height: max(var(--text-line-height-min, 0), 1.2);
}

.search-type-progress__topic[data-state="pending"] .search-type-progress__count::after {
    display: inline-block;
    inline-size: 0.34rem;
    block-size: 0.34rem;
    margin-inline-start: 0.3rem;
    border-radius: 50%;
    background: currentColor;
    content: "";
    animation: search-progress-pulse 1.15s ease-in-out infinite alternate;
    vertical-align: 0.08rem;
}

.search-type-progress__topic[data-state="complete"] {
    border-color: rgba(var(--group-rgb), 0.62);
    background: rgba(var(--group-rgb), 0.09);
    color: rgb(var(--group-rgb));
    box-shadow: inset 0 0 0 1px rgba(var(--group-rgb), 0.08);
    cursor: pointer;
}

.search-type-progress__topic[data-state="complete"] .search-type-progress__icon {
    background: rgba(var(--group-rgb), 0.14);
    box-shadow: 0 4px 10px rgba(var(--group-rgb), 0.13);
    filter: none;
    opacity: 1;
}

.search-type-progress__topic[data-state="complete"] .search-type-progress__detail,
.search-type-progress__topic[data-state="complete"] .search-type-progress__count {
    color: #2d4c69;
}

.search-type-progress__topic[data-state="complete"]:hover {
    border-color: rgb(var(--group-rgb));
    background: rgba(var(--group-rgb), 0.14);
    transform: translateY(-1px);
}

.search-type-progress__topic[data-state="complete"]:focus-visible {
    outline: 3px solid rgba(var(--group-rgb), 0.38);
    outline-offset: 2px;
}

.search-type-progress__topic[data-state="error"] {
    border-color: #d7a84c;
    background: #fff8e8;
    color: #73500d;
}

.search-type-progress__topic[data-state="error"] .search-type-progress__count,
.search-type-progress__topic[data-state="error"] .search-type-progress__detail {
    color: #73500d;
}

.search-type-progress__topic[data-state="excluded"] {
    border-color: #91a6ba;
    border-style: solid;
    background: linear-gradient(135deg, #eef3f7 0%, #e4ebf1 100%);
    color: #334b62;
    box-shadow: inset 0 0 0 1px rgba(70, 94, 117, 0.08);
}

.search-type-progress__topic[data-state="excluded"] .search-type-progress__count,
.search-type-progress__topic[data-state="excluded"] .search-type-progress__detail {
    color: #405a72;
}

.search-type-progress__topic[data-state="excluded"] .search-type-progress__icon {
    position: relative;
    background: #d4e0ea;
    filter: grayscale(1) saturate(0);
    opacity: 0.88;
}

.search-type-progress__topic[data-state="excluded"] .search-type-progress__icon::after {
    position: absolute;
    right: -0.18rem;
    bottom: -0.12rem;
    display: inline-grid;
    inline-size: 0.9rem;
    block-size: 0.9rem;
    place-items: center;
    border: 2px solid var(--progress-panel);
    border-radius: 50%;
    background: #60788f;
    color: #ffffff;
    content: "\2212";
    font-size: max(var(--font-meta-min, 0px), 0.72rem);
    font-weight: 900;
    line-height: max(var(--text-line-height-min, 0), 1);
}

@keyframes search-progress-pulse {
    from { opacity: 0.28; transform: scale(0.78); }
    to { opacity: 0.88; transform: scale(1); }
}

html[data-theme="dark"] .search-type-progress {
    --progress-surface: #0c1524;
    --progress-panel: #152237;
    --progress-line: #344760;
    --progress-text: #edf5ff;
    --progress-muted: #b6c8dc;
}

html[data-theme="dark"] .search-results-load-more {
    border-top-color: #344760;
    background: #101b2d;
    color: #c0d0e1;
}

html[data-theme="dark"] .search-results-load-more button {
    border-color: #4b8dbd;
    background: #172b42;
    color: #e2f2ff;
}

html[data-theme="dark"] .search-results-load-more button:hover:not(:disabled) {
    border-color: #7db9e7;
    background: #203d5b;
}

html[data-theme="dark"] .search-results-load-more button:disabled {
    border-color: #40566e;
    background: #1a293b;
    color: #9db2c7;
}

html[data-theme="dark"] .search-type-progress__group {
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .search-type-progress__topic {
    border-color: #3a4c64;
    background: #111d2f;
    color: #c4d2e1;
}

html[data-theme="dark"] .search-type-progress__icon {
    background: #26354a;
}

html[data-theme="dark"] .search-type-progress__detail,
html[data-theme="dark"] .search-type-progress__count {
    color: #aebfd2;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="complete"] {
    border-color: rgba(var(--group-rgb), 0.94);
    background: rgba(var(--group-rgb), 0.22);
    color: #f2f8ff;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="complete"] .search-type-progress__icon {
    background: rgba(var(--group-rgb), 0.38);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .search-type-progress__topic[data-state="complete"] .search-type-progress__detail,
html[data-theme="dark"] .search-type-progress__topic[data-state="complete"] .search-type-progress__count {
    color: #d6e7f8;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="complete"]:hover {
    background: rgba(var(--group-rgb), 0.3);
}

html[data-theme="dark"] .search-type-progress__topic[data-state="error"] {
    border-color: #b18031;
    background: #35280f;
    color: #ffe3a4;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="error"] .search-type-progress__count,
html[data-theme="dark"] .search-type-progress__topic[data-state="error"] .search-type-progress__detail {
    color: #ffe3a4;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="excluded"] {
    border-color: #627991;
    background: linear-gradient(135deg, #1c2b3e 0%, #23354a 100%);
    color: #d4e1ed;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="excluded"] .search-type-progress__count,
html[data-theme="dark"] .search-type-progress__topic[data-state="excluded"] .search-type-progress__detail {
    color: #bfd0df;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="excluded"] .search-type-progress__icon {
    background: #354b62;
}

html[data-theme="dark"] .search-type-progress__topic[data-state="excluded"] .search-type-progress__icon::after {
    border-color: var(--progress-panel);
    background: #8aa0b5;
    color: #0b1725;
}

@media (max-width: 980px) {
    .search-type-progress__groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .search-type-progress {
        padding: 0.7rem;
    }

    .search-type-progress__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
        margin-bottom: 0.58rem;
    }

    .search-type-progress__heading h3 {
        font-size: 0.94rem;
    }

    .search-type-progress__status {
        font-size: max(var(--font-meta-min, 0px), 0.72rem);
        text-align: left;
    }

    .search-type-progress__groups {
        gap: 0.52rem;
    }

    .search-type-progress__group {
        padding: 0.58rem;
        border-radius: 0.78rem;
    }

    .search-type-progress__group-heading {
        margin-block-end: 0.45rem;
    }

    .search-type-progress__group-heading h4 {
        font-size: 0.82rem;
    }

    .search-type-progress__group-heading p {
        font-size: max(var(--font-meta-min, 0px), 0.64rem);
    }

    .search-type-progress__items {
        gap: 0.32rem;
    }

    .search-type-progress__topic {
        grid-template-rows: 1.9rem auto auto;
        min-block-size: 5.45rem;
        padding: 0.42rem 0.18rem;
        border-radius: 0.62rem;
    }

    .search-type-progress__icon {
        inline-size: 1.9rem;
        block-size: 1.9rem;
        font-size: 1.08rem;
    }

    .search-type-progress__label {
        font-size: max(var(--font-meta-min, 0px), 0.66rem);
    }

    .search-type-progress__detail {
        font-size: max(var(--font-meta-min, 0px), 0.53rem);
    }

    .search-type-progress__count {
        font-size: max(var(--font-meta-min, 0px), 0.61rem);
    }
}

@media (max-width: 359px) {
    .search-type-progress__group[data-group="bid_status"] .search-type-progress__items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-height: 568px) {
    .search-type-progress {
        padding-block: 0.55rem;
    }

    .search-type-progress__topic {
        min-block-size: 4.8rem;
    }
}

.results-dialog.search-topic-overview .results-virtual-wrapper {
    display: block !important;
}

.results-dialog.search-summary-only #resultsGrid,
.results-dialog.search-summary-only #searchResultsLoadMore,
.results-dialog.search-summary-only #noResults,
.results-dialog.search-summary-only #suggestKeywords {
    display: none !important;
}

.search-type-progress__topic[aria-pressed="true"],
#relatedCompaniesProgressCard[aria-pressed="true"],
#relatedInstitutionsProgressCard[aria-pressed="true"] {
    outline: 3px solid #1769aa;
    outline-offset: -3px;
    background: #e0f1fa;
}

html[data-theme="dark"] .search-type-progress__topic[aria-pressed="true"],
html[data-theme="dark"] #relatedCompaniesProgressCard[aria-pressed="true"],
html[data-theme="dark"] #relatedInstitutionsProgressCard[aria-pressed="true"] {
    outline-color: #8ac8ff;
    background: #173c5b;
}

@media (prefers-reduced-motion: reduce) {
    .search-type-progress__topic,
    .search-type-progress__icon {
        transition: none;
    }

    .search-type-progress__topic[data-state="pending"] .search-type-progress__count::after {
        animation: none;
    }
}

/* #545-5/#545-6 분류: after a search the results' status combo is a combo box and the progress
 * overview is its open list - one column hung from the combo at the combo's width, one piece with
 * it (shared edge, border and shadow; ▾ turns ▴), folding back into it once a topic is chosen.
 * Rows follow the app's 40px row; each group keeps its colour for the pulse and the choice.
 * Motion is opacity and transform only: transitions, and the app's existing fade keyframes
 * (unified_style.css), so the first-load stylesheet does not grow. */
html body.unified-page #resultsSection.results-dialog.results-classify {
    --classify-surface: #ffffff;
    --classify-line: #cfd9e5;
    --classify-shadow: 0 18px 34px rgba(15, 35, 60, 0.18);
}

html[data-theme="dark"] body.unified-page #resultsSection.results-dialog.results-classify {
    --classify-surface: var(--color-surface-raised, #1b2a3e);
    --classify-line: #41536b;
    --classify-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

/* The combo: one line with the chosen topic; open, it joins the list below it. */
html body.unified-page #resultsSection.results-dialog.results-classify #resultsStatusFilterFolderBtn::after {
    transition: transform 160ms ease;
}

html body.unified-page #resultsSection.results-dialog.results-classify #resultsStatusFilterFolderBtn[aria-expanded="true"] {
    position: relative;
    z-index: 41;
    border-color: var(--classify-line) !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background: var(--classify-surface) !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #resultsStatusFilterFolderBtn[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* The list wrapper stops being its own layer (nothing inside it is layered but the open list),
 * so the open list rises above the sticky header on phones instead of sliding under it. */
html body.unified-page #resultsSection.results-dialog.results-classify #resultsVirtualWrapper {
    z-index: auto !important;
}

/* One count in the controls: the combo carries it, the list count and an 'all types' count would repeat it. */
html body.unified-page #resultsSection.results-dialog.results-classify #resultsCountSummary,
html body.unified-page #resultsSection.results-dialog.results-classify[data-classify-type="all"] #resultsTypeFolderCount {
    display: none !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress {
    position: fixed !important;
    top: var(--classify-top, 0px);
    left: var(--classify-left, 0px);
    z-index: 40 !important;
    box-sizing: border-box;
    width: var(--classify-width, 280px);
    max-height: var(--classify-max, 70vh);
    margin: 0;
    padding: 2px 0 6px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--classify-line);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: var(--classify-surface);
    box-shadow: var(--classify-shadow);
    transform-origin: top center;
    transition: transform 200ms ease, opacity 200ms ease, visibility 0s linear 0s;
}

/* Folded into the combo: no box, nothing to tap. */
html body.unified-page #resultsSection.results-dialog.results-classify:not(.results-classify-open) #searchTypeProgress {
    visibility: hidden;
    opacity: 0;
    transform: scaleY(0);
    pointer-events: none;
    transition: transform 200ms ease-in, opacity 160ms ease-in, visibility 0s linear 200ms;
}

/* The combo is the list's title; the progress message stays for screen readers. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__heading {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__groups {
    display: block;
    gap: 0 !important;
    max-inline-size: none;
    margin: 0;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__group {
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__group + .search-type-progress__group,
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress #relatedCompaniesProgressCard {
    border-top: 1px solid var(--classify-line) !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__group-heading {
    margin: 0 !important;
    padding: 7px 12px 1px;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__group-heading h4 {
    min-height: 0;
    color: var(--progress-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__group-heading p,
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__detail,
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic .search-type-progress__count::after {
    display: none !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__items {
    display: block !important;
}

/* A row: icon, name, count on the right. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic {
    position: relative;
    isolation: isolate;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    grid-template-rows: none !important;
    align-items: center !important;
    align-content: center !important;
    justify-items: start;
    gap: 0 10px !important;
    width: 100%;
    min-block-size: 40px !important;
    min-height: 40px !important;
    margin: 0;
    padding: 0 14px 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    color: var(--progress-text);
    text-align: left;
    transform: none;
    box-shadow: none;
}

/* The pulse and the blink live on a layer under the row's text, in the group colour. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic::before {
    position: absolute;
    inset: 3px 6px;
    z-index: -1;
    border-radius: 6px;
    background: rgba(var(--group-rgb), 0.22);
    content: "";
    opacity: 0;
    pointer-events: none;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="pending"]::before {
    animation: collabFadeIn 1.4s ease-in-out infinite alternate;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic:nth-child(2)::before { animation-delay: -0.28s; }
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic:nth-child(3)::before { animation-delay: -0.56s; }
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic:nth-child(4)::before { animation-delay: -0.84s; }
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic:nth-child(5)::before { animation-delay: -1.12s; }

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic.is-picked::before {
    background: rgba(var(--group-rgb), 0.7);
    animation: collabFadeIn 160ms ease-in-out 0s 6 alternate both;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__icon {
    grid-row: auto !important;
    inline-size: 22px !important;
    block-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px !important;
    background: none;
    box-shadow: none;
    font-size: 16px !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__label {
    overflow: hidden;
    color: inherit;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 20px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__count {
    align-self: center;
    justify-self: end;
    inline-size: auto;
    color: var(--progress-muted);
    font-size: 13px !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 20px !important;
    text-align: right;
    white-space: nowrap;
}

/* While counting, the pulse shows the progress; the long status words give way to the name. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="pending"] .search-type-progress__count {
    font-size: 0 !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="pending"] .search-type-progress__count::before {
    content: "\2026";
    font-size: 14px;
    letter-spacing: 1px;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="complete"] {
    cursor: pointer;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="complete"] .search-type-progress__count {
    color: var(--progress-text);
    font-weight: 800;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="complete"]:hover {
    background: rgba(var(--group-rgb), 0.08);
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-empty="true"] :is(.search-type-progress__label, .search-type-progress__count) {
    color: var(--progress-muted);
    font-weight: 500;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-empty="true"] .search-type-progress__icon {
    opacity: 0.55;
}

/* The chosen topic: tinted row with the group colour on its edge. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[aria-pressed="true"] {
    background: rgba(var(--group-rgb), 0.14);
    box-shadow: inset 3px 0 0 rgb(var(--group-rgb));
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic:focus-visible {
    outline: 2px solid rgb(var(--group-rgb));
    outline-offset: -2px;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="excluded"] .search-type-progress__icon::after {
    display: none;
}

/* 관련 업체·기관 are rows too: name on the left, count on the right. */
html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard) {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 14px 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--progress-text) !important;
    font-size: 0 !important;
    text-align: left;
    opacity: 1 !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress #relatedCompaniesProgressCard {
    margin-top: 4px !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard)::before {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    content: attr(data-classify-icon) "\2002" attr(data-classify-label);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard)::after {
    color: var(--progress-text);
    content: attr(data-classify-count);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 20px;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard):not(:disabled):hover {
    background: rgba(30, 112, 190, 0.08) !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard)[aria-pressed="true"] {
    background: rgba(30, 112, 190, 0.14) !important;
    box-shadow: inset 3px 0 0 rgb(30, 112, 190) !important;
}

html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress :is(#relatedCompaniesProgressCard, #relatedInstitutionsProgressCard):disabled::after {
    color: var(--progress-muted);
}

/* Phones: the combo takes two thirds of the header's last row, so its list is wide enough to
 * read and hangs right below the header; the notes under the title stay on wider screens. */
@media (max-width: 767px) {
    html body.unified-page #resultsSection.results-dialog.results-classify .results-info {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-areas:
            "refine type sort"
            "classify classify company" !important;
    }

    html body.unified-page #resultsSection.results-dialog.results-classify .results-filter-controls {
        display: contents !important;
    }

    html body.unified-page #resultsSection.results-dialog.results-classify #resultsViewFilters { grid-area: classify; }
    html body.unified-page #resultsSection.results-dialog.results-classify #resultsTypeFilters { grid-area: type; }
    html body.unified-page #resultsSection.results-dialog.results-classify #resultsRelatedCompanyControl { grid-area: company; }
    html body.unified-page #resultsSection.results-dialog.results-classify .results-refine-action { grid-area: refine; min-width: 0 !important; }

    html body.unified-page #resultsSection.results-dialog.results-classify .results-sort-control {
        grid-area: sort;
        justify-self: stretch;
    }

    html body.unified-page #resultsSection.results-dialog.results-classify .results-sort-control .results-sort-button {
        width: 100%;
    }

    html body.unified-page #resultsSection.results-dialog.results-classify .results-heading :is(.results-heading-label, small, .results-scope-note) {
        display: none !important;
    }
}

/* Wider screens: the combo is wide enough to name a topic and its count, and the list hangs from it. */
@media (min-width: 768px) {
    html body.unified-page #resultsSection.results-dialog.results-classify #resultsViewFilters,
    html body.unified-page #resultsSection.results-dialog.results-classify #resultsStatusFilterFolderBtn {
        min-width: 216px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress,
    html body.unified-page #resultsSection.results-dialog.results-classify:not(.results-classify-open) #searchTypeProgress,
    html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic::before {
        animation: none !important;
        transition: none !important;
    }

    /* A still mark instead of the pulse; the picked topic is outlined instead of blinking. */
    html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic[data-state="pending"]::before {
        opacity: 0.4;
    }

    html body.unified-page #resultsSection.results-dialog.results-classify #searchTypeProgress .search-type-progress__topic.is-picked {
        outline: 2px solid rgb(var(--group-rgb));
        outline-offset: -2px;
    }
}

/* static/css/home_modules.css */
/* D2-6 → D2-26: home modules.
   Desktop (768px and wider) keeps the previous production home structure
   (DES_D2-26): #homeModules has no box of its own (display: contents), so
   unified_style.css places the legacy wrappers as before — left rail
   즐겨찾기 목록 → 달력(month, expanded) → 날씨(on by default); right
   검색 → 공고 현황 → 통계(면허별 + 추이, expanded).
   Mobile (767px and below) is the previous production composition again (D2-27,
   DES_DECISIONS 14): notice band → search → 오늘 일정·날씨 row → 뉴스 → 주가 →
   입찰업무 → 카드 설정 → footer → brand card. The desktop-only modules (달력,
   날씨 패널, 공고 현황, 통계) stay off the mobile home as before; the legacy
   wrappers dissolve into one column with the shared grid gap. */

body.unified-page #homeNoticeSlot[hidden] { display: none !important; }

/* UIFIX-12: desktop readability and currency wrapping within the original
   D2-26 columns. The V4 mobile home must retain its exact fonts and geometry. */
@media (min-width: 768px) {
    html body.unified-page #homeModules .dash-notices-panel .dash-tbl :is(th, td) {
        overflow-wrap: anywhere;
    }
    html body.unified-page #homeModules .dash-notices-panel .dash-tbl .col-budget {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    html body.unified-page #homeModules :is(.date-agenda-label, .date-agenda-count, .weather-permission-hint) {
        font-size: max(11px, 0.7rem);
    }
    html body.unified-page #homeModules :is(.date-agenda-count, .weather-permission-hint),
    html body.unified-page #homeModules #homeWeekMonthToggle {
        color: #475569;
    }
    html[data-theme="dark"] body.unified-page #homeModules :is(.date-agenda-count, .weather-permission-hint) {
        color: #bdc9d8;
    }
    html[data-theme="dark"] body.unified-page #homeModules .date-agenda-label {
        background: #233247;
        color: #bdc9d8;
    }
    html[data-theme="dark"] body.unified-page #homeModules #homeWeekMonthToggle {
        color: #93c5fd;
    }
}

@media (min-width: 768px) {
    html body.unified-page #homeModules { display: contents; }
    /* The month calendar sits above this week's deadlines; the 7-day strip
       duplicates the month grid and stays mobile-only. */
    html body.unified-page #homeModules #dashCalendarPanel { display: flex; flex-direction: column; }
    html body.unified-page #homeModules #dashCalendarPanel > .dash-panel-header { order: 0; }
    html body.unified-page #homeModules #dashCalendarPanel > #dashMiniCal { order: 1; }
    html body.unified-page #homeModules #dashCalendarPanel > #homeWeekList { order: 2; }
    html body.unified-page #homeModules #dashCalendarPanel > .home-week-strip { display: none !important; }
    html body.unified-page #homeModules #dashMiniCal:not([hidden]) {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }
    html body.unified-page #homeModules #dashCalendarPanel > #homeWeekList {
        --home-card-height: 96px;
        margin-top: 8px;
        padding-top: 6px;
        border-top: 1px solid var(--color-border-light, #e2e8f0);
    }
    /* The right column scrolls as before; its cards keep their own height instead of
       being squeezed to the viewport (the lists reserve 360px, D1-2). */
    html body.unified-page #homeModules #dashboardSection .dash-col-main > * { flex: 0 0 auto; }
    html body.unified-page #homeModules #dashCalendarPanel > #homeWeekList[data-home-card-state="empty"] {
        height: auto;
        min-height: 0;
        max-height: none;
        padding-bottom: 0;
        overflow: visible;
    }
    html body.unified-page #homeModules #dashCalendarPanel > #homeWeekList[data-home-card-state="empty"] .home-week-empty {
        padding: 6px 4px;
        text-align: left;
    }
}

@media (max-width: 767px) {
body.unified-page #homeModules {
    --home-gap: 12px;
    --home-gutter: 0px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    /* Rows follow their content even when the grid itself is a fixed-height
       scroll port (desktop); "auto" rows would be squeezed to fit it. */
    grid-auto-rows: max-content;
    align-items: start;
    align-content: start;
    gap: var(--home-gap);
    box-sizing: border-box;
    min-width: 0;
}

/* Wrappers dissolve into the module grid (mobile). */
html body.unified-page #homeModules #dashboardSection,
html body.unified-page #homeModules #dashboardSection .dash-col-calendar,
html body.unified-page #homeModules #dashboardSection .dash-col-main,
html body.unified-page #homeModules #infoCardsSection,
html body.unified-page #homeModules #infoCardsSection #mobileInfoPrimary {
    display: contents !important;
}

/* Desktop-only modules (as in the previous production mobile home) and the old
   decorative dividers (the grid gap spaces the cards). */
html body.unified-page #homeModules #dashCalendarPanel,
html body.unified-page #homeModules .dash-weather-panel,
html body.unified-page #homeModules .dash-notices-panel,
html body.unified-page #homeModules #homeStatsModule,
html body.unified-page #homeModules #infoCardsSection .info-section-divider {
    display: none !important;
}

/* ── order (mobile): previous production ───────────────────── */
html body.unified-page #homeModules #mobileHomeSummaryRegion { order: 5; }
html body.unified-page #homeModules #newsCard { order: 10; }
html body.unified-page #homeModules #stockCard { order: 20; }
html body.unified-page #homeModules #bidWorkCard { order: 30; }
html body.unified-page #homeModules #homeCardSettingsRow { order: 80; }
html body.unified-page #homeModules .service-footer { order: 90; }
html body.unified-page #homeModules #dashMoreDialog { order: 98; }

html body.unified-page #homeModules :is(#mobileHomeSummaryRegion, #bidWorkCard, #stockCard, #newsCard,
    #homeCardSettingsRow, .service-footer) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    margin: 0 !important;
}
} /* end mobile module grid */

/* Results replace the home (same moments the old sections were hidden). */
html body.unified-page:is(.results-dialog-active, .unified-results-scroll-mode) #homeModules#homeModules,
html body.unified-page #homeModules#homeModules:has(> #infoCardsSection.hidden) {
    display: none !important;
}

/* ── optional cards: off unless listed in data-home-cards (weather is on by default) ──
   An off card keeps no box in the flow (absolutely placed, zero height, hidden from
   sight, focus and assistive technology), so turning it on later is the only change. */
html body.unified-page #homeModules .home-optional-card {
    flex: none !important;
}
/* D2-28 (DES 15): desktop only; the V4 mobile home always shows 날씨·주가·뉴스. */
@media (min-width: 768px) {
    html body.unified-page #homeModules:not([data-home-cards~="weather"]) .home-optional-card[data-home-card="weather"],
    html body.unified-page #homeModules:not([data-home-cards~="stock"]) .home-optional-card[data-home-card="stock"],
    html body.unified-page #homeModules:not([data-home-cards~="news"]) .home-optional-card[data-home-card="news"] {
        position: absolute !important;
        top: 0 !important;
        left: var(--home-gutter) !important;
        right: var(--home-gutter) !important;
        width: auto !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* D2-28 (DES 15): desktop only — the mobile 입찰업무 card keeps its V4 (unified_style.css) look. */
@media (min-width: 768px) {
/* ── shared card surface for modules that had a device-only look ── */
html body.unified-page #homeModules :is(#bidWorkCard, #dashCalendarPanel, #homeStatsModule) {
    padding: 10px 12px !important;
    border: 1px solid var(--color-border-light, #e2e8f0) !important;
    border-radius: 12px !important;
    background: var(--color-surface, #fff) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

/* ── 입찰업무 ─────────────────────────────────────────────── */
html body.unified-page #homeModules #bidWorkCard .info-card-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 6px !important;
}
html body.unified-page #homeModules #bidWorkCard #bidWorkContent {
    box-sizing: border-box !important;
    height: 352px !important;
    min-height: 352px !important;
    max-height: 352px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}
html body.unified-page #homeModules #bidWorkCard .bid-work-row {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    padding: 6px 2px !important;
    cursor: pointer;
}
/* Two lines with an ellipsis instead of cutting the title on one line. */
html body.unified-page #homeModules #bidWorkCard .bid-work-name {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
}
html body.unified-page #homeModules #bidWorkCard .bid-work-footer {
    display: flex;
    justify-content: flex-end;
    height: 44px;
    border-top: 1px solid var(--color-border-light, #e2e8f0);
}
html body.unified-page #homeModules #bidWorkCard .bid-work-all {
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--color-primary, #2563eb);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
html body.unified-page #homeModules #bidWorkCard .bid-work-all:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}
}

/* ── 이번 주 마감 ─────────────────────────────────────────── */
html body.unified-page #homeModules #dashCalendarPanel .dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}
html body.unified-page #homeModules #dashCalendarPanel .dash-panel-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.3;
}
html body.unified-page #homeModules .home-week-actions { display: inline-flex; gap: 4px; flex-shrink: 0; }
html body.unified-page #homeModules .home-week-actions .dash-panel-action {
    min-height: 32px;
    padding: 0 8px;
    white-space: nowrap;
}
html body.unified-page #homeModules .home-week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    height: 56px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}
html body.unified-page #homeModules .home-week-day {
    display: grid;
    grid-template-rows: 14px 20px 14px;
    justify-items: center;
    align-content: center;
    gap: 1px;
    border-radius: 8px;
    background: var(--color-surface-soft, #f8fafc);
    color: var(--color-text, #0f172a);
    font-size: 0.72rem;
}
html body.unified-page #homeModules .home-week-day.is-past { opacity: 0.55; }
html body.unified-page #homeModules .home-week-day.is-today {
    background: var(--color-primary, #2563eb);
    color: #fff;
}
html body.unified-page #homeModules .home-week-day.is-sunday .home-week-dayname { color: #dc2626; }
html body.unified-page #homeModules .home-week-day.is-saturday .home-week-dayname { color: #2563eb; }
html body.unified-page #homeModules .home-week-day.is-today .home-week-dayname { color: inherit; }
html body.unified-page #homeModules .home-week-date { font-size: 0.9rem; font-weight: 800; line-height: 20px; }
html body.unified-page #homeModules .home-week-count {
    min-width: 14px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    color: var(--color-danger, #b91c1c);
}
html body.unified-page #homeModules .home-week-day.is-today .home-week-count { color: #fff; }
html body.unified-page #homeModules #homeWeekList {
    --home-card-height: 176px;
    position: relative;
    box-sizing: border-box;
    height: var(--home-card-height);
    min-height: var(--home-card-height);
    max-height: var(--home-card-height);
    padding-bottom: 24px;
    overflow-y: auto;
}
html body.unified-page #homeModules #homeWeekList:not([data-home-card-state]) > .dash-list-loading {
    color: transparent;
    height: 100%;
    box-sizing: border-box;
    background: repeating-linear-gradient(to bottom, transparent 0 12px,
        var(--color-border-light, #e2e8f0) 12px 28px, transparent 28px 40px);
    background-clip: content-box;
}
html body.unified-page #homeModules .home-week-items { margin: 0; padding: 0; list-style: none; }
html body.unified-page #homeModules .home-week-item {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 4px 2px;
    border: 0;
    border-bottom: 1px solid var(--color-border-light, #e2e8f0);
    background: transparent;
    color: var(--color-text, #0f172a);
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
}
html body.unified-page #homeModules .home-week-item-when { font-weight: 700; white-space: nowrap; }
html body.unified-page #homeModules .home-week-item-type {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--color-primary-bg, #eef2ff);
    color: var(--color-text-secondary, #475569);
    font-size: 0.68rem;
    white-space: nowrap;
}
html body.unified-page #homeModules .home-week-item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html body.unified-page #homeModules .home-week-empty {
    padding: 16px 4px;
    color: var(--color-text-secondary, #64748b);
    font-size: 0.8rem;
    text-align: center;
}
html body.unified-page #homeModules #dashMiniCal[hidden] { display: none !important; }
html body.unified-page #homeModules #dashMiniCal:not([hidden]) {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light, #e2e8f0);
}

/* ── 공고 현황: one page-level "마지막 갱신" in its header ─────── */
/* Work first: 마감 임박 takes the first cell (the markup order stays as it was). */
html body.unified-page #homeModules .dash-notices-grid > .dash-notices-col:has(> #dashClosingList) { order: -1; }
html body.unified-page #homeModules .dash-notices-header { flex-wrap: wrap; gap: 6px 10px; }
html body.unified-page #homeModules .home-last-updated {
    margin-left: auto;
    color: var(--color-text-secondary, #475569);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* "--:--" and "14:05" take the same width, so the header never moves. */
html body.unified-page #homeModules .home-last-updated time {
    display: inline-block;
    width: 3.2em;
    text-align: right;
}
/* Card-level time only on error or delay. */
html body.unified-page :is(#homeModules, #searchBookmarkSide) .home-card-fixed:not([data-home-card-state="error"]):not([data-home-card-stale="true"]) > .home-card-feedback time {
    display: none;
}
html body.unified-page :is(#homeModules, #searchBookmarkSide) .home-card-fixed:is([data-home-card-state="ready"], [data-home-card-state="empty"]):not([data-home-card-stale="true"]) > .home-card-feedback {
    display: none;
}

/* ── 통계: expanded by default (D2-26), the heading button collapses it ── */
html body.unified-page #homeModules .home-stats-heading { margin: 0; font-size: inherit; }
html body.unified-page #homeModules .home-stats-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--color-text, #0f172a);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
html body.unified-page #homeModules .home-stats-title { font-size: 0.9rem; font-weight: 800; }
html body.unified-page #homeModules .home-stats-sub { color: var(--color-text-secondary, #64748b); font-size: 0.76rem; }
html body.unified-page #homeModules .home-stats-chevron { margin-left: auto; }
html body.unified-page #homeModules .home-stats-chevron::before { content: "▾"; }
html body.unified-page #homeModules .home-stats-toggle[aria-expanded="true"] .home-stats-chevron::before { content: "▴"; }
html body.unified-page #homeModules .home-stats-toggle:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}
html body.unified-page #homeModules #homeStatsBody[hidden] { display: none !important; }
html body.unified-page #homeModules #homeStatsBody .dash-charts-row { margin: 8px 0 0 !important; }
/* License chart: top 8 + "더보기", "면허 미지정" on its own line, no inner scroll. */
html body.unified-page #homeModules #dashTypeDist { --home-card-height: 352px; overflow-y: hidden; }
html body.unified-page #homeModules #dashTypeDist.dash-hbar-expanded {
    height: auto;
    max-height: none;
}
html body.unified-page #homeModules .dash-hbar-more {
    display: block;
    width: 100%;
    min-height: 36px;
    margin-top: 4px;
    border: 1px solid var(--color-border-light, #e2e8f0);
    border-radius: 8px;
    background: transparent;
    color: var(--color-primary, #2563eb);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
html body.unified-page #homeModules .dash-hbar-note {
    margin-top: 6px;
    color: var(--color-text-secondary, #64748b);
    font-size: 0.76rem;
}

/* ── 카드 설정 ───────────────────────────────────────────── */
html body.unified-page #homeModules #homeCardSettingsRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}
html body.unified-page #homeModules .home-card-settings-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 10px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #0f172a);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
html body.unified-page #homeModules .home-card-settings-btn:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}
html body.unified-page #homeModules .home-card-settings-hint {
    /* Hide before JS removes the legacy text, including the first paint. */
    display: none !important;
}
/* The switch rows of the sheet are styled in layoutref_dialogs.css, loaded with the sheet. */
/* Desktop: a centre modal (DES_DECISIONS 8). 주가·뉴스 cards exist on the mobile
   home only (as in the previous production desktop), so their switches stay off-screen there. */
@media (min-width: 768px) {
    .home-card-settings-sheet .home-card-switches > li:is([data-home-card-row="stock"], [data-home-card-row="news"]) { display: none; }
    .home-card-settings-overlay { align-items: center; }
    .home-card-settings-sheet:not(.app-bottom-sheet) {
        width: min(420px, calc(100vw - 32px));
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        padding-top: 16px;
        border-radius: 14px;
        box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
    }
}

/* ── mobile (767px and below): one column, 16px gutter ─────── */
@media (max-width: 767px) {
    html body.unified-page:not(.mobile-shell-embed) #homeModules {
        --home-gutter: 16px;
        padding: 8px 16px var(--app-bottom-reserved, 0px) !important;
    }
    html body.unified-page #homeModules :is(#dashNewList, #dashPrivateBidList, #dashAwardedList, #dashClosingList) {
        --home-card-height: 248px;
    }
    html body.unified-page #homeModules .dash-notices-grid { grid-template-columns: minmax(0, 1fr) !important; }
    html body.unified-page #homeModules #homeStatsBody .dash-charts-row { grid-template-columns: minmax(0, 1fr) !important; }
    html body.unified-page #homeModules .dash-weather-panel { width: auto !important; }
}

/* ── desktop (768px and wider): the previous production layout from
   unified_style.css applies (D2-26); the D2-6 six-column grid is gone. ── */
@media (min-width: 768px) {
    html body.unified-page #homeModules #homeStatsModule { padding: 10px 12px 12px !important; }
    html body.unified-page #homeModules #homeCardSettingsRow { padding: 0 2px 8px; }
    html body.unified-page #homeModules #bidWorkCard #bidWorkContent { height: 220px !important; min-height: 220px !important; max-height: 220px !important; }
}

/* ── D2-6b: desktop repairs (DES_D2-6b) ──────────────────────────
   The 입찰업무 card's look lived only in mobile media blocks (inline template
   styles, info_tab_compact_visual.css, info_card_loading_stability.css), so on
   768px+ the chips fell back to default buttons and each row field took its own
   line. The same component styles now apply on desktop; only the arrangement
   differs (one line per item on the wider card). #450-120: bookmarks belong to the overview, so the search spans its row. */
@media (min-width: 768px) {
    html body.unified-page #homeModules #bidWorkCard .info-card-header {
        gap: 6px !important;
        margin: 0 0 6px !important;
    }
    html body.unified-page #homeModules #bidWorkCard .info-badge {
        background: linear-gradient(135deg, #047857, #10b981) !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }
    html body.unified-page #homeModules #bidWorkTabs {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        justify-self: start;
        width: max-content !important;
        max-width: 100%;
        gap: 1px !important;
        height: 20px !important;
        min-height: 20px !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn {
        flex:0 0 auto !important;
        min-width:44px !important;
        padding:0 7px !important;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn:focus-visible {
        outline: 2px solid var(--color-primary, #2563eb);
        outline-offset: -4px;
    }

    /* One line per item (title · meta · D-day), five items in the same 220px the
       D2-6 card already reserved, so no inner scroll bar and the 공고 현황 list
       below stays on the first screen. */
    html body.unified-page #homeModules #bidWorkCard #bidWorkContent {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        overflow: hidden !important;
        gap: 0 !important;
    }
    html body.unified-page #homeModules #bidWorkCard .bid-work-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) fit-content(40%) auto !important;
        gap: 0 12px !important;
        align-items: center !important;
        box-sizing: border-box !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 2px !important;
        border-bottom: 1px solid var(--color-border-light, #e2e8f0) !important;
        overflow: hidden;
    }
    html body.unified-page #homeModules #bidWorkCard .bid-work-row:last-child { border-bottom: 0 !important; }
    /* The title keeps the D2-6 two-line clamp; on desktop widths it is mostly one line. */
    html body.unified-page #homeModules #bidWorkCard .bid-work-name {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        color: #0f172a !important;
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }
    html body.unified-page #homeModules #bidWorkCard .bid-work-meta {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        color: #64748b !important;
        font-size: 12px !important;
        line-height: 18px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    html body.unified-page #homeModules #bidWorkCard .bid-work-time {
        grid-column: 3 !important;
        grid-row: 1 !important;
        min-width: 3.2em;
        color: #0f766e !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        line-height: 18px !important;
        text-align: right;
        white-space: nowrap !important;
    }
    html body.unified-page #homeModules #bidWorkCard .bid-work-empty {
        padding: 8px 4px !important;
        color: #64748b !important;
        font-size: 0.8rem !important;
        line-height: 1.35 !important;
        text-align: center !important;
    }
    html body.unified-page #homeModules #bidWorkCard .info-card-loading {
        display: grid;
        align-content: start;
        gap: 7px;
        padding: 8px 2px;
        box-sizing: border-box;
    }
    html body.unified-page #homeModules #bidWorkCard .info-card-loading-label {
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.2;
    }
    html body.unified-page #homeModules #bidWorkCard .info-card-loading-lines { display: grid; gap: 6px; }
    html body.unified-page #homeModules #bidWorkCard .info-card-loading-lines > span {
        display: block;
        height: 16px;
        border-radius: 6px;
        background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 48%, #eef2f7 100%);
    }

    /* 이번 주 마감 with nothing left: one line, and the card no longer stretches to
       the 입찰업무 height (that card alone sets the row, so nothing else moves). */
    html body.unified-page #homeModules #dashCalendarPanel:has(#homeWeekList[data-home-card-state="empty"]) {
        align-self: start !important;
    }
    html body.unified-page #homeModules #homeWeekList[data-home-card-state="empty"] {
        height: auto;
        min-height: 0;
        max-height: none;
        padding-bottom: 0;
        overflow: visible;
    }
    html body.unified-page #homeModules #homeWeekList[data-home-card-state="empty"] .home-week-empty {
        padding: 10px 4px;
        text-align: left;
    }
}

/* 390px: the 44px 낙찰률 help button no longer sticks out of the narrow column;
   it sits on its own line under the label inside the header cell. */
@media (max-width: 767px) {
    html body.unified-page #homeModules .dash-tbl th.col-rate { white-space: normal !important; }
    html body.unified-page #homeModules .dash-tbl th.col-rate > span { display: block; }
    html body.unified-page #homeModules .dash-tbl th.col-rate > .dash-rate-help {
        display: block;
        margin: 2px 0 0;
    }
}

/* D2-20: the guest footprint is decided by the server before the loaders run.
   Auth changes update the same attribute in mobile_info_work.js. */
.bid-work-guest-message { display: none; }
@media (max-width: 767px) {
    html body.unified-page #homeModules #bidWorkCard[data-work-audience="guest"] {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
    html body.unified-page #homeModules #bidWorkCard[data-work-audience="guest"] #bidWorkContent {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
    }
    html body.unified-page #homeModules #bidWorkCard[data-work-audience="guest"] .bid-work-guest-message {
        display: block;
    }
    html body.unified-page #homeModules #bidWorkCard[data-work-audience="guest"] :is(.info-card-loading, #bidWorkFooter) {
        display: none !important;
    }

    /* Keep the result-window entry to the right of registration for guests. */
    html body.unified-page.closed-beta-restricted:not(.results-dialog-active):has(#bidWorkCard[data-work-audience="guest"]) #searchSection .search-buttons {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        grid-template-areas: "create results" !important;
        min-width: 0 !important;
    }
    html body.unified-page.closed-beta-restricted:not(.results-dialog-active):has(#bidWorkCard[data-work-audience="guest"]) #searchSection #homePrivateBidCreateAction {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
    }

    /* The closed-beta owner disables these actions. Enabled actions keep their
       normal styles; unavailable ones occupy no space and cannot receive focus. */
    html body.unified-page:has(#bidWorkCard[data-work-audience="guest"]) .header-actions :is(#notificationBtn, #consultToggleBtn, #shellMenuBtn):is(:disabled, [aria-disabled="true"]) {
        display: none !important;
    }
}

/* D2-21: label and badge have separate tracks, reserved on the first paint. */
html body.unified-page:not(.results-dialog-active) #searchSection #licenseFilterBtn {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 24px !important;
    min-width: 104px !important;
    box-sizing: border-box !important;
    padding: 0 8px !important;
    gap: 4px !important;
}

html body.unified-page:not(.results-dialog-active) #searchSection #licenseFilterBtn .filter-badge {
    position: static !important;
    grid-column: 2;
    width: 24px !important;
    min-width: 24px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 2px !important;
}

@media (max-width: 767px) {
    html body.unified-page:not(.results-dialog-active) #searchSection .search-buttons {
        grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr) !important;
    }
}

@media (min-width: 768px) {
    html body.unified-page:not(.results-dialog-active) #searchSection .search-buttons {
        grid-template-columns: 104px minmax(78px, 1fr) minmax(78px, 1fr) minmax(112px, 1.25fr) minmax(98px, 1fr) !important;
        border-top: 0 !important;
    }
}

/* static/css/home_notice_band.css */
/* D2-9: home notice band (DES_D2-9, DES_DECISIONS 9·12).
   One line in the place D2-6 reserved (#homeNoticeSlot). The server renders it and
   an inline script decides which band shows before the first paint, so nothing moves
   after loading. No notice (or every notice closed) → the slot stays hidden, height 0. */

body.unified-page #homeNoticeSlot:not([hidden]) {
    display: block;
    margin: 0 0 8px;
}
body.unified-page #homeNoticeSlot .home-notice-band[hidden] { display: none !important; }
body.unified-page #homeNoticeSlot .home-notice-band {
    display: flex;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 0 0 12px;
    border: 1px solid #f1d9a6;
    border-radius: 10px;
    background: #fff8e8;
    color: #4a3300;
    overflow: hidden;
}
body.unified-page #homeNoticeSlot .home-notice-band-icon {
    flex: none;
    font-size: 15px;
    line-height: 1;
}
body.unified-page #homeNoticeSlot .home-notice-band-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
body.unified-page #homeNoticeSlot .home-notice-band-more,
body.unified-page #homeNoticeSlot .home-notice-band-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7a4f00;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
body.unified-page #homeNoticeSlot .home-notice-band-close {
    width: 44px;
    padding: 0;
    font-size: 18px;
    font-weight: 400;
}
body.unified-page #homeNoticeSlot .home-notice-band-more:hover,
body.unified-page #homeNoticeSlot .home-notice-band-close:hover { background: rgba(122, 79, 0, 0.08); }
body.unified-page #homeNoticeSlot .home-notice-band-more:focus-visible,
body.unified-page #homeNoticeSlot .home-notice-band-close:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}
body.unified-page #homeNoticeSlot .home-notice-band-more[aria-busy="true"] { opacity: 0.6; }

@media (max-width: 767px) {
    /* Mobile: under the fixed search, inside the 16px page gutter (D2-7). */
    body.unified-page #homeNoticeSlot:not([hidden]) { margin: 8px 16px 0; }
}

@media (min-width: 768px) {
    body.unified-page #homeNoticeSlot .home-notice-band { height: 40px; }
    body.unified-page #homeNoticeSlot .home-notice-band-more { min-width: 32px; height: 32px; }
    body.unified-page #homeNoticeSlot .home-notice-band-close { width: 32px; min-width: 32px; height: 32px; margin-right: 4px; }
}

html[data-theme="dark"] body.unified-page #homeNoticeSlot .home-notice-band {
    border-color: #5a4a22;
    background: #2b2616;
    color: #f3e3bd;
}
html[data-theme="dark"] body.unified-page #homeNoticeSlot .home-notice-band-more,
html[data-theme="dark"] body.unified-page #homeNoticeSlot .home-notice-band-close { color: #f6d58a; }

