/* Geometry contract: shared-shell safe-area inputs and remainder are defined here;
   app_shell_frame.js alone publishes measured chrome/ad/viewport dimensions. */
:root {
    --app-frame-safe-top: env(safe-area-inset-top, 0px);
    --app-frame-safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-frame-ad-content: 36px;
    --app-frame-ad-total: calc(var(--app-frame-ad-content) + var(--app-frame-safe-bottom));
    --app-frame-bottom: max(var(--app-bottom-reserved, 0px), var(--app-frame-safe-bottom));
    --app-frame-safe-remainder: max(0px, calc(var(--app-frame-safe-bottom) - var(--app-bottom-reserved, 0px)));
}
:root.mobile-brand-reserved body.app-shared-shell,
:root body.app-shared-shell {
    --app-dialog-safe-bottom: var(--app-frame-safe-bottom);
}
/* Every application page uses the same bounded chrome and content tracks. */
body.app-shared-shell:has(> #appMainFrame) {
    margin: 0; padding: 0; width: 100%; height: 100dvh !important; min-height: 0;
    display: block; overflow: hidden !important;
    background: var(--color-bg, #f6f7fb); color: var(--color-text, #172033);
    font-family: Pretendard, -apple-system, "Noto Sans KR", sans-serif;
}
html body.app-shared-shell.app-shell > #appMainFrame,
html body.app-shared-shell > #appMainFrame {
    position: relative !important; display: grid !important;
    grid-template-areas: "viewport" "advertising" !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important; height: 100dvh !important;
    min-height: 0 !important; overflow: hidden !important;
}
html body.app-shared-shell > #appMainFrame > #appViewportRegion {
    grid-area: viewport; display: flex !important; flex-direction: column !important;
    width: 100% !important; max-width: none !important; height: auto !important;
    min-height: 0 !important; min-width: 0; margin: 0 !important; padding: 0 !important;
    overflow: hidden !important;
}
html body.app-shared-shell #appMenuRegion {
    position: relative !important; top: 0; flex: 0 0 auto; width: 100%; z-index: 9001;
    background: var(--color-surface, #fff); border-bottom: 1px solid var(--color-border, #dce3ed);
    padding-top: var(--app-frame-safe-top);
}
/* Page header rules must not change the shared chrome track. */
html body.app-shared-shell #appMenuRegion,
html body.app-shared-shell #appMenuRegion * { box-sizing: border-box; }
html body.app-shared-shell #appMenuRegion > header { margin: 0 !important; padding: 8px 16px !important; background: transparent; border: 0 !important; box-shadow: none; }
html body.app-shared-shell #appMenuRegion .header-content { padding: 0 !important; }
html body.app-shared-shell #appMenuRegion .global-nav { border-left: 1px solid var(--color-border, #dce3ed); padding-left: 4px; }
body.app-shared-shell #appMenuRegion .header-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-width: 0; }
body.app-shared-shell #appMenuRegion .header-title { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
body.app-shared-shell #appMenuRegion h1 { margin: 0; font-size: 16px; line-height: 1.3; color: inherit; }
body.app-shared-shell #appMenuRegion .app-shell-brand { color: inherit; text-decoration: none; }
body.app-shared-shell #appMenuRegion .header-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; min-width: 0; }
body.app-shared-shell #appMenuRegion .header-group { display: flex; align-items: center; gap: 4px; }
body.app-shared-shell #appMenuRegion .header-icon-btn {
    position: relative; display: grid; grid-template-rows: var(--header-icon-size) var(--header-caption-area);
    align-content: center; justify-items: center;
    --header-icon-size: 36px; --header-caption-area: 18px;
    box-sizing: border-box; flex: 0 0 auto; width: 48px; min-width: 0; height: 62px; min-height: 62px;
    margin: 0; padding: 3px 2px; gap: 2px; border: 0; border-radius: 8px;
    background: transparent; color: var(--color-text, #172033); font: inherit;
    text-decoration: none; cursor: pointer;
}
body.app-shared-shell #appMenuRegion .header-icon-btn:hover,
body.app-shared-shell #appMenuRegion .header-icon-btn.is-active { background: var(--color-bg, #eef3fb); }
body.app-shared-shell #appMenuRegion .header-icon-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
body.app-shared-shell #appMenuRegion .header-icon-emoji { display: inline-flex; align-items: center; justify-content: center; width: var(--header-icon-size); height: var(--header-icon-size); min-width: var(--header-icon-size); line-height: 1; }
body.app-shared-shell #appMenuRegion .header-icon-symbol svg { display: block; width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
body.app-shared-shell #appMenuRegion .header-icon-symbol {
    color: #fff; border-radius: 9px;
    background: linear-gradient(135deg, var(--icon-accent, #2563eb), var(--icon-accent-2, #38bdf8));
    box-shadow: 0 4px 10px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.32);
}
body.app-shared-shell #appMenuRegion .header-icon-home { --icon-accent: #0ea5e9; --icon-accent-2: #2563eb; }
body.app-shared-shell #appMenuRegion .header-icon-work { --icon-accent: #0f766e; --icon-accent-2: #14b8a6; }
body.app-shared-shell #appMenuRegion .header-icon-magnifier { --icon-accent: #1d4ed8; --icon-accent-2: #38bdf8; }
body.app-shared-shell #appMenuRegion .header-icon-chat { --icon-accent: #2563eb; --icon-accent-2: #06b6d4; }
body.app-shared-shell #appMenuRegion .header-icon-ai { --icon-accent: #7c3aed; --icon-accent-2: #ec4899; }
body.app-shared-shell #appMenuRegion .header-icon-alert { --icon-accent: #f59e0b; --icon-accent-2: #f97316; }
body.app-shared-shell #appMenuRegion .header-icon-qna { --icon-accent: #059669; --icon-accent-2: #22c55e; }
body.app-shared-shell #appMenuRegion .header-icon-help { --icon-accent: #475569; --icon-accent-2: #0ea5e9; }
body.app-shared-shell #appMenuRegion .header-icon-account { --icon-accent: #64748b; --icon-accent-2: #334155; }
body.app-shared-shell #appMenuRegion .header-icon-admin { --icon-accent: #9333ea; --icon-accent-2: #4f46e5; }
body.app-shared-shell #appMenuRegion .header-ai-text { fill: currentColor; stroke: none; font: bold 12px sans-serif; }
body.app-shared-shell #appMenuRegion .header-icon-label { display: block; height: var(--header-caption-area); min-height: var(--header-caption-area); max-width: 100%; font-size: 12px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.app-shared-shell #appNoticeRegion { flex: 0 0 auto; min-height: 0; }
html body.app-shared-shell #appContentRegion {
    position: relative; flex: 1 1 auto !important; min-width: 0; min-height: 0;
    height: auto !important; overflow: auto !important; overscroll-behavior: contain;
    margin-bottom:var(--app-frame-safe-remainder); padding-bottom:0 !important; box-sizing:border-box;
    -webkit-overflow-scrolling:touch;
}
body.app-shared-shell:not(.unified-page) #appContentRegion > .container { height: auto !important; max-height: none !important; overflow: visible; }
body.private-bids-page.app-shared-shell #appContentRegion { display: block; }
body.private-bids-page.app-shared-shell #appContentRegion > .container { display: flex; flex-direction: column; height: auto !important; max-height: none !important; min-height: 100%; }
body.private-bids-page.app-shared-shell #appContentRegion > .container > main { flex: 1; min-height: 0; overflow: visible !important; }
body.app-shared-shell .app-page-heading { padding: 12px 16px; }
body.app-shared-shell .app-page-heading h2 { margin: 0; font-size: 18px; }
body.app-shared-shell:has(#msgApp) #appContentRegion { display: flex; flex-direction: column; overflow: hidden !important; }
body.app-shared-shell #appContentRegion #msgApp { flex: 1; min-height: 0; width: 100%; }
body.app-shared-shell .messenger-auth-state { min-height: 0; height: 100%; box-sizing: border-box; overflow: auto; }
html body.app-shared-shell > #appMainFrame > #appServiceRegion {
    position: absolute !important; top: var(--app-shell-content-top, 0px) !important;
    right: 0; bottom: var(--app-frame-bottom) !important; left: 0;
    height: auto !important; min-height: 0; overflow: hidden; pointer-events: none;
    z-index: var(--z-overlay, 10000);
}
body.app-shared-shell #appServiceRegion > * { pointer-events: auto; }
html body.app-shared-shell > #appMainFrame > #appAdRegion {
    grid-area: advertising; position: relative !important; inset: auto !important;
    width: 100% !important; height: auto !important; min-height: 0 !important;
    margin: 0 !important; border-radius: 0 !important; overflow: hidden;
    padding: 0; background: var(--color-surface, #fff);
    z-index: 1 !important;
}
html body.app-shared-shell > #appMainFrame > #appAdRegion[hidden],
html body.app-shared-shell > #appMainFrame > #appAdRegion:empty { display: none !important; padding: 0; }
html body.app-shared-shell #appAdRegion #adBannerArea {
    margin: 0 !important; border: 0; border-radius: 0; box-sizing: border-box;
    height:auto !important; min-height:0 !important; max-height:none !important;
    font-size: 12px; line-height: 16px;
}
/* The film paints through the home-indicator inset. Controls stay above it;
   there is one measured strip, rather than a second white safe-area row. */
