/* static/css/layoutref_dialogs.css */
/* LAYOUTREF batch 4: keep approved navy headers and all dialog lifecycles. */
html body .modal > .modal-content > .modal-header {
    box-sizing: border-box;
    min-height: 56px;
    padding: 0 var(--dialog-pad);
    align-items: center;
    gap: var(--gap-inline);
}
html body .modal > .modal-content > .modal-header :is(h2, .modal-title) {
    margin: 0;
    font-size: 18px !important;
    line-height: 1.3;
    color: white !important;
}
html body .modal-title-area { min-width: 0; gap: var(--space-1); }
html body .modal-title-area .type-badge {
    font-size: 12px;
    line-height: 1.3;
    padding: 0 var(--space-2);
    border-radius: var(--radius-control);
}
html body .modal:not(#detailModal) > .modal-content > .modal-body {
    padding: var(--dialog-pad);
}
/* The detail action grid is actions-flow-v1. Align its header to the existing
   body gutter without changing that body's padding or action geometry. */
html body #detailModal > .modal-content > .modal-header { padding-inline: 20px; }
@media (min-width: 768px) {
    html body #detailModal > .modal-content > .modal-header { padding-inline: 30px; }
}
html body #authModal .auth-modal { max-width: 560px; }
html body #authModal .auth-form { gap: var(--space-4); margin-top: var(--space-4); }
html body #authModal .auth-form .form-group { gap: var(--space-2); }
html body #authModal .auth-form :is(input:not([type="hidden"]), select) {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
    width: 100%;
    border-radius: var(--radius-control);
}
html body #authModal .auth-actions { gap: var(--gap-inline); margin-top: 0; }
html body #authModal .auth-submit {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-control);
    background: var(--action-primary-bg) !important;
    color: var(--action-primary-fg) !important;
}
html body #authModal #kakaoLoginEntry { justify-items: stretch !important; }
html body #authModal .kakao-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 48px;
    min-height: 48px !important;
    border-radius: var(--radius-control) !important;
    background: #fee500 !important;
}
/* Preserve official Kakao artwork dimensions and all authentication handlers. */
html body .signup-wizard :is(.sw-header, .sw-step, .sw-footer) { padding-inline: var(--dialog-pad); }
html body .signup-wizard .sw-body { padding-inline: 0; }
html body .signup-wizard .sw-header { padding-block: var(--space-2); }
html body .signup-wizard .sw-header-row { min-height: 56px; margin-bottom: var(--space-2); gap: var(--gap-inline); }
html body .signup-wizard .sw-title { font-size: 18px; }
html body .signup-wizard .sw-close {
    flex: none;
    box-sizing: border-box;
    width: var(--icon-btn);
    height: var(--icon-btn);
    min-width: var(--icon-btn);
    min-height: var(--icon-btn);
    padding: 0;
    border-radius: var(--radius-control);
    color: var(--color-text-secondary);
}
html body .signup-wizard .sw-footer { padding-block: var(--space-4); gap: var(--gap-inline); }
html body .signup-wizard .sw-btn { min-height: var(--control-h-md); border-radius: var(--radius-control); }
html body :is(.cal-header, .weather-dialog-header, .dash-more-header) {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-height: 56px;
    gap: var(--gap-inline);
}
html body :is(.cal-title, .weather-dialog-title, .dash-more-title) { font-size: 18px; color: var(--color-text) !important; }
html body :is(.cal-header, .dash-more-header) { padding: var(--space-2) var(--dialog-pad); }
html body .weather-dialog-top { padding: var(--space-2) var(--dialog-pad); }
html body :is(.cal-lunar-btn, .cal-year-select, .cal-today-btn) { min-height: var(--control-h-sm); border-radius: var(--radius-control); }
html body .cal-hol-label {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
html body .cal-cell-bottom { min-width: 0; overflow: hidden; }
html body .dash-more-header-left { gap: var(--gap-inline); }
html body .dash-more-count { font-size: 13px; border-radius: var(--radius-control); }
html body .sw-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

html body .app-bottom-sheet > .modal-header { border-radius: 0 !important; }

/* #542-4: 홈 "카드 설정" sheet rows (moved from home_modules.css; the sheet opens after this file loads). */
.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;
}

/* static/css/layoutref_surfaces.css */
/* LAYOUTREF batch 5: control geometry and spacing; existing dense cards and
   stable loading frames retain their established layouts. */
