/* 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;
}
.home-card-settings-sheet .home-card-switches { margin: 0 0 8px; padding: 0; list-style: none; }
.home-card-settings-sheet .home-card-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    border-bottom: 1px solid var(--color-border-light, #e2e8f0);
    cursor: pointer;
}
.home-card-settings-sheet .home-card-switch-text { display: grid; gap: 2px; }
.home-card-settings-sheet .home-card-switch-text strong { font-size: 16px; }
.home-card-settings-sheet .home-card-switch-text small { color: var(--color-text-secondary, #64748b); font-size: 13px; }
.home-card-settings-sheet .home-card-switch input {
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    accent-color: var(--color-primary, #2563eb);
    cursor: pointer;
}
.home-card-settings-sheet .home-card-settings-status {
    min-height: 20px;
    margin: 0 0 12px;
    color: var(--color-text-secondary, #475569);
    font-size: 14px;
}
/* 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-23: size the mobile work chips from their labels. Reserve the final
   bookmark term before home_modules.js replaces the legacy server copy. */
@media (max-width: 767px) {
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn[data-work-tab] {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 44px !important;
        max-width: none !important;
        padding: 0 7px !important;
        box-sizing: border-box;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn[data-work-tab="bookmarks"] {
        min-width: calc(4em + 14px) !important;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn::before {
        left: 3px;
        right: 3px;
        width: auto;
        transform: translateY(-50%);
    }
}

/* ── 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). D2-26: the bookmark rail is back
   in column 1 of the search row, so the search box keeps its own column 2. */
@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 {
        position: relative !important;
        isolation: isolate;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #475569 !important;
        font: inherit;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 18px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        cursor: pointer;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: min(30px, calc(100% - 6px));
        height: 18px;
        transform: translate(-50%, -50%);
        z-index: -1;
        border: 1px solid #d9e2ef;
        border-radius: 6px;
        background: #f8fafc;
        pointer-events: none;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn:is(.active, [aria-selected="true"]) {
        color: #1d4ed8 !important;
    }
    html body.unified-page #homeModules #bidWorkTabs .info-tab-btn:is(.active, [aria-selected="true"])::before {
        border-color: #2563eb;
        background: #eff6ff;
    }
    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;
    }

    /* The restricted rail contains just the registration link. Give that link
       the full row instead of the old 64px column; keep the access-state rule. */
    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) !important;
        grid-template-areas: "create" !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;
    }
}