body.app-shared-shell #appAdRegion .iliya-brand-film { box-sizing: border-box; }
@media (max-width: 767px) {
    html body.app-shared-shell #appAdRegion #adBannerArea[data-brand-visible="1"] > .iliya-brand-film {
        height: calc(var(--app-frame-ad-content) + var(--app-frame-safe-bottom));
        padding-bottom: var(--app-frame-safe-bottom); border: 0;
    }
    body.app-shared-shell #appAdRegion .iliya-brand-content {
        bottom: var(--app-frame-safe-bottom); right: 50px; padding: 0 6px 0 10px;
        grid-template-columns: 76px 1px minmax(0,1fr); column-gap: 8px;
    }
    body.app-shared-shell #appAdRegion .iliya-brand-lockup { flex-direction:column; align-items:center; gap:0; }
    body.app-shared-shell #appAdRegion .iliya-brand-wordmark { font-size:14px; line-height:22px; }
    body.app-shared-shell #appAdRegion .iliya-brand-tagline { font-size:12px; line-height:18px; }
    body.app-shared-shell #appAdRegion .iliya-brand-divider { height:32px; }
    body.app-shared-shell #appAdRegion .iliya-brand-copy { height:var(--app-frame-ad-content); font-size:12px; line-height:20px; }
    body.app-shared-shell #appAdRegion .iliya-brand-scene small { font-size:12px; line-height:20px; }
    body.app-shared-shell #appAdRegion .iliya-brand-motion {
        width:40px; min-width:40px; height:40px; min-height:40px; border-radius:8px;
    }
    body.app-shared-shell #appAdRegion .iliya-brand-motion { top: calc((100% - var(--app-frame-safe-bottom)) / 2); }
}
body.app-shared-shell #appAdRegion .ad-banner-content {
    box-sizing: border-box; display: flex; align-items: center; justify-content: center;
    height: calc(var(--app-frame-ad-content) + var(--app-frame-safe-bottom));
    min-height: 0; gap: 8px; padding: 4px 12px; font-size: calc(var(--app-frame-ad-content) * .39); line-height: 16px;
}
body.app-shared-shell #appAdRegion #adBannerArea[data-brand-visible="1"] > .ad-banner-content { display: none; }
@media (min-width: 768px) {
    html body.app-shared-shell #dashboardSection .dash-col-calendar { overflow-y: auto !important; min-height: 0; }
    html body.app-shared-shell #dashboardSection #infoCardsSection:not(.hidden) { display: block !important; flex: 0 0 auto !important; overflow: visible !important; padding: 0; }
    html body.app-shared-shell #dashboardSection #mobileInfoPrimary { display: flex; flex-direction: column; gap: 10px; min-height: 0 !important; height: auto !important; }
    html body.app-shared-shell #dashboardSection #infoCardsSection .info-section-divider,
    html body.app-shared-shell #dashboardSection #bidWorkCard { display: none !important; }
    html body.app-shared-shell #dashboardSection #infoCardsSection .info-card { padding: 12px; }
}
@media (max-width: 767px) {
    html body.app-shared-shell #appMenuRegion .header-content { flex-direction: column; align-items: stretch !important; gap: 0 !important; }
    html body.app-shared-shell #appMenuRegion > header { padding: 1px 8px 3px !important; }
    html body.app-shared-shell #appMenuRegion .header-title { min-height: 22px !important; }
    html body.app-shared-shell #appMenuRegion h1 { font-size: 16px !important; line-height: 1.18 !important; padding: 1px 0 2px !important; }
    html body.app-shared-shell #appMenuRegion .global-nav { border: 0; padding: 0; }
    body.app-shared-shell #appMenuRegion .header-actions { gap: 4px; width: 100%; justify-content: space-between; }
    body.app-shared-shell #appMenuRegion .header-group { flex: 1; justify-content: space-around; gap: 0; }
    body.app-shared-shell #appMenuRegion .global-nav { flex: 2; }
    body.app-shared-shell #appMenuRegion .header-icon-btn { width: min(39px, 10vw); min-width:0 !important; flex-shrink:1; height: 58px; min-height: 58px; --header-icon-size: 34px; --header-caption-area: 19px; padding: 2px 0; row-gap: 1px; }
    body.app-shared-shell #appMenuRegion .header-icon-symbol svg { width: 26px; height: 26px; }
    html body.unified-page.app-shared-shell:not(.mobile-shell-embed) #homeModules {
        --home-gap: var(--space-2, 8px); --home-gutter: var(--space-2, 8px); padding: 8px !important;
    }
    html body.unified-page.app-shared-shell #homeModules #mobileHomeSummaryRegion { padding: 0 !important; }
    body.unified-page.app-shared-shell .date-weather-row { gap: 8px; }
    html body.unified-page.app-shared-shell #homeModules :is(#dateCard, #weatherCard) {
        padding: 8px !important; min-height: 76px !important; height: auto !important;
    }
    html body.unified-page.app-shared-shell #mobileInfoPrimary > :is(#newsCard, #stockCard, #bidWorkCard) { padding: 8px !important; }
    html body.app-shared-shell #infoCardsSection { padding-bottom: 0 !important; }
    body.unified-page.app-shared-shell #infoCardsSection #newsContent.info-card-body { min-height: 89px !important; }
    body.unified-page.app-shared-shell #infoCardsSection #stockContent.info-card-body { min-height: 44px !important; }
    body.unified-page.app-shared-shell #infoCardsSection .info-card-loading--stock .info-card-loading-lines { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html body.app-shared-shell #appContentRegion #mobileInfoPrimary { height: auto !important; min-height: 0 !important; }
}
/* Preserve three reachable purchase actions after adding the shared header. */
@media (max-width: 640px) {
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .topbar .nav { display: none; }
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .product-heading { padding-top: 2px !important; padding-bottom: 2px !important; }
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .product-actions { padding-top: 0 !important; }
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .product-more { margin-top: 0 !important; }
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .product-card { padding-bottom: 6px; }
    html body.pricing-page.app-shared-shell[data-pricing-view="web"] .product-grid { gap: 6px; margin-top: 4px; }
}