html body .messenger-info-dialog { border-radius: var(--radius-dialog, 16px); }
html body .messenger-info-head {
    box-sizing: border-box;
    min-height: 56px;
    padding: var(--space-2, 8px) var(--dialog-pad, 24px);
    gap: var(--gap-inline, 8px);
    font-size: 18px;
}
html body .messenger-info-close {
    flex: none;
    box-sizing: border-box;
    width: var(--icon-btn, 40px);
    height: var(--icon-btn, 40px);
    padding: 0;
    border-radius: var(--radius-control, 8px);
}
html body :is(.messenger-info-body, .messenger-info-foot) { padding: var(--space-4,16px) var(--dialog-pad,24px); }
html body .messenger-info-btn { min-height: var(--control-h-md,40px); }
html body .messenger-info-skip { gap: var(--gap-inline,8px); }
html body .co-overlay { border-radius: var(--radius-dialog,16px); }
html body .co-header {
    box-sizing: border-box;
    min-height: 56px;
    padding: 0 var(--dialog-pad,24px);
}
html body .co-overlay.co-minimized { max-height: 56px; }
html body .co-header-actions { gap: var(--gap-inline,8px); }
html body .co-header-btn {
    flex: none;
    width: var(--icon-btn,40px);
    height: var(--icon-btn,40px);
    border-radius: var(--radius-control,8px);
}
html body .co-tab { min-height: var(--control-h-sm,32px); font-size: 13px; }
html body #consultOverlay .consult-input-row {
    flex-direction: row;
    align-items: stretch;
    gap: var(--gap-inline);
}
html body #consultOverlay #consultInput { flex: 1; min-width: 0; }
html body #consultOverlay :is(#consultInput, .consult-send-btn) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
}
html body #consultOverlay .consult-overlay-panel { border-radius: var(--radius-dialog); }
html body #consultOverlay .consult-header {
    box-sizing: border-box;
    min-height: 56px;
    padding: var(--space-2) var(--dialog-pad);
    gap: var(--gap-inline);
}
html body #consultOverlay .consult-title { font-size: 18px; color: var(--color-text); }
html body #consultOverlay .consult-actions { gap: var(--gap-inline); }
html body #consultOverlay .consult-overlay-btn {
    min-height: var(--control-h-sm);
    border-radius: var(--radius-control);
}
html body #consultOverlay .consult-close-btn {
    flex: none;
    box-sizing: border-box;
    width: var(--icon-btn);
    height: var(--icon-btn);
    padding: 0;
    background: transparent;
}
html body #consultOverlay .consult-body { padding: var(--space-4); gap: var(--space-3); }
html body #consultOverlay .consult-send-btn {
    flex: 0 0 auto;
    width: auto;
    min-height: var(--control-h-md);
    border-radius: var(--radius-control);
    background: var(--action-primary-bg);
    color: var(--action-primary-fg);
}
html body #consultOverlay .consult-messages { gap: var(--space-3); border-radius: var(--radius-card); }
html body #consultOverlay .consult-result-card { border-radius: var(--radius-card); }
html body #consultOverlay .consult-result-action { min-height: var(--control-h-sm); border-radius: var(--radius-control); }
html body #consultOverlay .consult-result-card-top { gap: var(--gap-inline); }
html body #consultOverlay .consult-quick-btn { min-height: var(--control-h-sm); border-radius: var(--radius-control); }
html body .notif-inbox-panel { border-radius: var(--radius-dialog); }
html body .notif-inbox-header {
    box-sizing: border-box;
    min-height: 56px;
    padding: var(--space-2) var(--dialog-pad);
    gap: var(--gap-inline);
}
html body .notif-inbox-header h2 { font-size: 18px; }
html body .notif-inbox-header-actions { gap: var(--gap-inline); }
html body .notif-inbox-panel :is(.notif-action-btn, .notif-tab) { border-radius: var(--radius-control); }
html body .notif-meta { font-size: 12px; color: #475569; }
html body .notif-cat-badge { font-size: 12px; }
html[data-theme="dark"] body .notif-meta { color: #cbd5e1; }
html body #notifManageModal .notif-section { margin-bottom: var(--space-4); }
html body #notifManageModal .notif-toggle-label { min-height: var(--hit-min); }
html body #notifManageModal .notif-filter-toggle {
    display: inline-flex;
    align-items: center;
    min-width: max(var(--hit-min), var(--control-h-sm));
    min-height: max(var(--hit-min), var(--control-h-sm));
}
html body #notifManageModal .notif-filter-toggle .slider {
    top: 50%;
    bottom: auto;
    height: 22px;
    transform: translateY(-50%);
}
html body .notif-item.unread {
    border-left: 0;
    box-shadow: inset 3px 0 0 var(--action-primary-bg);
}
html body #qnaModal > div { border-radius: var(--radius-dialog) !important; }
html body #qnaModal > div > div:first-child {
    box-sizing: border-box;
    min-height: 56px;
    padding: var(--space-2) var(--dialog-pad) !important;
    gap: var(--gap-inline);
}
html body #qnaContent { padding-inline: var(--dialog-pad) !important; }
html body #qnaModalTitle { font-size: 18px !important; }
html body .wizard-progress { gap: var(--gap-inline); }
html body .wizard-nav, html body .wizard-nav :is(.nav-left,.nav-right) { gap: var(--gap-inline); }
html body .wizard-nav :is(button, .btn) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
    padding-block: 0;
    border-radius: var(--radius-control);
    margin-left: 0 !important;
}
html body .wizard-nav .btn-primary { background: var(--action-primary-bg); color: var(--action-primary-fg); border-color: var(--action-primary-bg); }
html body .wizard-nav .btn-draft { background: var(--action-secondary-bg); color: var(--action-secondary-fg); border-color: var(--action-secondary-border); }
html body.profile-page :is(.s-btn, .s-input, .s-select, .s-field input:not([type="checkbox"]):not([type="file"]), .s-field select) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
    padding-block: 0;
    border-radius: var(--radius-control);
}
html body.profile-page .filter-item-actions { gap: var(--gap-inline); }
html body.profile-page .filter-item-actions button { min-height: var(--control-h-sm); border-radius: var(--radius-control); }
html body.profile-page .settings-tab { min-height: var(--control-h-md); }
html body.profile-page .settings-tab:not(.active) { color: #64748b; }
html[data-theme="dark"] body.profile-page .settings-tab:not(.active) { color: #cbd5e1; }
html body :is(.co-header-btn,.messenger-info-close):focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (max-width:767px) {
    html body .messenger-info-dialog { border-radius: 16px; }
    html body .co-overlay:not(.co-embedded) {
        bottom: calc(var(--app-dialog-safe-bottom, env(safe-area-inset-bottom,0px)) + 8px);
    }
    html body .co-header-btn { width:44px; height:44px; }
    html body .co-tab { min-height:44px; }
    html body .notif-inbox-panel { border-radius:0; }
    html body .notif-inbox-list {
        padding: 16px max(16px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));
    }
}

/* Existing authenticated room grid and handlers remain; normalize only controls. */
html body .msg-composer-row { gap: var(--gap-inline); }
html body :is(.msg-message-input, .msg-send-btn) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
    padding-block: 0 !important;
    border-radius: var(--radius-control);
}
html body .msg-message-input:focus-visible { box-shadow: var(--focus-ring); }
html body .msg-friend-toolbar-actions { gap: var(--gap-inline); }
html body :is(.msg-btn-accept, .msg-btn-reject) {
    min-height: max(var(--control-h-sm), var(--hit-min));
    border-radius: var(--radius-control);
}
html body .msg-empty { color: #64748b; }
html[data-theme="dark"] body .msg-empty { color: #cbd5e1; }
@media (max-width:767px) {
    html body .msg-message-composer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom,0px)) !important;
    }
}

html body .msg-friend-toolbar-actions .msg-friend-add-btn:last-child {
    background: var(--action-secondary-bg) !important;
    color: var(--action-secondary-fg) !important;
    border: 1px solid var(--action-secondary-border);
}
html body .msg-btn-reject { color: var(--action-secondary-fg) !important; }

/* Flowboard S2: home / review / detail consumers only. Shell publishers remain
   the sole owners of menu, ad, safe-area and the document scroll region. */