/* A main-menu service occupies the content track, leaving navigation reachable.
   Nested content dialogs retain their own modal stacking and close guards. */
html body.app-shared-shell #appServiceRegion > #notifInboxModal {
    position: absolute !important; inset: 0 !important; height:100% !important; max-height:100%; min-height:0; padding: 8px;
}
html body.app-shared-shell #appServiceRegion > #notifInboxModal > .notif-inbox-panel {
    height: 100%; max-height: 100% !important; min-height: 0;
}
@media (max-width: 767px) {
    html body.app-shared-shell #appServiceRegion > #notifInboxModal { padding: 0; }
    html body.app-shared-shell #notifInboxModal .notif-inbox-header { min-height: 56px; padding-top: 6px; }
}

/* Text campaigns also paint/reserve the indicator inset on safe-area devices. */
html body.app-shared-shell #appAdRegion #adBannerArea:not([data-brand-visible="1"]) > .ad-banner-content {
    padding-bottom: calc(4px + var(--app-frame-safe-bottom));
}
@media (max-width: 767px) {
    html body.unified-page.app-shared-shell #searchSection :is(.search-panel, .search-box, .search-buttons) {
        gap: var(--space-1, 4px) !important;
    }
}

/* Leave the location menu's own hit area clear of weather summary glyphs. */
html body.unified-page.app-shared-shell #weatherCardOpen.weather-card-open { padding-top:40px; }