html body.unified-page #searchSection.ui-flow,
html body.unified-page #homeModules.ui-flow,
html body.unified-page #resultsSection.ui-flow,
html body #detailModal.ui-flow {
    --flow-local-gap: var(--flow-space-4);
    color: var(--flow-text);
    font-size: var(--flow-font-body);
    line-height: var(--flow-line-body);
}
html body.unified-page #resultsSection.ui-flow,
html body #detailModal.ui-flow { --flow-font-body: 14px; }
@media (max-width: 767px) {
    html body.unified-page #resultsSection.ui-flow,
    html body #detailModal.ui-flow { --flow-font-body: 14.4px; }
}
html body.unified-page #searchSection.ui-flow {
    background: var(--flow-surface);
    border: var(--flow-border-width) solid var(--flow-border);
    border-radius: var(--flow-radius-card);
    padding: var(--flow-space-4);
}
html body.unified-page #searchSection .flowboard-stage-heading {
    margin-block-end: var(--flow-space-4);
    padding-block-end: var(--flow-space-3);
    border-color: var(--flow-border);
}
html body.unified-page #searchSection .ui-flow-step__index {
    font-size: var(--flow-font-section);
    font-weight: var(--flow-weight-heading);
    line-height: var(--flow-line-section);
}
html body.unified-page #searchSection .ui-flow-step__content > p {
    margin-block-start: var(--flow-space-1);
}
html body.unified-page #searchSection #searchKeyword {
    color: var(--flow-text); background: var(--flow-surface);
    border-color: var(--flow-control-border);
    border-radius: var(--flow-radius-control);
    font-size: var(--flow-font-prose);
}
html body.unified-page #searchSection #searchBtn {
    color: var(--flow-on-action); background: var(--flow-action);
    border-color: var(--flow-action); border-radius: var(--flow-radius-control);
}
html body.unified-page #searchSection :is(.secondary-btn, .compact-folder-btn) {
    color: var(--flow-text); background: var(--flow-surface-subtle);
    border-color: var(--flow-control-border); box-shadow: none;
    border-radius: var(--flow-radius-control);
}
html body.unified-page #homeModules.ui-flow {
    background: var(--flow-canvas);
    --home-gap: var(--flow-space-4);
}
html body.unified-page #homeModules.ui-flow :is(.dash-panel, .dash-notices-panel, .dash-stat-panel, .info-card) {
    background: var(--flow-surface); color: var(--flow-text);
    border: var(--flow-border-width) solid var(--flow-border);
    border-radius: var(--flow-radius-card); box-shadow: none;
}
html body.unified-page #homeModules.ui-flow :is(.dash-panel-header, .dash-notices-header, .info-card-header) {
    color: var(--flow-text); background: var(--flow-surface);
    border-color: var(--flow-border);
    padding: var(--flow-space-3) var(--flow-space-4);
}
html body.unified-page #homeModules.ui-flow :is(.dash-panel-title, .info-card-title, .dash-notices-title) {
    color: var(--flow-text); font-size: var(--flow-font-section);
    font-weight: var(--flow-weight-heading); line-height: var(--flow-line-section);
}
html body.unified-page #homeModules.ui-flow :is(.dash-tbl, .dash-tbl th, .dash-tbl td) {
    color: var(--flow-text); background: var(--flow-surface);
    border-color: var(--flow-border); font-size: var(--flow-font-body);
}
html body.unified-page #homeModules.ui-flow .dash-tbl tr {
    min-block-size: var(--flow-row-default);
}
html body.unified-page #homeModules.ui-flow :is(.dash-tbl th, .dash-notices-col-header) {
    background: var(--flow-surface-subtle); color: var(--flow-text);
    font-weight: var(--flow-weight-heading);
}
html body.unified-page #homeModules.ui-flow :is(.col-date, .col-budget, .col-status, .dash-stat-value) {
    font-variant-numeric: tabular-nums;
}
html body.unified-page #homeModules.ui-flow :is(.dash-list-state, .home-week-empty, .info-card-error) {
    color: var(--flow-text-secondary); background: var(--flow-surface);
    border-color: var(--flow-border); border-radius: var(--flow-radius-card);
}
html body.unified-page #resultsSection.ui-flow {
    color: var(--flow-text); background: var(--flow-canvas);
}
html body.unified-page #resultsSection.ui-flow :is(.results-header, .results-info, .result-topic-panel) {
    color: var(--flow-text); background: var(--flow-surface); border-color: var(--flow-border);
}
html body.unified-page #resultsSection.ui-flow .results-header {
    padding: var(--flow-space-4); gap: var(--flow-space-3); box-shadow: none;
}
html body.unified-page #resultsSection.ui-flow #resultsTitle {
    color: var(--flow-text) !important; font-size: var(--flow-font-title) !important;
    font-weight: var(--flow-weight-heading); line-height: var(--flow-line-title);
}
html body.unified-page #resultsSection.ui-flow :is(.results-heading-label, .results-sort-caption, .results-heading small) {
    color: var(--flow-text-secondary); font-size: var(--flow-font-label);
    line-height: var(--flow-line-label);
}
html body.unified-page #resultsSection.ui-flow :is(.result-card, .card-title, .card-info) {
    background: var(--flow-surface); color: var(--flow-text);
    border-color: var(--flow-border); border-radius: var(--flow-radius-card); box-shadow: none;
}
html body.unified-page #resultsSection.ui-flow .result-card .info-row {
    font-size: var(--flow-font-body); line-height: var(--flow-line-list);
}
html body.unified-page #resultsSection.ui-flow .result-card .info-label,
html body.unified-page #resultsSection.ui-flow .result-card .search-match-comment-text {
    font-size: var(--flow-font-label);
}
html body.unified-page #resultsSection.ui-flow :is(.results-sort-button, .results-compact-control > button, .result-topic-tab) {
    background: var(--flow-surface); color: var(--flow-text);
    border-color: var(--flow-control-border); border-radius: var(--flow-radius-control);
}
html body.unified-page #resultsSection.ui-flow .result-topic-tab[aria-selected="true"] {
    background: var(--flow-action); color: var(--flow-on-action); border-color: var(--flow-action);
}
html body.unified-page #resultsSection.ui-flow #noResults {
    color: var(--flow-text); background: var(--flow-surface);
    padding: var(--flow-space-6); border-radius: var(--flow-radius-card);
}
html body #detailModal.ui-flow { background: var(--flow-backdrop); }
html body #detailModal.ui-flow > .modal-content {
    background: var(--flow-surface); color: var(--flow-text);
    border-color: var(--flow-border); border-radius: var(--flow-radius-panel);
    box-shadow: var(--flow-shadow);
}
html body #detailModal.ui-flow .modal-header {
    background: var(--flow-surface); color: var(--flow-text);
    border-color: var(--flow-border); padding: var(--flow-space-4) var(--flow-space-6);
    gap: var(--flow-space-3);
}
html body #detailModal.ui-flow #modalTitle {
    color: var(--flow-text) !important; font-size: var(--flow-font-title) !important;
    font-weight: var(--flow-weight-heading); line-height: var(--flow-line-title);
}
html body #detailModal.ui-flow .flowboard-detail-tools {
    display: flex; align-items: center; gap: var(--flow-space-2); flex: none;
}
html body #detailModal.ui-flow .detail-section {
    background: var(--flow-surface); color: var(--flow-text);
    border: var(--flow-border-width) solid var(--flow-border);
    border-radius: var(--flow-radius-card); padding: var(--flow-space-4);
}
html body #detailModal.ui-flow .detail-section h3 {
    color: var(--flow-text); font-size: var(--flow-font-section);
    font-weight: var(--flow-weight-heading); line-height: var(--flow-line-section);
    border-color: var(--flow-border);
}
html body #detailModal.ui-flow .detail-item {
    color: var(--flow-text); border-color: var(--flow-border);
    gap: var(--flow-space-3); padding-block: var(--flow-space-2);
}
html body #detailModal.ui-flow .detail-item > label { color: var(--flow-text-secondary); font-size: var(--flow-font-body); }
html body #detailModal.ui-flow :is(.detail-summary, .type-badge) {
    background: var(--flow-surface-subtle); color: var(--flow-text);
    border-color: var(--flow-border);
}
html body #detailModal.ui-flow .detail-summary-label { color: var(--flow-text-secondary); }
html body #detailModal.ui-flow :is(.detail-summary strong, .detail-item > span) {
    color: var(--flow-text); font-variant-numeric: tabular-nums;
}
html body #detailModal.ui-flow .detail-item > span { font-size: var(--flow-font-body); }
html body #detailModal.ui-flow #detailDescription {
    color: var(--flow-text); font-size: var(--flow-font-prose); line-height: var(--flow-line-prose);
}
html body #detailModal.ui-flow :is(.close-btn, .bookmark-toggle-btn, .detail-primary-actions .action-btn) {
    background: var(--flow-surface); color: var(--flow-action);
    border-color: var(--flow-control-border); border-radius: var(--flow-radius-control);
}
html body #detailModal.ui-flow .detail-primary-actions .action-btn:hover {
    background: var(--flow-surface-subtle);
}
/* Only newly opted-in consumers: no global buttons, tables or menu overrides. */
html body :is(#searchSection, #homeModules, #resultsSection, #detailModal).ui-flow :is(button, a, input, select):focus-visible {
    outline: var(--flow-focus-width) solid var(--flow-focus);
    outline-offset: var(--flow-focus-width);
}
@media (max-width: 767px) {
    html body.unified-page #searchSection.ui-flow { padding: var(--flow-space-3); }
    html body #detailModal.ui-flow .modal-header { padding: var(--flow-space-3); }
    html body :is(#searchSection, #homeModules, #resultsSection, #detailModal).ui-flow button {
        min-block-size: var(--flow-control-min); min-inline-size: var(--flow-control-min);
    }
}
@media (prefers-reduced-motion: reduce) {
    html body :is(#searchSection, #homeModules, #resultsSection, #detailModal).ui-flow {
        scroll-behavior: auto;
    }
    html body :is(#searchSection, #homeModules, #resultsSection, #detailModal).ui-flow * {
        animation: none; transition: none;
    }
}