/* Chat already lives in the bounded content track. The indicator padding belongs
   to its composer (not both the track and the composer). */
html body.app-shared-shell:has(#msgApp) #appContentRegion { margin-bottom:0; padding-bottom:0 !important; }
html body.app-shared-shell .msg-message-composer { padding-bottom:calc(10px + var(--app-frame-safe-remainder)) !important; }
html body.app-shared-shell .msg-message-composer { flex:0 0 auto; }
html body.app-shared-shell .msg-scroll-area { box-sizing:border-box; }
html body.app-shared-shell #appToast { bottom:calc(var(--app-frame-bottom) + 16px) !important; }
html body.app-shared-shell .voice-floating-bar.vfb-mobile-fixed:not(.vfb-messenger) { bottom:calc(var(--app-frame-bottom) + 6px) !important; }
/* Full-screen call/chat panels receive the same lower boundary as all dialogs. */
html body.app-shared-shell .msg-collab-overlay { bottom:var(--app-frame-bottom); }

/* #450-64: desktop pages and main-menu services share the content scroll port. */
@media (min-width: 768px) {
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection {
        height: auto !important; max-height: none !important; overflow: visible !important;
        grid-template-columns: minmax(340px, .8fr) minmax(0, 2fr) !important;
        grid-template-rows: auto !important; align-items: start !important; gap: 16px !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection :is(.dash-col, #sideBookmarkList, #homeWeekList, #dashNewList, #dashClosingList, #dashPrivateBidList, #dashAwardedList),
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #sideBookmarkList,
    html body.app-shared-shell #appContentRegion .settings-main {
        height: auto !important; max-height: none !important; overflow: visible !important;
        min-height: 0 !important; overscroll-behavior: auto !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #searchBookmarkSide {
        /* Search determines this row's height; the preview cannot enlarge it. */
        position: absolute !important; inset: 0 auto auto 0 !important; height: 100% !important;
        grid-column: 1 / 2 !important; grid-row: 1 / 2 !important;
        width: 100% !important; max-height: none !important; overflow: visible !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion .search-bookmark-row {
        grid-template-columns: minmax(340px, .8fr) minmax(0, 2fr) !important;
        column-gap: 16px !important; position: relative !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #sideBookmarkList {
        flex: 1 1 0 !important;
        display: flex; flex-direction: column;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList > [hidden] {
        display: none !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList > .bm-side-item {
        flex: 0 0 auto; min-height: 44px; box-sizing: border-box;
        align-items: center; padding: 4px 12px;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList > .bm-side-viewall {
        flex: 0 0 auto; min-height: 32px; box-sizing: border-box;
        display: flex; align-items: center; justify-content: center; padding: 4px 12px; margin-top: auto;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList > .bm-side-empty {
        flex: 1; display: grid; place-items: center; padding: 4px 12px;
    }
    /* The page already exposes its last-update time. Spend the compact preview
       height on an actionable row and the full-list link instead of a second stamp. */
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList:is([data-home-card-state="ready"], [data-home-card-state="empty"]):not([data-home-card-stale="true"]) {
        padding-bottom: 0;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList[data-home-card-state="ready"]:not([data-home-card-stale="true"]) > .home-card-feedback {
        display: none;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList:is([data-home-card-state="loading"], [data-home-card-state="error"], [data-home-card-state="login_required"]) > .home-card-feedback {
        flex-direction: row; flex-wrap: wrap; align-content: center; padding: 4px 8px; overflow: visible;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #sideBookmarkList .home-card-skeleton {
        display: none;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion > main {
        height: auto !important; max-height: none !important; overflow: visible !important;
        flex: 0 0 auto !important;
    }
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection .dash-weather-panel {
        height: auto !important; min-height: 0 !important; max-height: none !important;
        overflow: visible !important; padding: 12px !important; margin-top: 12px;
    }
    html body.app-shared-shell .dash-weather-panel :is(div, span, strong, button) { text-overflow: clip !important; overflow: visible; line-height: 1.5; }
    html body.app-shared-shell .dash-weather-top {
        display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; padding: 8px 0;
    }
    html body.app-shared-shell .dash-weather-left { min-width: 68px; padding-right: 8px; margin-right: 0; }
    html body.app-shared-shell :is(.dash-weather-icon, .dash-weather-temp) { line-height: 1.4; }
    html body.app-shared-shell .dash-weather-right { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    html body.app-shared-shell .dash-wx-item { overflow: visible; font-size: 12px; line-height: 1.5; gap: 6px; }
    html body.app-shared-shell .dash-wx-day {
        display: grid; grid-template-columns: max-content max-content minmax(0, 1fr);
        gap: 4px 8px; padding: 8px 0; align-items: center;
    }
    html body.app-shared-shell .dash-wx-day-label { width: auto; white-space: nowrap; }
    html body.app-shared-shell .dash-wx-day-desc { grid-row: 2; grid-column: 1 / -1; overflow: visible; white-space: nowrap; }
    html body.app-shared-shell .dash-wx-day-temps { justify-content: flex-end; white-space: nowrap; }
    html body.app-shared-shell .dash-wx-day-extra { grid-row: 3; grid-column: 3; width: auto; white-space: nowrap; }
    html body.app-shared-shell #appContentRegion { overflow: auto !important; }
    html body.app-shared-shell #appContentRegion[data-desktop-surface] > [data-desktop-page] { display: none !important; }
    html body.app-shared-shell #appContentRegion > [data-desktop-service] {
        position: relative !important; inset: auto !important; transform: none !important;
        width: 100% !important; max-width: none !important; height: auto !important;
        min-height: 100%; max-height: none !important; overflow: visible !important; box-sizing: border-box; padding: 12px;
    }
    html body.app-shared-shell:has(#msgApp) #appContentRegion { overflow: hidden !important; }
    html body.app-shared-shell #appContentRegion :is(.qna-panel, .notif-inbox-panel, .consult-overlay-panel) {
        position: relative !important; inset: auto !important; transform: none !important;
        width: 100% !important; max-width: none !important; height: auto !important;
        max-height: none !important; overflow: visible !important;
    }
    html body.app-shared-shell #appContentRegion :is(#qnaContent, #notifInboxList, #consultMessages) {
        height: auto !important; max-height: none !important; overflow: visible !important;
    }
    /* #545-1: 게시판·알림·상담 keep their title and close row in view, like the messenger.
       The service fills the content region, which does not scroll; only its list does, so
       restoring a long consultation or scrolling a long list never moves the header away. */
    html body.app-shared-shell #appContentRegion:is([data-desktop-surface="consult"], [data-desktop-surface="qna"], [data-desktop-surface="notification"]) {
        overflow: hidden !important;
    }
    html body.app-shared-shell #appContentRegion > :is([data-desktop-service="consult"], [data-desktop-service="qna"], [data-desktop-service="notification"]) {
        height: 100% !important; min-height: 0;
    }
    html body.app-shared-shell #appContentRegion > [data-desktop-service] :is(.qna-panel, .notif-inbox-panel, .consult-overlay-panel) {
        height: 100% !important; min-height: 0 !important; overflow: hidden !important;
    }
    html body.app-shared-shell #appContentRegion :is(#qnaContent, #notifInboxList, #consultMessages) {
        flex: 1 1 0; min-height: 0 !important; overflow-x: hidden !important; overflow-y: auto !important;
    }
    html body.app-shared-shell #appContentRegion :is(#msgApp, #msgBody, #msgChatView) {
        height: 100% !important; min-height: 0 !important; max-height: none !important; overflow: hidden !important;
        flex: 1 1 0 !important;
    }
    html body.app-shared-shell #msgMessageList {
        position: absolute !important; inset: 0 !important; height: auto !important;
        max-height: none !important; overflow-y: auto !important; overflow-x: hidden !important;
    }
    html body.app-shared-shell #msgChatView > .msg-message-composer { position: static; bottom: auto; }
    html body.app-shared-shell :is(.msg-message-composer, .consult-input-row) {
        position: sticky; bottom: 0; z-index: 2; background: var(--color-surface, #fff);
    }
}

/* Narrow desktops retain the existing compact search rail. The calendar needs
   its wider weather column, while the search controls need the remaining width. */
@media (min-width: 768px) and (max-width: 1199px) {
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion .search-bookmark-row {
        grid-template-columns: var(--desktop-side-rail) minmax(0, 1fr) !important;
        column-gap: var(--desktop-content-gap) !important;
    }
}

/* #450-84: one content height; the actual indicator inset is a separate track.
   All content/dialog/composer boundaries still consume the measured reserve. */
html body.app-shared-shell #appAdRegion #adBannerArea[data-brand-visible="1"] > .iliya-brand-film {
    height: var(--app-frame-ad-total) !important;
    padding-bottom: var(--app-frame-safe-bottom); min-height: 0 !important;
}
html body.app-shared-shell #appAdRegion .iliya-brand-content {
    bottom: var(--app-frame-safe-bottom); right: 36px; padding: 0 6px;
    grid-template-columns: 76px 1px minmax(0, 1fr); column-gap: 6px;
}
html body.app-shared-shell #appAdRegion .iliya-brand-lockup { gap: 0; }
html body.app-shared-shell #appAdRegion .iliya-brand-wordmark { font-size: 14px; line-height: 16px; }
html body.app-shared-shell #appAdRegion .iliya-brand-tagline { font-size: 12px; line-height: 16px; }
html body.app-shared-shell #appAdRegion .iliya-brand-divider { height: 24px; }
html body.app-shared-shell #appAdRegion .iliya-brand-copy { height: var(--app-frame-ad-content); font-size: 12px; line-height: 16px; }
html body.app-shared-shell #appAdRegion .iliya-brand-scene small { font-size: 12px; line-height: 16px; }
html body.app-shared-shell #appAdRegion .iliya-brand-motion {
    width: 32px; min-width: 32px; height: 32px; min-height: 32px; right: 2px;
    top: calc(var(--app-frame-ad-content) / 2);
}
/* The fixed notification count is a corner counter, not a content chip. */
html body.app-shared-shell #appMenuRegion #notificationBtn #notifBadge {
    top: -2px !important; right: -4px !important; height: 16px !important;
    min-height: 16px !important; min-width: 16px !important; padding: 0 3px !important;
    font-size: 12px !important; line-height: 16px !important; border-radius: 8px !important;
}
html body.app-shared-shell #appAdRegion .iliya-brand-wordmark { font-size: 14px; line-height: 15px; }
html body.app-shared-shell #appAdRegion .iliya-brand-tagline { line-height: 15px; }
html body.app-shared-shell #appAdRegion .iliya-brand-copy,
html body.app-shared-shell #appAdRegion .iliya-brand-scene small { line-height: 15px; }

/* #450-85: all six existing phrases rotate one line at a time. */
html body.app-shared-shell #appAdRegion .iliya-brand-content { right: 28px; grid-template-columns: 108px 1px minmax(0,1fr); column-gap: 5px; }
html body.app-shared-shell #appAdRegion .iliya-brand-lockup { flex-direction: row; align-items: center; gap: 4px; }
html body.app-shared-shell #appAdRegion .iliya-brand-divider { height: 18px; }
html body.app-shared-shell #appAdRegion .iliya-brand-scene { flex-direction:row; align-items:center; }
html body.app-shared-shell #appAdRegion .iliya-brand-scene > :is(span,small) { position:absolute; inset:0; display:flex; align-items:center; white-space:nowrap; font-size:12px; line-height:18px; overflow:visible; }
html body.app-shared-shell #appAdRegion .iliya-brand-scene > span { font-size:14px; }
html body.app-shared-shell #appAdRegion .iliya-brand-scene > small { opacity:0; }
html body.app-shared-shell #appAdRegion .iliya-brand-film:has(video.is-playing) .iliya-brand-scene > span { animation:iliya-brand-inline-first 6s steps(1,end) infinite; }
html body.app-shared-shell #appAdRegion .iliya-brand-film:has(video.is-playing) .iliya-brand-scene > small { animation:iliya-brand-inline-second 6s steps(1,end) infinite; }
@keyframes iliya-brand-inline-first { 0%,49.999% {opacity:1;} 50%,100% {opacity:0;} }
@keyframes iliya-brand-inline-second { 0%,49.999% {opacity:0;} 50%,100% {opacity:1;} }
@media (prefers-reduced-motion:reduce) {
    html body.app-shared-shell #appAdRegion .iliya-brand-film:has(video.is-playing) .iliya-brand-scene > :is(span,small) { animation:none; }
}
html body.app-shared-shell #appAdRegion .iliya-brand-motion { width:24px; min-width:24px; height:24px; min-height:24px; }