/* The bookmark companion keeps its existing row/expansion geometry. */
html body.unified-page #searchBookmarkRow.ui-flow { background: var(--flow-canvas); }
html body.unified-page #searchBookmarkRow.ui-flow #searchBookmarkSide {
    color: var(--flow-text); background: var(--flow-surface);
    border: var(--flow-border-width) solid var(--flow-border);
    border-radius: var(--flow-radius-card); box-shadow: none;
}
html body.unified-page #searchBookmarkRow.ui-flow .search-bookmark-side-header {
    color: var(--flow-text); background: var(--flow-surface);
    border-color: var(--flow-border); font-size: var(--flow-font-section);
    font-weight: var(--flow-weight-heading); line-height: var(--flow-line-section);
}
html body.unified-page #searchBookmarkRow.ui-flow .bm-side-name { color: var(--flow-text) !important; }

html body.unified-page #searchBookmarkRow.ui-flow :is(.bm-side-empty, .bm-side-meta) {
    color: var(--flow-text-secondary) !important;
}

/* S2 real-data follow-up: spend space on values rather than repeated framing. */
html body.unified-page #searchSection.ui-flow { padding: var(--flow-space-2) var(--flow-space-3); }
html body.unified-page #searchSection .flowboard-stage-heading {
    margin-block-end: var(--flow-space-2); padding-block-end: var(--flow-space-1);
    align-items: center;
}
html body.unified-page #searchSection .ui-flow-step__content {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--flow-space-2);
}
html body.unified-page #searchSection .ui-flow-step__content > p { margin: 0; }
html body.unified-page #homeModules.ui-flow { --home-gap: var(--flow-space-2); }
html body.unified-page #homeModules.ui-flow :is(.dash-panel-header, .dash-notices-header, .info-card-header) {
    padding: var(--flow-space-1) var(--flow-space-3);
}
html body.unified-page #resultsSection.ui-flow .results-header {
    padding: var(--flow-space-1) var(--flow-space-3); gap: var(--flow-space-1);
}
html body #detailModal.ui-flow .modal-header { padding: var(--flow-space-2) var(--flow-space-3); }
html body #detailModal.ui-flow .modal-title-area {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--flow-space-1) var(--flow-space-2);
}
html body #detailModal.ui-flow #modalTitle { font-size: var(--flow-font-title) !important; line-height: var(--flow-line-title); }
html body #detailModal.ui-flow .modal-body { padding: var(--flow-space-3); }
html body #detailModal.ui-flow .detail-summary {
    padding: var(--flow-space-1) var(--flow-space-2); gap: var(--flow-space-1) var(--flow-space-2);
    margin-bottom: var(--flow-space-2);
}
html body #detailModal.ui-flow .detail-summary > div { height: auto; min-height: 36px; }
html body #detailModal.ui-flow .detail-summary-label { height: auto; line-height: 16px; }
html body #detailModal.ui-flow .detail-summary strong {
    line-height: 20px; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word;
}
html body #detailModal.ui-flow .detail-primary-actions { grid-auto-rows: 52px; margin-bottom: var(--flow-space-2); }
html body #detailModal.ui-flow .detail-primary-actions > .action-btn { height: 52px; }
html body #detailModal.ui-flow .detail-section { padding: var(--flow-space-2); }
html body #detailModal.ui-flow .detail-section h3 { margin-block: 0 var(--flow-space-2); padding-bottom: var(--flow-space-1); }
html body #detailModal.ui-flow .detail-grid { gap: var(--flow-space-3); }
html body #detailModal.ui-flow .detail-item {
    gap: var(--flow-space-2); padding: var(--flow-space-1) var(--flow-space-2);
}
html body #detailModal.ui-flow .detail-item :is(span, .detail-org-wrap) {
    word-break: keep-all; overflow-wrap: normal; padding-left: 0;
}
html body #detailModal.ui-flow .detail-item > label { background: transparent; }
html body #detailModal.ui-flow #detailContactEmail { overflow-wrap: break-word; }
@media (min-width: 768px) {
    html body #detailModal.ui-flow .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html body #detailModal.ui-flow .detail-item > label {
        width: 88px; min-width: 88px; max-width: 88px; padding-right: var(--flow-space-2);
    }
}
@media (max-width: 767px) {
    html body.unified-page #searchSection.ui-flow { padding: var(--flow-space-2); }
    html body #detailModal.ui-flow .modal-title-area { flex: 1; }
    html body #detailModal.ui-flow .modal-title-area .flowboard-stage-label { flex-basis: auto; }
    html body #detailModal.ui-flow .detail-item {
        display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start;
    }
    html body #detailModal.ui-flow .detail-item > label { margin: 0; }
}

/* Resolve legacy accent/muted colors at the opted-in surfaces' token boundary. */
html body.unified-page :is(#homeModules, #searchBookmarkRow, #resultsSection).ui-flow {
    --color-primary: var(--flow-action);
    --color-text-muted: var(--flow-text-secondary);
}
html body.unified-page :is(#homeModules, #searchBookmarkRow).ui-flow :is(.dash-col-count, .bm-side-viewall, .dash-hbar-more, .dash-stat-tab.active, .dash-panel-action, .dash-tbl-more) {
    color: var(--flow-action);
}
html body.unified-page #homeModules.ui-flow .dash-mcal-day.today {
    background: var(--flow-action); color: var(--flow-on-action);
}
html body.unified-page #searchBookmarkRow.ui-flow .bm-side-deadline { color: var(--flow-text-secondary); }
html body.unified-page #searchBookmarkRow.ui-flow .bm-side-status-open { color: var(--flow-success); }
html body.unified-page #homeModules.ui-flow :is(.home-week-item-type, .date-agenda-label, .date-agenda-count, .weather-permission-hint) {
    color: var(--flow-text-secondary); background: var(--flow-surface-subtle);
}
html body.unified-page #homeModules.ui-flow .info-badge,
html body.unified-page #resultsSection.ui-flow .type-badge {
    background: var(--flow-action); color: var(--flow-on-action);
}
html body.unified-page #resultsSection.ui-flow .status { color: var(--flow-text-secondary); background: var(--flow-surface-subtle); }
html body.unified-page #resultsSection.ui-flow .search-type-progress__label { color: var(--flow-text); }
html body #detailModal.ui-flow .eligibility-banner :is(.elig-title, .elig-detail, summary) { color: var(--flow-text); }
html body #detailModal.ui-flow :is(.comment-char-count, #commentCharCount) { color: var(--flow-text-secondary); }
html body.unified-page .service-footer { --color-text-muted: #526279; }
html body.unified-page .service-footer :is(.service-footer-note, .service-footer-contact, .service-footer-details) { color: #526279; }
html[data-theme="dark"] body.unified-page .service-footer :is(.service-footer-note, .service-footer-contact, .service-footer-details) { color: #becbda; }
html body.unified-page #homeModules.ui-flow #bidWorkCard .info-badge {
    background: var(--flow-action) !important; color: var(--flow-on-action) !important;
}
@media (max-width: 767px) {
    html body.unified-page #searchSection .flowboard-stage-heading {
        padding-block-end: 0; margin-block-end: 0; border-bottom-width: 1px;
    }
    html body.unified-page #searchSection :is(.ui-flow-section-title, .ui-flow-step__index) { line-height: 20px; }
    html body.unified-page #homeModules.ui-flow { --home-gap: var(--flow-space-2); gap: var(--flow-space-2) !important; }
    html body.unified-page #homeModules.ui-flow .info-card-header { padding: 0; }
    html body.unified-page.app-shared-shell #homeModules.ui-flow .service-footer { padding-block: var(--flow-space-1) !important; }
}
html body.unified-page #homeModules.ui-flow .time-pill.urgent { color: #991b1b; }
html[data-theme="dark"] body.unified-page #homeModules.ui-flow .time-pill.urgent { color: #fecaca; }
@media (min-width: 768px) {
    html body.unified-page #homeModules.ui-flow .dash-tbl tbody td { padding-block: 3px; }
    html:not([data-device-class="phone"]) body.unified-page:not(.results-dialog-active) #searchSection.ui-flow .search-panel {
        padding: var(--flow-space-2) var(--flow-space-4) !important; gap: var(--flow-space-2) !important;
    }
}