/* Adopted shared chrome: the outer menu owns an opaque safe-area surface. */
html body.app-shared-shell #appMenuRegion,html body.app-shared-shell #appMenuRegion > header { background:var(--color-surface,#fff) !important; filter:none !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }

/* #450-106: keep the desktop home frame in the first viewport; existing columns
   retain their own full-data scroll ports. Business disclosures follow the frame. */
@media (min-width:768px) {
    html body.home-adopted.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion > main {
        display:flex; flex-direction:column; height:100% !important; min-height:0;
        box-sizing:border-box;
    }
    html body.home-adopted.unified-page.app-shared-shell #searchBookmarkRow { flex:0 0 auto; }
    html body.home-adopted.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection {
        flex:1 1 0; height:0 !important; min-height:0 !important; overflow:hidden !important;
        grid-template-rows:minmax(0,1fr) !important; align-items:stretch !important;
    }
    html body.home-adopted.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #homeModules #dashboardSection > .dash-col-main {
        height:100% !important; min-height:0 !important; overflow-y:auto !important;
    }
}
@media (min-width:768px) {
    html body.home-adopted.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection { overflow:visible !important; }
}
/* Short desktop windows retain the full month, forecast and both information
   cards. Compact rows use the same content and controls without a collapsed view. */