/* #450-81: one notice overview, with saved work above imminent deadlines. */
html body.unified-page #homeModules.ui-flow .home-notices-priority {
    grid-column: 1; grid-row: 1; order: -1; display: grid;
    grid-template-rows: repeat(2, minmax(min-content, 1fr)); min-width: 0;
}
html body.unified-page #homeModules.ui-flow .home-notices-priority > .dash-notices-col {
    border-right: 1px solid var(--flow-border); border-bottom: 1px solid var(--flow-border);
}
html body.unified-page #homeModules.ui-flow .dash-notices-grid > .dash-notices-col:has(#dashNewList) { grid-column: 2; grid-row: 1; }
html body.unified-page #homeModules.ui-flow .dash-notices-grid > .dash-notices-col:has(#dashPrivateBidList) { grid-column: 1; grid-row: 2; }
html body.unified-page #homeModules.ui-flow .dash-notices-grid > .dash-notices-col:has(#dashAwardedList) { grid-column: 2; grid-row: 2; }
html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #dashboardSection #searchBookmarkSide {
    position: static !important; inset: auto !important; height: auto !important;
    width: auto !important; grid-column: auto !important; grid-row: auto !important;
    display: flex !important; min-width: 0;
}
html body.unified-page #homeModules.ui-flow #searchBookmarkSide > .dash-notices-col-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px;
}
html body.unified-page #homeModules.ui-flow :is(#sideBookmarkList, #dashClosingList) {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    display: block !important; flex: 1 0 auto !important; overflow: visible !important; padding-bottom: 0;
}
html body.unified-page #homeModules.ui-flow :is(.home-bookmarks-all, .home-bookmark-open) {
    font: inherit; color: var(--flow-action); background: transparent; border: 0; cursor: pointer;
}
html body.unified-page #homeModules.ui-flow .home-bookmarks-all { min-height: 32px; padding: 0 4px; font-size: 12px; }
html body.unified-page #homeModules.ui-flow .home-bookmark-open {
    display: block; width: 100%; min-height: 32px; text-align: left; padding: 0;
    white-space: normal; overflow: visible; word-break: keep-all; overflow-wrap: break-word;
}
html body.unified-page #homeModules.ui-flow .home-bookmarks-table { width: 100%; table-layout: fixed; }
html body.unified-page #homeModules.ui-flow .home-bookmarks-table :is(th, td) {
    white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; overflow-wrap: break-word;
}
html body.unified-page #homeModules.ui-flow .home-bookmarks-table .dash-closing-org { font-size: 11px; color: var(--flow-text-secondary); }
html body.unified-page #homeModules.ui-flow .home-bookmarks-table .time-pill { white-space: normal; color: var(--flow-text); background: var(--flow-surface-subtle); }
html body.unified-page #homeModules.ui-flow .bm-side-empty { padding: 8px 12px; color: var(--flow-text-secondary); font-size: 13px; }
@media (min-width: 768px) {
    html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #homeModules.ui-flow :is(#dashCalendarPanel, .dash-weather-panel) {
        height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible; padding-bottom: 8px;
    }
}
html body #detailModal.ui-flow .detail-notice-slot { min-height: 0; margin-bottom: 0; }
html body #detailModal.ui-flow .detail-notice-slot:has(> div:not([style*="display: none"]):not([style*="display:none"])) { margin-bottom: 8px; }
html body #detailModal.ui-flow .detail-notice summary { white-space: normal; overflow: visible; text-overflow: clip; }
html body #detailModal.ui-flow .detail-section .detail-item {
    border: 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--flow-border);
}
html body #detailModal.ui-flow .detail-section .detail-item:last-child { border-bottom: 0; }
@media (max-width: 767px) {
    html body.unified-page #homeModules.ui-flow .dash-notices-panel { display: block !important; order: 6; margin: 0; }
    html body.unified-page #homeModules.ui-flow .dash-notices-grid { display: flex; flex-direction: column; }
    html body.unified-page #homeModules.ui-flow .home-notices-priority { display: grid; grid-template-rows: auto auto; }
    html body.unified-page #homeModules.ui-flow :is(#dashNewList, #dashPrivateBidList, #dashAwardedList) {
        height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important;
    }
    html body #detailModal.ui-flow .modal-header { align-items: flex-start; gap: 8px; }
    html body #detailModal.ui-flow .modal-title-area {
        display: grid; grid-template-columns: max-content 1fr; gap: 4px 8px; align-items: center;
    }
    html body #detailModal.ui-flow #modalTypeLabel { grid-column: 1; grid-row: 1; justify-self: start; margin: 0; }
    html body #detailModal.ui-flow .flowboard-stage-label { grid-column: 2; grid-row: 1; justify-self: start; margin: 0; line-height: 20px; }
    html body #detailModal.ui-flow #modalTitle { grid-column: 1 / -1; font-size: var(--flow-font-title) !important; line-height: var(--flow-line-title); margin: 0; }
    html body #detailModal.ui-flow .flowboard-detail-tools { align-items: center; }
    html body #detailModal.ui-flow .detail-primary-actions {
        grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 4px;
    }
    html body #detailModal.ui-flow .detail-primary-actions > .action-btn {
        display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
        gap: 8px; min-height: 44px; height: auto; padding: 4px 8px; text-align: left; white-space: normal;
    }
    html body #detailModal.ui-flow .collab-btn-desc { margin: 0; }
    html body #detailModal.ui-flow .detail-notice summary { padding-block: 8px; min-height: 44px; }
    html body #detailModal.ui-flow .eligibility-banner { text-align: left; }
}

@media (max-width: 767px) {
    /* These two lists remain desktop-only, as before the overview move. */
    html body.unified-page #homeModules.ui-flow .dash-notices-grid > .dash-notices-col:not(:has(#dashNewList)) { display: none; }
    html body #detailModal.ui-flow .detail-section { border: 0; border-radius: 0; padding: 0; background: transparent; }
    html body #detailModal.ui-flow .detail-section h3 { padding: 8px; margin-bottom: 0; }
    html body #detailModal.ui-flow .detail-notice-slot > div { padding-inline: 8px !important; }
}
@media (min-width: 768px) {
    html body.unified-page #homeModules.ui-flow #dashCalendarPanel > .dash-panel-header { min-height: 40px; margin-bottom: 4px; }
    html body.unified-page #homeModules.ui-flow #dashCalendarPanel .dash-mcal-day { padding-block: 3px; }
    html body.unified-page #homeModules.ui-flow #dashCalendarPanel .home-week-item { min-height: 32px; padding-block: 2px; }
    html body.unified-page #homeModules.ui-flow #dashCalendarPanel > #homeWeekList:is([data-home-card-state="ready"], [data-home-card-state="empty"]) { padding-bottom: 0; }
}
/* The old search companion used flex-basis:0. In the overview its intrinsic
   table height must participate in the two-row budget instead of overflowing. */
html body.unified-page.app-shared-shell:not(.results-dialog-active) #appContentRegion #homeModules #dashboardSection #sideBookmarkList {
    flex: 0 0 auto !important;
}

@media (min-width: 768px) {
    html body.unified-page:not(.results-dialog-active) #homeModules.ui-flow #dashboardSection .dash-col-calendar {
        margin-top: calc(-1 * var(--home-sidebar-offset, 0px));
    }
}
@media (min-width: 768px) {
    html body.unified-page:not(.results-dialog-active) #homeModules.ui-flow #dashboardSection .dash-col-calendar {
        position: relative; z-index: 1;
    }
}
@media (min-width: 768px) {
    html body.unified-page #homeModules.ui-flow #dashboardSection .dash-weather-panel > .dash-panel-header { min-height: 40px; }
    html body.unified-page #homeModules.ui-flow #dashboardSection .dash-weather-icon { font-size: 28px; line-height: 1.2; }
    html body.unified-page #homeModules.ui-flow #dashboardSection .dash-weather-temp { line-height: 1.2; }
}

/* #450-82: one heading/action row, one shared preview table geometry. */
html body.unified-page #appContentRegion #homeModules #dashboardSection .dash-notices-col-header {
    display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between;
    gap: 0 6px; padding: 4px 8px; min-height: 28px;
    font-size: 12px; line-height: 20px;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .dash-col-count { margin-right: auto; }
html body.unified-page #appContentRegion #homeModules #dashboardSection :is(.home-list-more, .home-bookmarks-all) {
    margin-left: auto; padding: 0; font-size: 11px; line-height: 20px;
    min-height: 20px; white-space: normal; color: var(--flow-action);
}
html body.unified-page #appContentRegion #homeModules #dashboardSection :is(#dashNewList, #dashPrivateBidList, #dashAwardedList) {
    padding-bottom: 0; min-height: 0; max-height: none; height: auto; overflow: visible;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table {
    table-layout: fixed; width: 100%; border-collapse: collapse;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table tr {
    height: auto; min-height: 0; min-block-size: 0;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table td {
    padding: 3px 6px; font-size: 12px; line-height: 16px;
    vertical-align: top; white-space: normal; overflow: visible; text-overflow: clip;
    word-break: keep-all; overflow-wrap: break-word;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table :is(.col-budget, .col-time) {
    text-align: right; font-variant-numeric: tabular-nums;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table :is(.dash-row-detail-action, .home-bookmark-open) {
    display: block; margin: 0; padding: 0; min-height: 0; height: auto; width: 100%;
    text-align: left; font-size: 12px; font-weight: 500; line-height: 16px;
    color: var(--flow-text); background: transparent; border: 0;
    white-space: normal; overflow: visible; text-overflow: clip;
    word-break: keep-all; overflow-wrap: break-word;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-meta {
    margin-top: 1px; font-size: 10px; line-height: 13px;
    color: var(--flow-text-secondary); white-space: normal;
    word-break: keep-all; overflow-wrap: break-word;
}
html body #detailModal.ui-flow .detail-item-org .detail-org-wrap {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
}
html body #detailModal.ui-flow .detail-item-org #detailOrganization {
    width: auto; flex: 1 1 auto;
}
html body #detailModal.ui-flow #orgHistoryBtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    margin: 0; min-height: 44px; align-self: center;
}
@media (max-width: 767px) {
    html body.unified-page #appContentRegion #homeModules .dash-notices-header { padding: 2px 8px; }
    html body.unified-page #appContentRegion #homeModules #dashboardSection .dash-notices-col-header {
        padding-block: 2px; min-height: 24px;
    }
    html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table td { padding-block: 2px; }
}

html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table .col-name {
    padding-bottom: 0; border-bottom: 0;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table .col-org {
    width: auto; font-size: 10px; line-height: 13px;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table .home-notice-meta { margin-top: 0; }
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table .home-notice-row > tr:last-child td {
    padding-top: 0; vertical-align: middle;
}

html body.unified-page #appContentRegion #homeModules #homeNoticesPriority { grid-template-rows: auto minmax(min-content, 1fr); }

html body.unified-page #appContentRegion #homeModules #dashboardSection .home-other-notice-table td {
    padding: 3px 6px; font-size: 12px; line-height: 16px;
    white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all;
}
html body.unified-page #appContentRegion #homeModules #dashboardSection .home-other-notice-table .dash-row-detail-action {
    min-height: 0; padding: 0; font-size: 12px; line-height: 16px;
    white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all;
}

/* This is a text action, not a blue placeholder when the row meets the fold. */
html body #detailModal.ui-flow #orgHistoryBtn {
    background: transparent !important; border: 0 !important; padding-inline: 0;
    color: var(--flow-action);
}

@media (min-width: 768px) {
    html body.unified-page #appContentRegion #homeModules #dashboardSection .home-notice-table td[rowspan] {
        vertical-align: middle; padding-block: 1px;
    }
}