@media (min-width:768px) and (max-height:850px) {
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #dashCalendarPanel { padding-block:2px !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #dashCalendarPanel .dash-mini-cal-header { padding:0 !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #dashCalendarPanel :is(.dash-mcal-day,.dash-mcal-dayname) { padding:0 !important; min-height:0 !important; line-height:14px !important; }
    html body.home-adopted.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection .dash-weather-panel { padding:2px !important; margin-top:0 !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-top { padding:2px 0 !important; gap:4px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-right { grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:2px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-left { min-width:60px; padding-right:4px; margin-right:4px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection :is(.dash-weather-icon,.dash-weather-temp) { line-height:1.1; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-icon { font-size:22px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-temp { font-size:18px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-loc { padding:0 6px 1px; line-height:14px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-weather-forecast { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day { display:grid !important; grid-template-columns:20px minmax(0,1fr); grid-template-areas:"label label" "icon desc" "temps temps" "extra extra"; grid-template-rows:14px 22px 16px 16px; padding:1px !important; gap:0; min-width:0; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > span { width:auto; line-height:16px; grid-row:auto; grid-column:auto; white-space:normal; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > .dash-wx-day-label { grid-area:label; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > .dash-wx-day-icon { grid-area:icon; font-size:18px; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #mobileInfoPrimary { gap:0 !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection :is(#newsCard,#stockCard) { margin-top:2px !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > .dash-wx-day-desc { grid-area:desc; white-space:nowrap !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > .dash-wx-day-temps { grid-area:temps; justify-content:center; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection .dash-wx-day > .dash-wx-day-extra { grid-area:extra; justify-content:center; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #newsContent .news-item { padding-block:1px !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #dashboardSection #dashCalendarPanel #homeWeekList .home-week-empty { padding-block:2px !important; line-height:16px; }
}