/* #450-100: original analysis window and post-opening wizard, no duplicate UI. */
html body #bidAnalysisDialog {
    backdrop-filter:none; -webkit-backdrop-filter:none;
}
html body #bidAnalysisDialog .bid-analysis-modal {
    width:min(880px,100%); min-width:0; max-width:100%; background:var(--analysis-surface);
    color:var(--analysis-text); border:1px solid var(--analysis-border); border-radius:8px;
}
html body #bidAnalysisDialog .modal-header {
    gap:8px; padding:8px 12px; background:var(--analysis-surface); border-color:var(--analysis-border);
}
html body #bidAnalysisDialog .modal-header h2 {
    flex:1; min-width:0; flex-wrap:wrap; font-size:16px; line-height:1.5; color:var(--analysis-text);
}
html body #bidAnalysisDialog .modal-body { min-width:0; padding:12px; }
html body #bidAnalysisDialog .section-guide {
    margin:0 0 12px; padding:10px 12px; color:var(--analysis-muted); background:var(--analysis-subtle);
    border-color:var(--action-tertiary-fg); border-radius:4px; overflow-wrap:anywhere;
}
html body #bidAnalysisDialog .analysis-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
html body #bidAnalysisDialog :is(.analysis-card,.analysis-section) {
    min-width:0; border:1px solid var(--analysis-border); border-radius:8px;
    background:var(--analysis-surface); color:var(--analysis-text); box-shadow:none;
}
html body #bidAnalysisDialog .analysis-card { padding:12px; }
html body #bidAnalysisDialog .analysis-card.highlight { background:var(--analysis-subtle); border-color:var(--action-tertiary-fg); }
html body #bidAnalysisDialog :is(.card-label,.card-sub,.card-hint,.analysis-empty) { color:var(--analysis-muted); }
html body #bidAnalysisDialog .card-value { color:var(--analysis-text); font-size:22px; overflow-wrap:anywhere; }
html body #bidAnalysisDialog .analysis-section > h4 {
    display:flex; align-items:center; min-height:var(--section-header-height); font-size:14px;
    line-height:20px; margin:0 0 8px; color:var(--analysis-text);
}
html body #bidAnalysisDialog :is(table,canvas,svg) { max-width:100%; }
html body #bidAnalysisDialog :is(th,td) { overflow-wrap:anywhere; }
@media(max-width:767px) {
    html body #bidAnalysisDialog { padding:8px; }
    html body #bidAnalysisDialog .analysis-cards { grid-template-columns:minmax(0,1fr); }
}
html body #bidWizardOverlay:is([data-analysis-view="competition"],[data-analysis-view="opening"]) {
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-box {
    border-radius:8px; border:1px solid var(--analysis-border); background:var(--analysis-surface); color:var(--analysis-text);
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.bwiz-header,.bwiz-progress,.bwiz-actions) {
    padding:8px 12px; gap:8px; background:var(--analysis-surface); color:var(--analysis-text); border-color:var(--analysis-border);
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-header { border-bottom:1px solid var(--analysis-border); }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.bwiz-close,.bwiz-step-title) { color:var(--analysis-text); }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-content { padding:12px; }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-step-title {
    display:inline-flex; align-items:center; min-height:var(--section-header-height); font-size:14px; line-height:20px;
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.wiz-insight,.wiz-data,.wiz-range-box,.wiz-empty) {
    background:var(--analysis-subtle) !important; color:var(--analysis-text) !important;
    border-color:var(--analysis-border) !important; border-radius:8px; padding:10px 12px; overflow-wrap:anywhere;
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.wiz-data-label,.wiz-range-title,.wiz-range-sub) { color:var(--analysis-muted); }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.wiz-data-val,.wiz-highlight,.wiz-range-vals,.wiz-summary-title) { color:var(--analysis-text); }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .wiz-table { table-layout:fixed; width:100%; }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .wiz-table :is(th,td) {
    white-space:normal; overflow-wrap:anywhere; background:var(--analysis-surface); color:var(--analysis-text); border-color:var(--analysis-border);
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-step-body { color:var(--analysis-text); }
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-dot {
    min-height:var(--section-header-height); background:var(--analysis-subtle); color:var(--analysis-muted);
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) .bwiz-dot.active {
    background:var(--action-primary-bg); color:var(--action-primary-fg); transform:none;
}
html body #bidWizardOverlay[data-analysis-view="competition"] :is(.wiz-competition-context-card,.wiz-competition-winner-card) {
    background:var(--analysis-surface) !important; border-color:var(--analysis-border) !important;
    color:var(--analysis-text); border-radius:8px !important;
}
html body #bidWizardOverlay[data-analysis-view="competition"] :is(.wiz-competition-context-card,.wiz-competition-winner-card) [style*="color"],
html body #bidWizardOverlay[data-analysis-view="competition"] #wizBidPredictionContent > :is(div,section) [style*="color"] {
    color:var(--analysis-text) !important;
}
html body #bidWizardOverlay[data-analysis-view="competition"] #wizBidPredictionContent > :is(div,section)[style*="background"] {
    background:var(--analysis-subtle) !important; border-color:var(--analysis-border) !important; color:var(--analysis-text) !important;
}
html body #bidWizardOverlay[data-analysis-view="competition"] .wiz-bid-prediction-shell {
    block-size:auto !important; min-block-size:0; max-block-size:none; overflow:visible;
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]),
html body #bidAnalysisDialog {
    --analysis-surface:#ffffff; --analysis-subtle:#f6f7f9; --analysis-border:#e3e6eb;
    --analysis-text:#12151a; --analysis-muted:#4b5361;
}
html[data-theme="dark"] body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]),
html[data-theme="dark"] body #bidAnalysisDialog {
    --analysis-surface:#14171b; --analysis-subtle:#0c0e11; --analysis-border:#353b44;
    --analysis-text:#eceef2; --analysis-muted:#a7aeba;
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.bwiz-box,.bwiz-header,.bwiz-progress,.bwiz-content,.bwiz-actions) {
    background:var(--analysis-surface) !important; color:var(--analysis-text) !important; border-color:var(--analysis-border) !important;
}
html body #bidWizardOverlay[data-analysis-view]:not([data-analysis-view=""]) :is(.bwiz-title-text,.bwiz-close,.bwiz-step-title,.bwiz-page) { color:var(--analysis-text) !important; }

/* #450-101: reuse the five-step process and its single content scroll owner. */
html body #bidWizardOverlay[data-process-view="true"] { --process-surface:#fff; --process-subtle:#f6f7f9; --process-text:#12151a; --process-muted:#4b5361; --process-border:#e3e6eb; }
html[data-theme="dark"] body #bidWizardOverlay[data-process-view="true"] { --process-surface:#14171b; --process-subtle:#0c0e11; --process-text:#eceef2; --process-muted:#a7aeba; --process-border:#353b44; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-box { display:flex; flex-direction:column; width:min(960px,calc(100vw - 24px)); max-height:calc(100dvh - var(--app-dialog-safe-bottom,0px) - 24px); overflow:hidden; background:var(--process-surface) !important; color:var(--process-text) !important; border:1px solid var(--process-border); border-radius:12px; }
html body #bidWizardOverlay[data-process-view="true"] :is(.bwiz-header,.bwiz-progress,.bwiz-actions) { flex:0 0 auto; padding:8px 12px; gap:8px; background:var(--process-surface) !important; color:var(--process-text) !important; border-color:var(--process-border) !important; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-progress { display:flex; justify-content:center; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-content { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:12px; background:var(--process-surface) !important; color:var(--process-text) !important; }
html body #bidWizardOverlay[data-process-view="true"] :is(.bwiz-step-title,.bwiz-title-text,.bwiz-close,.bwiz-page) { color:var(--process-text) !important; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-step-title { display:inline-flex; align-items:center; min-height:var(--section-header-height,28px); font-size:15px; line-height:22px; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-dot { width:28px; height:28px; min-height:28px; background:var(--process-subtle); color:var(--process-muted); transform:none; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-dot.active { background:#4a90d9; color:#fff; box-shadow:0 0 0 3px var(--process-subtle); }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-dot.done { background:#dceafb; color:#1d4d80; }
html body #bidWizardOverlay[data-process-view="true"] :is(.wiz-data,.wiz-insight,.wiz-check-item,.wiz-evidence-row,.wiz-range-box,.wiz-price-selected-note,.wiz-empty) { background:var(--process-subtle) !important; color:var(--process-text) !important; border-color:var(--process-border) !important; border-radius:8px; padding:10px 12px; overflow-wrap:anywhere; }
html body #bidWizardOverlay[data-process-view="true"] :is(.wiz-data-label,.wiz-range-title,.wiz-range-sub,.wiz-price-rate) { color:var(--process-muted) !important; }
html body #bidWizardOverlay[data-process-view="true"] :is(.wiz-data-val,.wiz-highlight,.wiz-range-vals,.wiz-price-amount) { color:var(--process-text) !important; }
html body #bidWizardOverlay[data-process-view="true"] .wiz-price-cell { min-width:0; background:var(--process-surface) !important; color:var(--process-text) !important; border-color:var(--process-border) !important; }
html body #bidWizardOverlay[data-process-view="true"] :is(.wiz-price-selected,.wiz-price-selected-note.active) { outline:2px solid #4a90d9; outline-offset:-2px; }
html body #bidWizardOverlay[data-process-view="true"] .wiz-price-selected-note.active { font-size:15px; line-height:1.6; font-weight:650; }
html body #bidWizardOverlay[data-process-view="true"] .wiz-table { width:100%; table-layout:fixed; }
html body #bidWizardOverlay[data-process-view="true"] .wiz-table :is(th,td) { white-space:normal; overflow-wrap:anywhere; background:var(--process-surface) !important; color:var(--process-text) !important; border-color:var(--process-border) !important; }
html body #bidWizardOverlay[data-process-view="true"] .bwiz-btn { min-height:36px; }
@media(max-width:767px) { html body #bidWizardOverlay[data-process-view="true"] .bwiz-box { width:calc(100vw - 16px); max-height:calc(100dvh - var(--app-dialog-safe-bottom,0px) - 16px); } }
/* A selection acknowledgement stays above the wizard's persistent controls. */
body:has(#bidWizardOverlay[data-process-view="true"]) #appToast { width:min(480px,calc(100vw - 32px)); box-sizing:border-box; bottom:var(--wizard-toast-bottom,calc(var(--app-dialog-safe-bottom,0px) + 150px)) !important; }

/* #450-103/5399: one mobile section spacing contract. Control/row spacing is independent. */
@media (max-width:767px) {
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] {
        --home-gap:var(--mobile-section-gap); --home-gutter:var(--mobile-section-padding);
        gap:var(--mobile-section-gap) !important; padding:0 var(--mobile-section-padding) !important;
        display:flex !important; flex-direction:column;
        height:var(--home-fitted-height,auto) !important;
        align-content:start !important;
    }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] #bidWorkCard { align-self:stretch !important; flex:1 0 auto !important; }
    html body.home-adopted.unified-page.app-shared-shell #appViewportRegion #appContentRegion #searchSection { padding-inline:var(--mobile-section-padding) !important; }
    html body.home-adopted.unified-page.app-shared-shell #appContentRegion #homeModules[data-home-layout="adopted"] > #mobileHomeSummaryRegion { margin:0 !important; }
    html body #detailModal.ui-flow .detail-grid,
    html body #bidAnalysisDialog .analysis-cards { gap:var(--mobile-section-gap); }
    html body #detailModal.ui-flow .detail-section { margin-block:0; }
    html body #detailModal.ui-flow .modal-body,
    html body #bidWizardOverlay[data-process-view="true"] .bwiz-content { padding:var(--mobile-section-padding) !important; }
    html body #bidWizardOverlay[data-process-view="true"] .bwiz-step-body { display:flex; flex-direction:column; gap:var(--mobile-section-gap); }
    html body #bidWizardOverlay[data-process-view="true"] .bwiz-step-body > * { margin-block:0 !important; }
    html body #bidWizardOverlay[data-process-view="true"] :is(.bwiz-header,.bwiz-progress,.bwiz-actions) { gap:var(--mobile-section-gap); padding-inline:var(--mobile-section-padding); }
    html body #resultsSection.ui-flow :is(.results-grid,.search-type-progress) { gap:var(--mobile-section-gap) !important; padding:var(--mobile-section-padding) !important; }
    html body #msgChatView.msg-room-layout { gap:var(--mobile-section-gap) !important; }
    html body #msgChatView :is(.msg-room-header,.msg-room-context-body,#msgRoomContext) { padding-inline:var(--mobile-section-padding) !important; gap:var(--mobile-section-gap); }
}

/* static/css/layoutref_action_order.css */
/* PM #8: visual order follows DOM order; phone three-action groups stack. */
html body.profile-page #profilePushActions { justify-content:flex-end; align-items:center; gap:var(--gap-inline,8px); }
html body.profile-page #profilePushActions .s-btn-danger { margin-right:auto; }
html[data-device-class="phone"] body.profile-page #profilePushActions { flex-direction:column; align-items:stretch; }
html[data-device-class="phone"] body.profile-page #profilePushActions .s-btn-danger { margin-right:0; }
html body .consult-quick-actions:has(.yes):has(.no) { justify-content:flex-end; gap:var(--gap-inline,8px); }
html body #consultOverlay .consult-quick-actions :is(.yes,.no) {
    min-height:max(var(--control-h-sm,32px),var(--hit-min,32px));
    border-radius:var(--radius-control,8px);
    border-width:1px;
}

/* static/css/layoutref_phone_home.css */
/* PM decision #9: V4 composition and labels stay; only spacing, tab height
   and word wrapping change on phones. Tablets retain desktop rules (B0). */
@media (max-width: 767px) {
    html[data-device-class="phone"] body.unified-page:not(.results-dialog-active):not(.mobile-shell-embed) #searchSection {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100% !important;
    }
    html[data-device-class="phone"] body.unified-page:not(.results-dialog-active) #closedBetaNotice {
        padding: 16px !important;
        margin-bottom: 12px !important;
        gap: 8px !important;
    }
    html[data-device-class="phone"] body.unified-page #closedBetaNotice :is(h2,span) {
        word-break: keep-all;
        overflow-wrap: break-word;
    }
    html[data-device-class="phone"] body.unified-page #homeModules :is(#newsCard,#stockCard,#bidWorkCard) .info-tab-btn {
        box-sizing: border-box;
        height: 32px !important;
        min-height: 32px !important;
    }
}

/* static/css/layoutref_detail_labels.css */
/* Shared detail labels and source link below attachment guidance (#450). */
#detailModal .detail-line-icon { display:inline-block; vertical-align:-2px; flex-shrink:0; }
#detailModal :is(#privateBidChatBtn,.collab-not-joined,.collab-list) {
    background:var(--color-surface); color:var(--color-text); border:1px solid var(--color-border);
}
#detailModal :is(#privateBidChatBtn,.collab-not-joined,.collab-list):hover {
    background:var(--color-bg); box-shadow:none; transform:none;
}

#detailModal .detail-primary-actions > .action-btn:has(> .detail-line-icon) { column-gap:var(--space-2,8px); }
#detailModal .collab-btn-title > .detail-line-icon { margin-inline-end:var(--space-1,4px); }

#detailModal .detail-source-actions { display:flex; flex-wrap:wrap; gap:var(--space-2,8px); margin-top:var(--space-3,12px); }
#detailModal .detail-source-actions[hidden] { display:none; }
#detailModal .detail-source-actions .action-btn {
    display:inline-flex; align-items:center; justify-content:center; column-gap:var(--space-2,8px);
    min-height:44px; min-width:44px; max-width:100%; box-sizing:border-box;
    padding:var(--space-2,8px) var(--space-4,16px); white-space:normal; text-align:center;
}
#detailModal .detail-source-only > :is(h3,.attachments-list,.attachments-notice) { display:none; }
#detailModal .detail-source-only .detail-source-actions { margin-top:0; }

/* static/css/layoutref_search_actions.css */
/* Approved PM decision #11: keyboard cards, named license close, phone actions. */
html body .result-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
html body .license-dlg-header {
    display: flex;
    align-items: center;
    min-height: 56px;
    box-sizing: border-box;
    padding: var(--space-2) var(--dialog-pad);
    gap: var(--gap-inline);
}
html body .license-dlg-header h3 { flex: 1; min-width: 0; margin: 0; font-size: 18px; }
html body .license-dlg-close-btn {
    flex: none;
    width: var(--icon-btn);
    height: var(--icon-btn);
    padding: 0;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 20px;
    cursor: pointer;
}
html body .license-dlg-close-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
html body .sfd-footer :is(.sfd-reset-btn,.sfd-save-btn,.sfd-apply-btn) {
    box-sizing: border-box;
    height: var(--control-h-md);
    min-height: var(--control-h-md);
    border-radius: var(--radius-control);
}
html body .sfd-footer-right[hidden] { display: none; }
    html[data-device-class="phone"] body .sfd-footer {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--gap-inline);
        width: 100%;
    }
    html[data-device-class="phone"] body .sfd-footer { box-sizing: border-box; }
    html[data-device-class="phone"] body .sfd-footer :is(.sfd-reset-btn,.sfd-save-btn,.sfd-apply-btn) {
        width: 100%;
        height: var(--control-h-lg);
        min-height: var(--control-h-lg);
    }

