/* BM共通の表示基準。全HTMLの最後に読み込み、従来画面とReact画面を揃える。 */
@media screen {
  html.bm-ui {
    --ui-canvas: #f7f8fa;
    --ui-surface: #ffffff;
    --ui-soft: #f1f3f5;
    --ui-ink: #24282f;
    --ui-muted: #5b6470;
    --ui-line: #e1e5e9;
    --ui-input-line: #a3adb9;
    --ui-accent: #176f64;
    --ui-accent-hover: #11594f;
    --ui-accent-soft: #eaf4f0;
    --ui-accent-ink: var(--ui-accent);
    --ui-nav: #242b34;
    --ui-rail: #f1f3f5;
    --ui-radius: 12px;
    --ui-shadow: 0 1px 3px rgb(24 32 44 / 3%);
    --bm-font-sans: 'Noto Sans JP', 'Yu Gothic UI', Meiryo, system-ui, sans-serif;
    --bm-color-text-primary: var(--ui-ink);
    --bm-color-text-secondary: var(--ui-muted);
    --bm-color-text-muted: var(--ui-muted);
    --bm-color-surface: var(--ui-surface);
    --bm-color-surface-alt: var(--ui-soft);
    --bm-color-border: var(--ui-line);
    --bm-color-border-strong: var(--ui-input-line);
    --bm-color-accent: var(--ui-accent);
    --bm-color-accent-dark: var(--ui-accent-hover);
    --bm-color-accent-soft: var(--ui-accent-soft);
    --bm-shell-text: var(--ui-ink);
    --bm-shell-muted: var(--ui-muted);
    --bm-shell-border: var(--ui-line);
    --bm-shell-teal-900: var(--ui-nav);
    --bm-shell-context: 72px;
    --bm-page-padding-top: 24px;
    --bm-page-padding-inline: var(--bm-workspace-gutter);
    --bm-page-padding-bottom: 80px;
    --bm-type-page: 22px;
    --bm-type-section: 18px;
    --bm-type-card: 16px;
    --bm-type-metric: 28px;
    --bm-weight-body: 400;
    --bm-weight-label: 500;
    --bm-weight-strong: 600;
    --bm-weight-heading: 700;
    --bm-type-caption: 12px;
    --bm-type-label: 14px;
    --bm-type-body: 14px;
    --bm-leading-body: 1.65;
    --bm-readable-control: 14px;
    --bm-readable-muted: var(--ui-muted);
    --bm-readable-border: var(--ui-input-line);
    --bm-card-border: var(--ui-line);
    --bm-card-shadow: var(--ui-shadow);
    --bm-text-xs: 12px;
    --bm-text-sm: 14px;
    --bm-radius-lg: 12px;
    --bm-radius-xl: 14px;
    --bm-shadow-sm: var(--ui-shadow);
    --bm-shadow-md: 0 4px 12px rgb(24 44 56 / 5%);
    --bm-shadow-lg: 0 8px 24px rgb(24 44 56 / 8%);
    --bm-shadow-xl: 0 16px 48px rgb(24 44 56 / 12%);
    --bg-main: var(--ui-canvas);
    --bg-surface: var(--ui-surface);
    --text-primary: var(--ui-ink);
    --text-secondary: var(--ui-muted);
    --border-subtle: var(--ui-line);
    scrollbar-color: #aab9c2 var(--ui-canvas);
    scroll-padding-block: 96px;
  }

  html.bm-ui.dark {
    --ui-canvas: #1b1e24;
    --ui-surface: #242830;
    --ui-soft: #2c323c;
    --ui-rail: #20242b;
    --ui-ink: #e7eef2;
    --ui-muted: #b5c3cc;
    --ui-line: #3d505c;
    --ui-input-line: #687e8b;
    --ui-accent: #187e73;
    --ui-accent-hover: #11695f;
    --ui-accent-soft: #24483f;
    --ui-accent-ink: #82d8c5;
  }

  /* 明るい業務パネルを前提とする既存画面は、暗い外枠でも文字色と面を対で保つ。 */
  .bm-ui.dark :is(.bn-page, .ops-page, .lc-main, .mer-shell, .acceptance-shell, .elw-page, .today-main, .bm-property-workspace, .al-page, .water-workspace, .wo-main, .equipment-matrix-page, .bm-search-shell--embedded) {
    --ui-canvas: #f7f8fa; --ui-surface: #fff; --ui-soft: #f1f3f5;
    --ui-ink: #24282f; --ui-muted: #5b6470; --ui-line: #e1e5e9; --ui-input-line: #a3adb9;
    --ui-accent: #176f64; --ui-accent-hover: #11594f; --ui-accent-soft: #eaf4f0;
    --ui-accent-ink: var(--ui-accent);
    --bm-shell-text: var(--ui-ink); --bm-shell-muted: var(--ui-muted);
    --bm-readable-muted: var(--ui-muted);
    color-scheme: light;
    background-color: var(--ui-canvas);
    color: var(--ui-ink);
  }

  .bm-ui body {
    margin: 0;
    color: var(--ui-ink);
    background-color: var(--ui-canvas);
    font-family: var(--bm-font-sans);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  .bm-ui :where(button, input, select, textarea) { font-family: inherit; }
  .bm-ui small { font-size: 12px; }
  .bm-ui :where(h1, h2, h3, h4) { letter-spacing: .01em; text-wrap: pretty; }
  .bm-ui :where(button, a, summary) { -webkit-tap-highlight-color: transparent; }
  .bm-ui :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #1b9386 !important;
    outline-offset: 3px;
  }
  .bm-ui :where(button, input, select, textarea):disabled { cursor: not-allowed; }
  .bm-ui :is(.font-black, .font-extrabold, .font-bold) { font-weight: var(--bm-weight-strong); }
  .bm-ui :where(.tracking-widest, .tracking-wider) { letter-spacing: .04em; }
  .bm-ui :where(.bm-badge) { font-size: 12px; font-weight: 600; }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main)
    :where(.text-\[8px\], .text-\[9px\], .text-\[10px\], .text-\[11px\]) { font-size: 12px !important; line-height: 1.5 !important; }
  .bm-ui a[href='#bm-main-content'] {
    position: fixed; top: 12px; left: 12px; z-index: 10000;
    min-height: 44px; padding: 10px 18px; border-radius: 8px;
    color: #fff; background: var(--ui-nav); transform: translateY(calc(-100% - 24px));
  }
  .bm-ui a[href='#bm-main-content']:focus { transform: translateY(0); }

  /* 高さ・横スクロールは各業務画面が管理する。 */
  .bm-ui :is(.bm-app-shell, .bm-app-main, .bm-standalone-shell, .bm-standalone-main, .bm-legacy-main) {
    background-color: var(--ui-canvas) !important;
    color: var(--ui-ink);
  }
  .bm-ui .bm-app-header-wrap { background: var(--ui-surface); backdrop-filter: none; }
  /* 遅い起動で旧パンくずの監視が終了していても、共通ナビとの重複を防ぐ。 */
  .bm-ui:has(.bm-primary-rail) .bm-bc-helper { display: none; }
  .bm-ui :is(.bm-page-canvas, .today-main) { padding-top: var(--bm-page-padding-top); }
  .bm-ui .bm-page-context {
    min-height: var(--bm-shell-context); padding: 14px var(--bm-page-padding-inline); gap: 20px;
    background: var(--ui-surface); border-bottom: 1px solid var(--ui-line);
  }
  .bm-ui .bm-global-header { background: var(--ui-surface); box-shadow: none; border: 0; }
  .bm-ui .bm-page-context__heading { display: block; }
  .bm-ui .bm-page-context h1 { font-size: 22px; line-height: 1.4; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
  .bm-ui .bm-page-context__heading p { margin-top: 3px; font-size: 13px; font-weight: 400; }
  .bm-ui .bm-page-context nav { flex-wrap: wrap; gap: 6px; }
  .bm-ui .bm-page-context nav a:hover { color: var(--ui-accent); text-decoration: underline; }
  .bm-ui .bm-context-scope > button { min-height: 44px; border-color: var(--ui-line); border-radius: 8px; background: var(--ui-soft); color: var(--ui-ink); }
  .bm-ui .bm-context-scope small { color: var(--ui-muted); font-size: 12px; }
  .bm-ui .bm-scope-selector__menu { border-color: var(--ui-line); background: var(--ui-surface); box-shadow: var(--bm-shadow-lg); }
  .bm-ui .bm-scope-selector__menu button { min-height: 44px; color: var(--ui-ink); }
  .bm-ui .bm-scope-selector__menu button:hover { background: var(--ui-accent-soft); }
  .bm-ui .bm-scope-picker { display: flex; flex-direction: column; left: auto; right: 0; width: min(360px, 80vw); padding: 0; overflow: hidden; }
  .bm-ui .bm-scope-picker__search { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--ui-line); }
  .bm-ui .bm-scope-picker__search > svg { width: 18px; flex: 0 0 18px; color: var(--ui-muted); }
  .bm-ui .bm-scope-picker__search input { min-width: 0; width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--ui-input-line); border-radius: 8px; color: var(--ui-ink); background: var(--ui-surface); font: inherit; }
  .bm-ui .bm-scope-picker__search button { display: grid; place-items: center; width: 44px; flex: 0 0 44px; padding: 8px; }
  .bm-ui .bm-scope-picker__search button svg { width: 18px; }
  .bm-ui .bm-scope-picker__count { padding: 8px 14px; color: var(--ui-muted); font-size: 12px; overflow-wrap: anywhere; }
  .bm-ui .bm-scope-picker__options { min-height: 0; padding: 4px 7px 7px; max-height: min(380px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
  .bm-ui .bm-scope-picker__options button { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
  .bm-ui .bm-scope-picker__options button span { overflow-wrap: anywhere; }
  .bm-ui .bm-scope-picker__options button svg { width: 18px; flex: 0 0 18px; }
  .bm-ui .bm-scope-picker__options button[aria-pressed=true] { color: var(--ui-accent); background: var(--ui-accent-soft); font-weight: 600; }
  .bm-ui.dark .bm-scope-picker__options button[aria-pressed=true] { color: #82d8c5; }
  .bm-ui .bm-scope-picker__empty { margin: 8px; color: var(--ui-muted); font-size: 13px; }

  /* 適用中の条件は、入力欄を閉じても確認・解除できる。 */
  .bm-ui .bm-applied-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
  .bm-ui .bm-applied-filters > span { margin-right: 4px; color: var(--ui-muted); font-size: 12px; }
  .bm-ui .bm-applied-filters button { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 13px; cursor: pointer; }
  .bm-ui .bm-applied-filters button span { overflow-wrap: anywhere; text-align: left; }
  .bm-ui .bm-applied-filters button svg { width: 16px; flex: 0 0 16px; }
  .bm-ui .bm-applied-filters .bm-applied-filters__clear { color: var(--ui-muted); background: transparent; border-color: transparent; }

  /* 選択・主要操作は緑、警告・異常の色は業務上の意味を維持する。 */
  .bm-ui :is(.bm-page-primary-action, .bm-btn-primary, .elw-add-button, .today-search) {
    min-height: 44px; padding-inline: 16px; color: #fff; background: var(--ui-accent);
    border: 1px solid var(--ui-accent); border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: none;
  }
  .bm-ui :is(.bm-page-primary-action, .bm-btn-primary, .elw-add-button, .today-search):hover { background: var(--ui-accent-hover); border-color: var(--ui-accent-hover); }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main) :where(button, a).bg-brand-600 { background-color: var(--ui-accent); box-shadow: none; }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main)
    :where(button, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), select, summary, a[role=button]) { min-height: 44px !important; }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main)
    :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), select, textarea) {
    border-color: var(--ui-input-line) !important; border-radius: 8px; color: var(--ui-ink); background-color: var(--ui-surface);
  }
  .bm-ui :where(input, textarea)::placeholder { color: #637580; opacity: 1; }
  .bm-ui.dark :where(input, textarea)::placeholder { color: #acbbc4; }
  .bm-ui :where(input[type=checkbox], input[type=radio]) { accent-color: var(--ui-accent); }
  .bm-ui input[type=range] { appearance: none; min-height: 44px; height: 44px; padding: 0; border: 0; background: transparent !important; }
  .bm-ui input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #b6c5cd; }
  .bm-ui input[type=range]::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; margin-top: -9px; border: 3px solid white; border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent); }
  .bm-ui input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #b6c5cd; }
  .bm-ui input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid white; border-radius: 50%; background: var(--ui-accent); }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main) :where(table) { font-variant-numeric: tabular-nums; line-height: 1.55; }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main) :where(th) { color: var(--ui-muted); background: var(--ui-soft); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main) :where(th, td) { border-color: var(--ui-line); }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main) :where(tbody tr):hover { background-color: var(--ui-accent-soft); }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main)
    :where(section, article, div).bg-white:is(.rounded-xl, .rounded-2xl, .rounded-3xl) {
    border-color: var(--ui-line) !important; border-radius: var(--ui-radius); box-shadow: var(--ui-shadow);
  }
  .bm-ui:not(.dark) :where(.text-slate-400, .text-gray-400) { color: #637580; }

  /* 中間幅は細いレール、広い画面は文字を左揃えした一覧にする。 */
  .bm-ui .bm-primary-rail { color: var(--ui-ink); background: var(--ui-rail); border: 0; border-right: 1px solid var(--ui-line); }
  .bm-ui .bm-primary-rail__brand { flex-shrink: 0; min-height: 72px; color: var(--ui-ink); border-color: var(--ui-line); }
  .bm-ui .bm-primary-rail__brand > span { background: var(--ui-nav); border-radius: 9px; box-shadow: none; }
  .bm-ui .bm-primary-rail__brand-name { display: none; }
  .bm-ui :is(.bm-primary-rail__nav a, .bm-primary-rail__footer a, .bm-primary-rail__footer button) { color: var(--ui-muted); font-weight: 500; border-radius: 7px; }
  .bm-ui :is(.bm-primary-rail__nav a, .bm-primary-rail__footer a, .bm-primary-rail__footer button):hover { color: var(--ui-ink); background: var(--ui-surface); }
  .bm-ui .bm-primary-rail__nav a.is-active { color: var(--ui-accent); background: var(--ui-surface); box-shadow: 0 1px 3px rgb(24 32 44 / 8%); }
  .bm-ui .bm-primary-rail__nav a.is-active::before { background: var(--ui-accent); }
  .bm-ui .bm-primary-rail__nav a.is-active span { font-weight: 600; }
  .bm-ui .bm-primary-rail__phase + .bm-primary-rail__phase { border-color: var(--ui-line); }
  .bm-ui .bm-primary-rail__phase > p { color: var(--ui-muted); }
  .bm-ui .bm-primary-rail__phase > p > b { color: inherit; border-color: var(--ui-line); background: transparent; }
  .bm-ui .bm-primary-rail__next { flex-shrink: 0; color: var(--ui-ink); border-color: var(--ui-line); background: var(--ui-surface); }
  .bm-ui .bm-primary-rail__next:hover { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
  .bm-ui .bm-primary-rail__next small { font-size: 12px; font-weight: 500; color: var(--ui-muted); }
  .bm-ui .bm-primary-rail__next strong { font-weight: 600; }
  .bm-ui .bm-primary-rail__next.is-sync_pending { color: #885812; border-color: #d6b577; background: #fff8e8; }
  .bm-ui .bm-primary-rail__next.is-sync_failed { color: #a12d35; border-color: #e5b6bb; background: #fff1f2; }
  .bm-ui .bm-primary-rail__search { flex-shrink: 0; color: var(--ui-muted); border-color: var(--ui-input-line); background: var(--ui-surface); font-weight: 500; }
  .bm-ui .bm-primary-rail__search:hover { color: var(--ui-ink); border-color: var(--ui-accent); }
  .bm-ui .bm-primary-rail__search kbd { padding: 3px; color: var(--ui-muted); background: var(--ui-soft); border: 1px solid var(--ui-line); font-weight: 400; }
  .bm-ui .bm-primary-rail__footer { flex-shrink: 0; border-color: var(--ui-line); }
  .bm-ui .bm-primary-rail__footer a.is-emergency { color: #a12d35; background: #fbecee; }
  .bm-ui .bm-primary-rail__footer a.is-resume { color: var(--ui-accent); background: var(--ui-accent-soft); }
  .bm-ui .bm-primary-rail__nav a > .bm-navigation-queue-badge { border-color: var(--ui-rail); }
  .bm-ui .bm-mobile-topbar { color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-line); }
  .bm-ui .bm-bottom-navigation { background: var(--ui-surface); border-color: var(--ui-line); box-shadow: 0 -2px 12px rgb(24 44 56 / 5%); }
  .bm-ui .bm-bottom-navigation > button { color: var(--ui-muted); }
  .bm-ui .bm-bottom-navigation > button[aria-current=page] { color: var(--ui-accent); background: var(--ui-accent-soft); }
  .bm-ui .bm-mobile-menu > section { color: var(--ui-ink); background: var(--ui-surface); }

  /* ホーム：概要、次の操作、業務一覧のまとまりを明確にする。 */
  .bm-ui .today-hero { margin-bottom: 24px; padding-block: 8px; }
  .bm-ui .today-hero h2 { color: var(--ui-ink); font-size: clamp(25px, 2.1vw, 30px); font-weight: 650; letter-spacing: .01em; }
  .bm-ui .today-kicker { color: var(--ui-muted); font-size: 12px; font-weight: 500; letter-spacing: .06em; }
  .bm-ui .today-intro { color: var(--ui-muted); }
  .bm-ui .today-summary { gap: 0; margin-bottom: 24px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); }
  .bm-ui .today-summary-card { position: relative; min-height: 140px; padding: 20px 24px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .bm-ui .today-summary-card + .today-summary-card { border-left: 1px solid var(--ui-line); }
  .bm-ui .today-summary-card:first-child { border-radius: 12px 0 0 12px; }
  .bm-ui .today-summary-card:last-child { border-radius: 0 12px 12px 0; }
  .bm-ui .today-summary-card > svg { position: absolute; top: 22px; right: 20px; width: 17px; height: 17px; color: var(--ui-muted); }
  .bm-ui .today-summary-card > div { width: 100%; gap: 10px; }
  .bm-ui .today-summary-card > div > span:first-child { padding-right: 18px; color: var(--ui-muted); font-weight: 500; }
  .bm-ui .today-summary-card strong { color: var(--ui-ink); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
  .bm-ui .today-summary-card strong small { margin-left: 6px; color: var(--ui-muted); font-weight: 400; }
  .bm-ui .today-summary-card .today-summary-state { width: fit-content; padding: 2px 7px; border-radius: 5px; color: var(--ui-muted); background: var(--ui-soft); font-size: 12px; font-weight: 500; }
  .bm-ui .today-summary-card.is-danger .today-summary-state { color: #a12d35; background: #fbecee; }
  .bm-ui .today-summary-card.is-warning .today-summary-state { color: #885812; background: #fcf3df; }
  .bm-ui .today-summary-card:hover { transform: none; background: var(--ui-soft); box-shadow: none; }
  .bm-ui .today-sections { gap: 20px; }
  .bm-ui .today-section { overflow: hidden; border-color: var(--ui-line); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
  .bm-ui .today-section > header { min-height: 80px; padding: 16px 20px; background: var(--ui-surface); border-color: var(--ui-line); }
  .bm-ui .today-section :is(h2, h3) { color: var(--ui-ink); font-size: 16px; font-weight: 600; }
  .bm-ui .today-section header strong { color: var(--ui-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
  .bm-ui .today-order { color: var(--ui-muted); font-weight: 500; }
  .bm-ui .today-section header p { font-weight: 400; }
  .bm-ui .today-items { padding: 4px 12px 12px; }
  .bm-ui .today-item { padding: 14px 10px; border-color: var(--ui-line); }
  .bm-ui .today-item-title { color: var(--ui-ink); font-weight: 600; }
  .bm-ui .today-next-action { margin-block: 24px; border-color: var(--ui-line); background: var(--ui-surface); box-shadow: none; }
  .bm-ui .today-next-action.priority-critical { border-left-color: #b83a31; }
  .bm-ui .today-next-action.priority-high { border-left-color: #a86d17; }
  .bm-ui .today-next-action.is-clear { border-left-color: var(--ui-accent); }
  .bm-ui .today-next-action-rank { width: 36px; height: 36px; color: var(--ui-accent); background: var(--ui-accent-soft); border-radius: 8px; font-weight: 600; }
  .bm-ui .today-next-action.priority-critical .today-next-action-rank { color: #a12d35; background: #fbecee; }
  .bm-ui .today-next-action-copy h2 { color: var(--ui-ink); font-size: 17px; font-weight: 600; }
  .bm-ui .today-next-action-copy > span { font-weight: 600; }
  .bm-ui .today-next-action-copy p { color: var(--ui-muted); }
  .bm-ui .today-next-action > a { background: var(--ui-accent); font-size: 14px; font-weight: 600; }
  .bm-ui .today-next-action > a:hover { background: var(--ui-accent-hover); }
  .bm-ui .today-workflow-steps { display: flex; flex-wrap: wrap; gap: 4px 18px; counter-reset: workflow; }
  .bm-ui .today-workflow-steps li { display: flex; align-items: center; gap: 6px; min-height: 26px; padding: 0; color: var(--ui-muted); background: transparent; border: 0; border-radius: 0; font-size: 12px; font-weight: 500; text-align: left; counter-increment: workflow; }
  .bm-ui .today-workflow-steps li::before { position: static; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--ui-muted); background: var(--ui-soft); border: 0; border-radius: 50%; content: counter(workflow); }
  .bm-ui .today-workflow-steps li.is-current { color: var(--ui-accent); font-weight: 600; }
  .bm-ui .today-workflow-steps li.is-current::before { color: #fff; background: var(--ui-accent); }
  .bm-ui .today-search { color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-input-line); }
  .bm-ui .today-search:hover { color: var(--ui-accent); background: var(--ui-accent-soft); }
  .bm-ui .today-scope { color: var(--ui-muted); font-weight: 400; }
  .bm-ui .today-owner-switch { border-color: var(--ui-line); background: var(--ui-soft); }
  .bm-ui .today-scope .today-owner-switch button { color: var(--ui-muted); font-weight: 500; }
  .bm-ui .today-scope .today-owner-switch button.is-active { color: var(--ui-ink); background: var(--ui-surface); box-shadow: 0 1px 3px rgb(24 32 44 / 10%); }
  .bm-ui .today-owner-name { color: var(--ui-muted); font-weight: 500; }

  /* 物件・設備の検索条件と一覧の枠。 */
  .bm-ui .elw-page {
    --elw-ink: var(--ui-ink); --elw-muted: var(--ui-muted); --elw-border: var(--ui-line);
    --elw-soft-border: var(--ui-line); --elw-panel: var(--ui-surface); --elw-canvas: var(--ui-canvas);
    --elw-teal: var(--ui-accent); --elw-teal-soft: var(--ui-accent-soft);
    padding-top: var(--bm-page-padding-top); font-family: inherit;
  }
  .bm-ui :is(.elw-search-panel, .elw-list-panel, .bm-property-local-navigation, .bm-property-command-card, .bm-property-action-queue, .bm-property-building-overview, .bm-property-documents) {
    border-color: var(--ui-line); border-radius: var(--ui-radius); background-color: var(--ui-surface); box-shadow: var(--ui-shadow);
  }
  .bm-ui .elw-search-panel { padding: 20px; }
  .bm-ui .elw-condition-controls { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
  .bm-ui .elw-desktop-advanced summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-soft); color: var(--ui-ink); font-size: 13px; cursor: pointer; list-style: none; }
  .bm-ui .elw-desktop-advanced summary::-webkit-details-marker { display: none; }
  .bm-ui .elw-desktop-advanced summary svg { width: 16px; flex: 0 0 16px; }
  .bm-ui .elw-desktop-advanced[open] { grid-column: 1 / -1; }
  .bm-ui .elw-desktop-advanced[open] summary { width: fit-content; margin-bottom: 12px; }
  .bm-ui .elw-desktop-advanced[open] summary svg { transform: rotate(90deg); }
  .bm-ui .elw-desktop-advanced > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; gap: 14px; }
  .bm-ui .elw-choice-field button { white-space: nowrap; }
  .bm-ui .elw-list-head { padding: 16px 20px; border-color: var(--ui-line); background: var(--ui-surface); }
  .bm-ui .bm-property-workspace { gap: 20px; color: var(--ui-ink); }
  /* 物件の選択・詳細と設備台帳は、同じ本文幅と左右余白を使用する。固定詳細パネルの領域は保持する。 */
  .bm-ui { --bm-workspace-gutter: 24px; }
  .bm-ui :is(.bm-page-canvas.bm-property-workspace, .elw-page:not(.is-dock-pinned)) {
    width: min(var(--bm-page-max), 100%);
    margin-inline: auto;
    padding-inline: var(--bm-workspace-gutter);
  }
  @media (max-width: 900px) { .bm-ui { --bm-workspace-gutter: 14px; } }
  @media (max-width: 390px) { .bm-ui { --bm-workspace-gutter: 10px; } }
  .bm-ui .bm-property-area-tabs { gap: 6px; }
  .bm-ui .bm-property-local-navigation { padding: 12px; }
  .bm-ui .bm-property-status-strip { border-color: var(--ui-line); box-shadow: none; }
  .bm-ui .al-controls { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, 190px)) auto; }
  .bm-ui .al-controls > * { min-width: 0; }
  .bm-ui :is(.al-overview, .al-card, .al-controls) { border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }

  @media (max-width: 1100px) {
    .bm-ui .al-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bm-ui .al-search { grid-column: 1 / -1; }
    .bm-ui .al-toggle { grid-column: 1 / -1; }
    .bm-ui .al-card-summary { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .bm-ui .al-user, .bm-ui .al-time { grid-column: 2 / -1; }
    .bm-ui .al-change-count, .bm-ui .al-no-diff { grid-column: 3; grid-row: 1; }
  }

  /* 旧サイドバーと水道検針も同じ配色に合わせる。 */
  .bm-ui .bm-core-sidebar { color: var(--ui-ink); background: var(--ui-rail) !important; border-right: 1px solid var(--ui-line) !important; }
  .bm-ui .bm-core-sidebar__brand { border-color: var(--ui-line) !important; }
  .bm-ui .bm-core-sidebar :where(a, button) { font-weight: 500; }
  .bm-ui .bm-core-sidebar__brand :is(h1, span) { color: var(--ui-ink) !important; }
  .bm-ui .bm-core-sidebar__brand p { color: var(--ui-muted) !important; letter-spacing: .03em; }
  .bm-ui .bm-core-sidebar__mark { background: var(--ui-nav); box-shadow: none; }
  .bm-ui .bm-core-sidebar__search input { color: var(--ui-ink) !important; background: var(--ui-surface) !important; border-color: var(--ui-input-line) !important; font-weight: 400; }
  .bm-ui .bm-core-sidebar__search input::placeholder { color: var(--ui-muted); }
  .bm-ui .bm-core-sidebar nav :is(a, button):not(.bg-brand-500) { color: var(--ui-ink) !important; }
  .bm-ui .bm-core-sidebar nav :is(a:hover, button:hover, .bg-surface-100) { color: var(--ui-ink) !important; background: var(--ui-surface) !important; }
  .bm-ui .bm-core-sidebar nav :is(.bg-brand-500, .bg-brand-600) { color: var(--ui-accent) !important; background: var(--ui-surface) !important; box-shadow: inset 3px 0 var(--ui-accent) !important; }
  .bm-ui .bm-core-sidebar nav :is(p, [class*="text-gray-400"], [class*="text-slate-4"], [class*="text-slate-5"]) { color: var(--ui-muted) !important; }
  .bm-ui .bm-core-sidebar__footer { color: var(--ui-ink); background: var(--ui-rail) !important; border-color: var(--ui-line) !important; }
  .bm-ui .bm-core-sidebar__footer p:first-child { color: var(--ui-ink) !important; }
  .bm-ui .water-workspace { --water-ink: #243442; --water-muted: #52616c; --water-teal: var(--ui-accent); --water-line: var(--ui-line); }
  /* 水道の見出し背景と文字色は、専用CSSで一緒に定義する。 */
  .bm-ui .water-property-card { border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui .water-workspace :is(.water-picker-description, .water-picker-eyebrow, .water-reading-state, .water-copy-previous, .water-unit-order, .filter-count) { font-size: 12px !important; }

  /* 認証画面は入力のまとまりを明確にする。 */
  .bm-ui .brand { background: var(--ui-nav); }
  .bm-ui .brand::before, .bm-ui .brand::after { border-radius: 24px; transform: rotate(25deg); }
  .bm-ui main.panel { background: var(--ui-canvas); }
  .bm-ui .form-card { max-width: 420px; padding: 32px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-surface); box-shadow: var(--bm-shadow-md); }
  .bm-ui .form-card h2 { font-weight: 700; color: var(--ui-ink); }
  .bm-ui .form-card .lead { color: var(--ui-muted); line-height: 1.7; }
  .bm-ui .form-card label { color: var(--ui-ink); font-size: 14px; }
  .bm-ui .form-card button { background-color: var(--ui-accent); border-radius: 8px; }
  .bm-ui .form-card button:hover { background-color: var(--ui-accent-hover); }

  /* 全機能メニューは検索と短い行の一覧で目的の業務へ進める。 */
  .bm-ui .bm-tool-menu { padding: 24px var(--bm-page-padding-inline) 100px !important; background: var(--ui-canvas) !important; }
  .bm-ui .bm-tool-menu > div { max-width: none; }
  .bm-ui .bm-tool-menu__header { max-width: none; margin: 0 0 28px !important; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; box-shadow: none; }
  .bm-ui .bm-tool-menu__header h2 { color: var(--ui-ink); font-size: 26px; }
  .bm-ui .bm-tool-menu__header p { padding: 0; color: var(--ui-muted) !important; font-weight: 400; }
  .bm-ui .bm-tool-menu__header svg { color: var(--ui-accent) !important; }
  .bm-ui .bm-tool-menu__header button { color: var(--ui-ink) !important; background: var(--ui-soft); border-color: var(--ui-line); white-space: nowrap; }
  .bm-ui .bm-tool-menu__header button svg { color: currentColor !important; }
  .bm-ui .bm-tool-menu__search { display: grid; grid-template-columns: minmax(0, 560px) auto; align-items: center; gap: 8px 20px; margin-bottom: 28px; }
  .bm-ui .bm-tool-menu__search > label { grid-column: 1 / -1; font-weight: 600; }
  .bm-ui .bm-tool-menu__search > div { position: relative; display: flex; gap: 8px; align-items: center; }
  .bm-ui .bm-tool-menu__search > div > svg { position: absolute; left: 14px; width: 18px; color: var(--ui-muted); pointer-events: none; }
  .bm-ui .bm-tool-menu__search input { width: 100%; min-width: 0; min-height: 48px !important; padding: 10px 12px 10px 42px; border: 1px solid var(--ui-input-line); }
  .bm-ui .bm-tool-menu__search button { padding: 8px 12px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-ink); background: var(--ui-surface); white-space: nowrap; }
  .bm-ui .bm-tool-menu__search > p { color: var(--ui-muted); font-size: 13px; }
  .bm-ui #bm-menu-results { display: grid; gap: 28px; }
  .bm-ui #bm-menu-results > * { margin: 0; }
  .bm-ui .bm-tool-menu__section-toggle { position: static; width: 100%; margin: 0 0 12px; padding: 12px 0; color: var(--ui-ink); background: transparent !important; border-color: var(--ui-line); backdrop-filter: none; }
  .bm-ui .bm-tool-menu__section { width: 100%; max-width: none; }
  .bm-ui .bm-tool-menu__section-toggle h2 { color: var(--ui-ink); font-size: 17px; font-weight: 600; }
  .bm-ui .bm-tool-menu__category-copy p { margin: 4px 0 0; color: var(--ui-muted); font-size: 13px; font-weight: 400; line-height: 1.6; }
  .bm-ui .bm-tool-menu__section-toggle span { color: var(--ui-muted); }
  .bm-ui .bm-tool-menu__grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
  .bm-ui .bm-tool-menu__grid[hidden] { display: none; }
  .bm-ui .bm-tool-menu__card { min-height: 80px; display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--ui-line); background: var(--ui-surface) !important; border-radius: 10px; color: var(--ui-ink); text-decoration: none; box-shadow: none; }
  .bm-ui .bm-tool-menu__card:hover { transform: none; border-color: var(--ui-accent); background: var(--ui-accent-soft) !important; box-shadow: none; }
  .bm-ui .bm-tool-menu__card h3 { color: var(--ui-ink); font-size: 14px; font-weight: 600; }
  .bm-ui .bm-tool-menu__icon { flex: 0 0 40px; width: 40px; height: 40px; padding: 10px; border-radius: 10px; background: var(--ui-soft) !important; }
  .bm-ui .bm-tool-menu__icon svg { width: 20px; height: 20px; color: var(--ui-muted) !important; }
  .bm-ui .bm-tool-menu__card:hover .bm-tool-menu__icon { background: var(--ui-accent-soft) !important; }
  .bm-ui .bm-tool-menu__card:hover .bm-tool-menu__icon svg { color: var(--ui-accent) !important; }
  .bm-ui .bm-tool-menu__icon.is-emergency { background: #fceeee !important; }
  .bm-ui .bm-tool-menu__icon.is-emergency svg { color: #b83a31 !important; }
  .bm-ui .bm-tool-menu__card > svg { top: 50%; bottom: auto; right: 14px; width: 16px; transform: translateY(-50%); color: var(--ui-muted); }
  .bm-ui .bm-tool-menu__empty { display: grid; justify-items: center; gap: 12px; padding: 40px 20px; border: 1px dashed var(--ui-input-line); border-radius: 12px; text-align: center; background: var(--ui-surface); }
  .bm-ui .bm-tool-menu__empty > svg { color: var(--ui-muted); }
  .bm-ui .bm-tool-menu__empty button { padding: 10px 16px; background: var(--ui-accent); color: white; border-radius: 8px; }

  /* 作業指示：一覧を中心に置き、補助的な保存操作は必要なときに開く。 */
  .bm-ui .wo-hero { align-items: center; }
  .bm-ui .wo-hero small { color: var(--ui-muted); font-weight: 500; letter-spacing: .02em; }
  .bm-ui .wo-hero h2 { font-size: clamp(22px, 2vw, 28px); line-height: 1.4; color: var(--ui-ink); }
  .bm-ui .wo-hero p { color: var(--ui-muted); }
  .bm-ui :is(.wo-summary article, .wo-search-panel, .wo-card, .wo-vendor-queue, .wo-vendor-board) { border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui .wo-summary article { border-top-width: 1px; }
  .bm-ui .wo-summary article.is-danger { border-left: 3px solid #a12d35; }
  .bm-ui .wo-saved-views { display: flex; flex-wrap: wrap; gap: 8px 12px; }
  .bm-ui .wo-saved-view-chips { flex: 1 1 180px; }
  .bm-ui .wo-saved-views > span { color: var(--ui-muted); font-weight: 500; }
  .bm-ui .wo-save-view-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 13px; white-space: nowrap; cursor: pointer; }
  .bm-ui .wo-save-view-trigger svg { width: 16px; }
  .bm-ui .wo-save-view { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
  .bm-ui .wo-save-view input { flex: 1 1 180px; width: auto; min-width: 0; font-size: 14px; }
  .bm-ui .wo-save-view button { flex: 0 0 auto; white-space: nowrap; font-size: 13px; background: var(--ui-accent); font-weight: 600; }
  .bm-ui .wo-save-view .is-cancel { color: var(--ui-ink); background: var(--ui-soft); }
  .bm-ui .wo-saved-view-message { margin: 10px 0 0; color: var(--ui-muted); font-size: 13px; }
  .bm-ui .wo-toolbar { flex-wrap: wrap; gap: 8px; }
  .bm-ui .wo-toolbar nav { flex-wrap: nowrap; background: var(--ui-soft); }
  .bm-ui .wo-toolbar nav button { min-width: 0; padding-inline: 10px; font-weight: 600; white-space: nowrap; }

  /* 検索の進行表示は説明として読み、操作ボタンと見分けられる形にする。 */
  .bm-ui .bm-search-workflow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; border-color: var(--ui-line); border-left-color: var(--ui-accent); background: var(--ui-surface); box-shadow: none; }
  .bm-ui .bm-search-workflow__copy small { display: none; }
  .bm-ui .bm-search-workflow__copy h2 { margin: 0; color: var(--ui-ink); font-weight: 600; }
  .bm-ui .bm-search-workflow__copy p { color: var(--ui-muted); font-size: 13px; font-weight: 400; }
  .bm-ui .bm-search-workflow ol { display: flex; flex-wrap: wrap; gap: 6px 12px; }
  .bm-ui .bm-search-workflow li { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--ui-muted); font-size: 12px; font-weight: 500; }
  .bm-ui .bm-search-workflow li span { display: grid; place-items: center; width: 22px; height: 22px; margin: 0; border-radius: 50%; background: var(--ui-soft); font-size: 11px; opacity: 1; }
  .bm-ui .bm-search-workflow li.is-current { color: var(--ui-accent); font-weight: 600; }
  .bm-ui .bm-search-workflow li.is-current span { color: #fff; background: var(--ui-accent); }
  .bm-ui .bm-search-primary-action { min-height: 44px !important; border-radius: 8px; background: var(--ui-accent); font-size: 13px; font-weight: 600; }
  .bm-ui .bm-search-workflow:is(.is-retry_search, .is-sign_in_required) { border-left-color: #a12d35; }
  .bm-ui .bm-search-workflow:is(.is-select_property, .is-refine_search, .is-query_too_short) { border-left-color: #885812; }
  .bm-ui .bm-search-shell--embedded :is(.bm-results, .bm-detail) { border-color: var(--ui-line); }

  /* 予算の濃色パネルと未登録セルは、背景に対応した読める補助色を使う。 */
  .bm-ui .equipment-matrix-page :is(.bm-matrix-missing, .text-slate-300) { color: #5b6470; }
  .bm-ui .bm-matrix-budget [class*="text-white/"] { color: #cbd5e1; }
  .bm-ui .bm-matrix-budget .bg-red-500 { color: #fff; background: #9f1239; }

  /* モバイルでも文字色と背景色を対にし、ナビの選択状態を揃える。 */
  .bm-ui .bm-mobile-topbar { border-bottom-width: 1px; }
  .bm-ui .bm-mobile-topbar__context > button { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; }
  .bm-ui .bm-mobile-topbar > button { flex-direction: column; gap: 1px; font-size: 10px; }
  .bm-ui .bm-mobile-topbar > button span { display: block; }
  .bm-ui .bm-mobile-topbar__resume { font-size: 12px; }
  .bm-ui .bm-mobile-topbar__context strong { color: var(--ui-ink); font-size: 14px; font-weight: 600; }
  .bm-ui .bm-mobile-topbar__context :is(span, button) { color: var(--ui-muted); font-weight: 400; }
  .bm-ui .bm-mobile-topbar > :is(a, button) { color: var(--ui-ink); }
  .bm-ui .bm-mobile-topbar__emergency { color: #a12d35 !important; background: #fbecee !important; border-color: #e5b6bb !important; }
  .bm-ui .bm-mobile-topbar__resume { color: var(--ui-accent) !important; background: var(--ui-accent-soft) !important; border-color: var(--ui-line) !important; }
  .bm-ui .bm-primary-rail__brand small { color: var(--ui-ink); }
  .bm-ui .bm-tool-menu__customize { max-width: none; background: var(--ui-surface) !important; border-color: var(--ui-line) !important; }
  .bm-ui.dark :is(.bm-primary-rail__nav a.is-active, .bm-primary-rail__footer a.is-resume, .bm-bottom-navigation > button[aria-current=page]) { color: #82d8c5; }
  .bm-ui.dark .bm-mobile-topbar__resume { color: #82d8c5 !important; }
  .bm-ui.dark .bm-core-sidebar nav :is(.bg-brand-500, .bg-brand-600) { color: #82d8c5 !important; }

  /* 現場用の2段検索ヘッダーは、通常カードの余白で高さを増やさない。 */
  @media (max-width: 900px) {
    .bm-ui .elw-page .elw-search-panel { padding: 5px 10px; }
    .bm-ui .elw-page .elw-search-panel.is-mobile-condensed { padding-block: 4px; }
  }

  @media (min-width: 768px) and (max-width: 1120px) {
    .bm-ui .today-summary { gap: 12px; border: 0; background: transparent; }
    .bm-ui .today-summary-card { border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); }
    .bm-ui .today-summary-card:first-child, .bm-ui .today-summary-card:last-child { border-radius: 10px; }
  }

  @media (min-width: 1280px) {
    html.bm-ui { --bm-shell-rail: 208px; }
    .bm-ui .bm-primary-rail__brand { display: flex; justify-content: flex-start; gap: 12px; padding: 16px 20px; }
    .bm-ui .bm-primary-rail__brand small { display: flex; flex-direction: column; align-items: flex-start; color: var(--ui-ink); font-size: 14px; letter-spacing: .03em; }
    .bm-ui .bm-primary-rail__brand-name { display: block; font-size: 12px; color: var(--ui-muted); font-weight: 400; letter-spacing: .02em; }
    .bm-ui .bm-primary-rail__nav { gap: 16px; padding: 16px 12px; }
    .bm-ui .bm-primary-rail__phase + .bm-primary-rail__phase { padding-top: 12px; }
    .bm-ui .bm-primary-rail__phase > p { justify-content: flex-start; gap: 8px; padding: 0 12px 8px; color: var(--ui-muted); font-weight: 500; }
    .bm-ui .bm-primary-rail__phase > p > b { width: auto; height: auto; border: 0; color: inherit; background: transparent; font-weight: 500; }
    .bm-ui .bm-primary-rail__nav a { min-height: 44px; padding: 10px 12px; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14px; }
    .bm-ui .bm-primary-rail__nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
    .bm-ui .bm-primary-rail__nav a.is-active::before { left: -12px; }
    .bm-ui .bm-primary-rail__next { width: calc(100% - 24px); margin: 0 12px 12px; min-height: 64px; padding: 12px; }
    .bm-ui .bm-primary-rail__next strong { font-size: 14px; line-height: 1.5; }
    .bm-ui .bm-primary-rail__search { width: calc(100% - 24px); margin: 0 12px 12px; min-height: 44px; padding: 10px; grid-template-areas: 'icon label shortcut'; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; text-align: left; }
    .bm-ui .bm-primary-rail__footer { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px 12px 16px; border-top: 1px solid var(--ui-line); }
    .bm-ui .bm-primary-rail__footer :is(a, button) { min-height: 44px; padding: 6px; flex-direction: row; gap: 6px; font-size: 12px; }
    .bm-ui .bm-primary-rail__footer svg { width: 16px; height: 16px; }
    .bm-ui .bm-primary-rail__footer button { grid-column: 1 / -1; }
  }
  @media (min-width: 768px) and (max-width: 1279px) {
    html.bm-ui { --bm-page-padding-inline: var(--bm-workspace-gutter); }
    .bm-ui .bm-page-context { flex-wrap: wrap; gap: 10px; }
    .bm-ui .bm-page-context__heading p { display: none; }
    .bm-ui .bm-primary-rail__nav { gap: 6px; }
    .bm-ui .bm-primary-rail__nav a { min-height: 52px; }
    .bm-ui .bm-primary-rail__footer :is(a, button) { min-height: 44px; }
  }
  @media (max-width: 767px) {
    html.bm-ui { --bm-page-padding-inline: var(--bm-workspace-gutter); --bm-page-padding-top: 16px; --bm-page-padding-bottom: 100px; --bm-shell-context: 56px; }
    .bm-ui .wo-hero { gap: 12px; }
    .bm-ui .wo-hero-actions { display: flex; width: 100%; justify-content: flex-start; gap: 8px; }
    .bm-ui .wo-hero-actions a { flex: 1 1 145px; justify-content: center; min-height: 44px; padding-inline: 10px; font-size: 12px; }
    .bm-ui .wo-summary article { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; }
    .bm-ui .wo-summary article > svg { display: none; }
    .bm-ui .wo-summary article > span { white-space: nowrap; }
    .bm-ui .wo-saved-view-chips:has(> small) { display: none; }
    .bm-ui .wo-save-view-trigger { margin-left: auto; }
    .bm-ui .wo-save-view input { flex-basis: 100%; }
    .bm-ui .wo-toolbar nav { flex-basis: 100%; }
    .bm-ui .wo-toolbar nav button { flex: 1; }
    .bm-ui .bm-search-workflow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .bm-ui .bm-search-workflow ol { gap: 6px 10px; }
    .bm-ui .bm-search-primary-action { grid-column: auto; width: 100%; }
    .bm-ui .bm-page-context { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
    .bm-ui .bm-page-context h1 { font-size: 20px; }
    .bm-ui .bm-page-context__tools { max-width: 100%; flex-wrap: wrap; }
    .bm-ui .bm-page-canvas { padding-inline: 16px; }
    .bm-ui :where(.bm-app-content-frame, .bm-page-canvas, .bm-legacy-main)
      :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) { font-size: 16px !important; }
    .bm-ui .today-main { padding-inline: 16px; }
    .bm-ui .today-hero { padding: 0; margin-bottom: 20px; }
    .bm-ui .today-summary { gap: 10px; border: 0; background: transparent; }
    .bm-ui .today-summary-card { min-height: 138px; padding: 14px; gap: 10px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); }
    .bm-ui .today-summary-card:first-child, .bm-ui .today-summary-card:last-child { border-radius: 10px; }
    .bm-ui .today-summary-card > svg { top: 17px; right: 12px; width: 15px; height: 15px; }
    .bm-ui .today-summary-card strong { font-size: 26px; }
    .bm-ui .today-sections { gap: 16px; }
    .bm-ui .today-section > header { padding: 16px; }
    .bm-ui .today-next-action { margin-block: 20px; }
    .bm-ui .today-workflow-steps { gap: 4px 12px; }
    .bm-ui .today-workflow-steps li { padding: 0; font-size: 12px; font-weight: 500; line-height: 1.5; }
    .bm-ui .elw-search-panel, .bm-ui .elw-list-head { padding: 14px; }
    .bm-ui .form-card { padding: 24px; }
    .bm-ui .bm-tool-menu__header { padding: 0 0 20px; }
    .bm-ui .bm-tool-menu__header h2 { font-size: 22px; }
    .bm-ui .bm-tool-menu__search { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .bm-ui .bm-tool-menu__grid { grid-template-columns: minmax(0, 1fr); }
  }
}

/* 共通部品の利用を独立画面まで広げる。印刷面と現場専用の固定操作は対象外。 */
@media screen {
  .bm-ui .bm-standard-page {
    width: 100%; max-width: var(--bm-page-max); margin-inline: auto;
    padding: var(--bm-page-padding-top) var(--bm-page-padding-inline) var(--bm-page-padding-bottom);
  }
  .bm-ui.water-workspace .bm-page-canvas { padding-inline: var(--bm-page-padding-inline); }
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas) h1,
  .bm-ui :where(.bm-app-content-frame, .bm-page-canvas) h2:is(.text-3xl, .sm\:text-3xl),
  .bm-ui .bm-ui-page-header :is(h1, h2) {
    font-size: var(--bm-type-page) !important; line-height: 1.4 !important; font-weight: 700;
  }
  .bm-ui .bm-ui-page-header { margin-bottom: 24px; align-items: flex-start; gap: 16px 24px; }
  .bm-ui .bm-ui-page-header__heading { min-width: 0; flex: 1 1 280px; gap: 12px; align-items: flex-start; }
  .bm-ui .bm-ui-page-header__heading > div:last-child { min-width: 0; }
  .bm-ui .bm-ui-page-header__icon {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px;
    color: var(--ui-accent-ink); background: var(--ui-accent-soft); box-shadow: none;
  }
  .bm-ui .bm-ui-page-header p { font-size: 14px; font-weight: 400; color: var(--ui-muted); line-height: 1.65; }
  .bm-ui .bm-ui-page-header__actions { gap: 8px; max-width: 100%; }
  .bm-ui .bm-ui-page-header__actions > div { display: flex; gap: 8px; flex-wrap: wrap; max-width: 100%; }
  .bm-ui .bm-ui-page-header__actions :is(button, select) { max-width: 100%; }
  .bm-ui .bm-ui-button { min-height: 44px; border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: none; }
  .bm-ui .bm-ui-button[data-variant=primary] { background: var(--ui-accent); color: #fff; }
  .bm-ui .bm-ui-button[data-variant=primary]:hover { background: var(--ui-accent-hover); }
  .bm-ui .bm-icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--ui-ink) !important; background: var(--ui-soft) !important; }
  .bm-ui .bm-context-badge { color: var(--ui-accent-ink) !important; background: var(--ui-accent-soft) !important; border-color: var(--ui-line); border-radius: 8px; }
  .bm-ui .bm-context-badge :is(span, svg) { color: inherit !important; flex-shrink: 0; }
  .bm-ui .bm-muted-action { color: var(--ui-muted); }
  .bm-ui .bm-rule-metadata > div { min-width: 0; overflow-wrap: anywhere; }
  .bm-ui .bm-rule-metadata svg { flex: 0 0 16px; }
  .bm-ui .bm-btn-primary { background: var(--ui-accent); color: #fff; border-color: var(--ui-accent); box-shadow: none; }
  .bm-ui .bm-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
  .bm-ui :where(.bm-app-content-frame) :is(section, article, div).bg-white:is(.rounded-\[1\.75rem\], .rounded-\[2rem\], .rounded-\[2\.5rem\], .rounded-\[3rem\]) {
    border-radius: var(--ui-radius); border-color: var(--ui-line); box-shadow: var(--ui-shadow);
  }
  .bm-ui .bm-invoice-import-page > .bg-white { padding: 24px; }
  .bm-ui .bm-invoice-import-page .border-dashed { border-width: 2px; border-color: var(--ui-input-line); border-radius: 12px; }
  .bm-ui .bm-invoice-import-page .border-dashed :is(p, span) { color: var(--ui-muted); }
  .bm-ui :is(.pc-shell, .ei-shell, .hc-shell) { background: var(--ui-canvas); color: var(--ui-ink); min-height: 0; }
  .bm-ui :is(.ei-main, .hc-main) { max-width: var(--bm-page-max); margin: 0 auto; padding: var(--bm-page-padding-top) var(--bm-page-padding-inline) var(--bm-page-padding-bottom); }
  .bm-ui .pc-readiness { margin: 0 auto; max-width: var(--bm-page-max); padding: var(--bm-page-padding-top) var(--bm-page-padding-inline) 24px; }
  .bm-ui :is(.pc-summary-grid article, .pc-correction-queue, .ei-overview, .ei-editor, .hc-panel) { border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui :is(.pc-shell, .ei-shell, .hc-shell) :is(button, a).is-primary { background: var(--ui-accent); color: #fff; }
  .bm-ui .bm-admin-page { max-width: 1100px; }
  .bm-ui .bm-analytics-mobile-scope { display: none; }
  .bm-ui .bm-admin-page .panel { padding: 24px; border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow); }
  .bm-ui .bm-admin-page .hint { color: var(--ui-muted); }
  .bm-ui .bm-admin-page h2 { font-weight: 700; font-size: 18px; }
  .bm-ui .pc-readiness-head h2 { font-size: var(--bm-type-page); font-weight: 700; }
  .bm-ui .bm-admin-page .primary { background: var(--ui-accent); }
  .bm-ui .bm-admin-page .primary:hover { background: var(--ui-accent-hover); }
  .bm-ui .bm-admin-page .primary:disabled { opacity: .55; }
  .bm-ui :is(.bm-admin-page .tab.active, .bm-accounting-page .tab-active) { color: var(--ui-accent); border-bottom-color: var(--ui-accent); }
  .bm-ui .bm-accounting-page > header { flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
  .bm-ui .bm-accounting-page > header > a { color: var(--ui-muted); }
  .bm-ui .bm-legacy-shell-root .bm-legacy-skip { position: fixed; }
  .bm-ui .bm-notice-error { padding: 16px; background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; border-radius: 12px; }
  .bm-ui .bm-notice-error button { margin-left: 12px; }
  .bm-ui .topbar[hidden] { display: none; }
  .bm-ui.dark :is(.bm-admin-page, .bm-accounting-page, .pc-shell, .ei-shell, .hc-shell, .bm-members-page, .bm-profile-page, .bm-light-panel) {
    --ui-canvas: #f7f8fa; --ui-surface: #fff; --ui-soft: #f1f3f5; --ui-ink: #24282f; --ui-muted: #5b6470;
    --ui-line: #e1e5e9; --ui-input-line: #a3adb9; --ui-accent: #176f64; --ui-accent-hover: #11594f; --ui-accent-soft: #eaf4f0;
    --ui-accent-ink: var(--ui-accent);
    background: var(--ui-canvas); color: var(--ui-ink); color-scheme: light;
  }
  @media (max-width: 767px) {
    .bm-ui .bm-analytics-mobile-scope { display: grid; gap: 6px; padding: 16px 16px 0; font-size: 14px; font-weight: 600; }
    .bm-ui .bm-analytics-mobile-scope select { padding: 8px 12px; border: 1px solid var(--ui-input-line); }
    .bm-ui .bm-ui-page-header__actions { width: 100%; }
    .bm-ui .bm-invoice-import-page > .bg-white { padding: 16px; }
    .bm-ui .bm-invoice-import-page .border-dashed { padding: 32px 16px; }
    .bm-ui .bm-admin-page .panel { padding: 16px; }
    .bm-ui .ei-savebar { bottom: var(--bm-shell-mobile-bottom); }
  }
}

@media print {
  .bm-legacy-shell-root { display: none !important; }
}

/* 印刷用の帳票・ポスターには画面用の装飾を適用しない。 */
@media (prefers-reduced-motion: reduce) {
  .bm-ui *, .bm-ui *::before, .bm-ui *::after {
    scroll-behavior: auto !important; transition-duration: .01ms !important;
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  }
}

/* 業務本文の左右位置は設備台帳を正本とする。カード内部の余白とは分けて管理する。 */
@media screen {
  .bm-ui :is(.bm-page-canvas, .bm-standard-page, .bm-page-gutter, .ops-page,
    .pc-readiness, .pc-main, .ei-main, .hc-main, .acceptance-main, .acceptance-header,
    .bm-search-shell--embedded > .bm-search-area, .bm-search-shell--embedded > .bm-workspace) {
    box-sizing: border-box; min-width: 0;
    width: min(var(--bm-page-max), 100%); max-width: var(--bm-page-max) !important;
    margin-inline: auto; padding-inline: var(--bm-workspace-gutter) !important;
  }
  .bm-ui .bm-page-context {
    box-sizing: border-box; width: min(var(--bm-page-max), 100%); margin-inline: auto;
  }
}

/* 文字の役割と色の用途を正本化する。画面追加時もこの段階を使用する。 */
@media screen {
  .bm-ui :is(.bm-app-main, .bm-standalone-main, .bm-legacy-main, .bm-ui-modal, .mer-shell) {
    font-family: var(--bm-font-sans); font-size: var(--bm-type-body); line-height: var(--bm-leading-body);
  }
  .bm-ui :is(.bm-app-main, .bm-standalone-main, .bm-legacy-main, .bm-ui-modal, .mer-shell) :is(h1, h2, h3, h4) {
    font-family: var(--bm-font-sans); font-weight: var(--bm-weight-strong) !important;
    line-height: 1.5 !important; letter-spacing: .01em;
  }
  .bm-ui :is(.bm-app-main, .bm-standalone-main, .bm-legacy-main, .bm-ui-modal, .mer-shell) h2 {
    font-size: var(--bm-type-section) !important;
  }
  .bm-ui :is(.bm-app-main, .bm-standalone-main, .bm-legacy-main, .bm-ui-modal, .mer-shell) h3 {
    font-size: var(--bm-type-card) !important;
  }
  .bm-ui :is(.bm-app-main, .bm-standalone-main, .bm-legacy-main, .bm-ui-modal, .mer-shell) h4 {
    font-size: var(--bm-type-label) !important;
  }
  .bm-ui :is(.bm-page-context h1, .bm-ui-page-header h1, .bm-ui-page-header h2, .bm-page-heading,
    .bm-app-content-frame h1, .bm-page-canvas h1, .mer-header h1,
    .today-hero h2, .wo-hero h2, .al-hero h2, .bn-hero h2, .ops-hero h2, .lc-hero h2,
    .pc-readiness-head h2, .hc-hero h2, .ei-hero h2, .bm-tool-menu__header h2,
    .bm-app-content-frame h2.text-2xl, .bm-app-content-frame h2.text-3xl,
    .bm-home-search__intro h2, .water-picker-heading h2) {
    font-size: var(--bm-type-page) !important; font-weight: var(--bm-weight-heading) !important; line-height: 1.45 !important;
  }
  .bm-ui :is(.bm-page-context h1, .bm-ui-page-header h1, .bm-ui-page-header h2, .bm-page-heading,
    .today-hero h2, .wo-hero h2, .al-hero h2, .bn-hero h2, .ops-hero h2, .lc-hero h2,
    .pc-readiness-head h2, .hc-hero h2, .ei-hero h2) { color: var(--ui-ink); }
  .bm-ui .water-workspace { --water-ink: var(--ui-ink); --water-muted: var(--ui-muted); }
  .bm-ui .bm-page-gutter > header > div:first-child > div:first-child:has(> svg):not(:has(h1, h2)) {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; color: var(--ui-accent-ink);
    background: var(--ui-accent-soft); box-shadow: none;
  }
  .bm-ui :is(.today-intro, .wo-hero p, .al-hero p, .bn-hero p, .ops-hero p, .lc-hero p) {
    font-size: var(--bm-type-body); font-weight: var(--bm-weight-body); line-height: var(--bm-leading-body); color: var(--ui-muted);
  }
  .bm-ui :is(button, input, select, textarea) { font-family: var(--bm-font-sans); }
  .bm-ui :where(button, select, textarea, input:not([type=checkbox]):not([type=radio]):not([type=range])) {
    font-size: var(--bm-type-label) !important;
  }
  .bm-ui :where(button, summary) { font-weight: var(--bm-weight-strong); }
  .bm-ui :where(input, select, textarea) { font-weight: var(--bm-weight-body); }
  .bm-ui :is(.bm-context-scope, .bm-applied-filters, .bm-ui-tabs, .bm-ui-button) { font-size: var(--bm-type-label); }

  /* 無彩色の文字は本文・補助の2段階へ。白抜き、警告色、グラフ系列は保持する。 */
  .bm-ui:not(.dark) :is(.text-slate-700, .text-slate-800, .text-slate-900, .text-slate-950,
    .text-gray-700, .text-gray-800, .text-gray-900, .text-gray-950) { color: var(--ui-ink); }
  .bm-ui:not(.dark) :is(.text-slate-400, .text-slate-500, .text-slate-600,
    .text-gray-400, .text-gray-500, .text-gray-600) { color: var(--ui-muted); }
  .bm-ui .bm-ui-card { border-color: var(--ui-line); background: var(--ui-surface); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui .bm-ui-card[data-variant=subtle] { background: var(--ui-soft); }
  .bm-ui :is(.bn-overview, .bn-card, .bn-controls, .al-overview) { color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui .bm-ui-modal { color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--bm-shadow-xl); }
  .bm-ui .bm-ui-modal > :is(header, footer) { border-color: var(--ui-line); }
  .bm-ui :is(.bm-metric-value, .today-summary-card strong, .wo-summary article strong, .lc-summary strong) {
    font-size: var(--bm-type-metric) !important; font-weight: var(--bm-weight-strong) !important; line-height: 1.25 !important; font-variant-numeric: tabular-nums;
  }
  .bm-ui :is(.ops-hero-actions label, .bm-search-workflow li span) { font-size: var(--bm-type-caption) !important; font-weight: var(--bm-weight-label); }
  .bm-ui .bn-card h2 { color: var(--ui-ink); font-size: var(--bm-type-card) !important; }
  .bm-ui .bm-admin-page h2 { color: var(--ui-ink); }
  .bm-ui:not(.dark) :is(.bg-slate-800, .bg-slate-900, .bg-gray-800, .bg-gray-900, .bm-matrix-budget) {
    --ui-ink: #f8fafc; --ui-muted: #cbd5e1;
  }
  .bm-ui .bm-ui-tabs { border: 1px solid var(--ui-line); background: var(--ui-soft); border-radius: 10px; }
  .bm-ui .bm-ui-tabs > button { color: var(--ui-muted); box-shadow: none; font-weight: var(--bm-weight-label); }
  .bm-ui .bm-ui-tabs > button[aria-selected=true] { color: var(--ui-accent-ink); background: var(--ui-surface); font-weight: var(--bm-weight-strong); box-shadow: var(--ui-shadow); }
  .bm-ui .bm-ui-button[data-variant=secondary] { color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-input-line); }
  .bm-ui .bm-ui-button[data-variant=secondary]:hover { background: var(--ui-soft); }
  .bm-ui .bm-ui-button[data-variant=ghost] { color: var(--ui-muted); background: transparent; }
  .bm-ui .bm-ui-button[data-variant=ghost]:hover { background: var(--ui-soft); }
  .bm-ui .bm-ui-badge { font-size: var(--bm-type-caption); font-weight: var(--bm-weight-strong); line-height: 1.5; }
  .bm-ui .bm-ui-badge[data-variant=neutral] { color: var(--ui-muted); background: var(--ui-soft); }
  .bm-ui .bm-ui-badge[data-variant=accent] { color: var(--ui-accent-ink); background: var(--ui-accent-soft); }

  /* 通常の実行操作は緑へ集約する。破棄・警告・承認の意味を持つ色は対象外。 */
  .bm-ui :is(button, a[role=button], a.bm-ui-button):is(.bg-brand-500, .bg-brand-600, .bg-brand-700,
    .bg-blue-500, .bg-blue-600, .bg-blue-700, .bg-indigo-500, .bg-indigo-600, .bg-indigo-700,
    .bg-purple-500, .bg-purple-600, .bg-violet-500, .bg-violet-600),
  .bm-ui .bm-action-primary { color: #fff; background-color: var(--ui-accent); border-color: var(--ui-accent); box-shadow: none; }
  .bm-ui :is(button, a[role=button], a.bm-ui-button):is(.bg-brand-500, .bg-brand-600, .bg-brand-700,
    .bg-blue-500, .bg-blue-600, .bg-blue-700, .bg-indigo-500, .bg-indigo-600, .bg-indigo-700,
    .bg-purple-500, .bg-purple-600, .bg-violet-500, .bg-violet-600):hover,
  .bm-ui .bm-action-primary:hover { background-color: var(--ui-accent-hover); border-color: var(--ui-accent-hover); }

  /* 再開の場所を固定し、利用できない理由は無効状態の説明で伝える。 */
  .bm-ui .bm-primary-rail__footer .bm-resume-action { grid-column: auto; }
  .bm-ui .bm-primary-rail__footer .bm-resume-action:disabled { color: var(--ui-muted); background: transparent; opacity: .7; }
  .bm-ui .bm-mobile-menu__resume:disabled { display: flex; flex-wrap: wrap; gap: 8px; color: var(--ui-muted); background: var(--ui-soft); }
  .bm-ui .bm-mobile-menu__resume small { flex-basis: 100%; font-weight: var(--bm-weight-body); }

  /* ホームは検索、条件、履歴、回答を同じ読み幅と配色で揃える。 */
  .bm-ui .bm-ai-home { padding-top: var(--bm-page-padding-top); color: var(--ui-ink); }
  .bm-ui :is(.bm-home-search, .bm-ai-home__answer) { width: 100%; max-width: 880px; margin-inline: auto; }
  .bm-ui .bm-home-search__intro { margin: 0 0 24px; text-align: left; }
  .bm-ui .bm-home-search__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ui-muted); font-size: var(--bm-type-caption); font-weight: var(--bm-weight-label); }
  .bm-ui .bm-home-search__eyebrow svg { width: 16px; height: 16px; }
  .bm-ui .bm-home-search__intro h2 { margin: 0; color: var(--ui-ink); }
  .bm-ui .bm-home-search__intro p { margin: 8px 0 0; color: var(--ui-muted); font-size: var(--bm-type-body); line-height: var(--bm-leading-body); }
  .bm-ui .bm-home-search .bm-ai-home__search-wrap { max-width: none; margin: 0; }
  .bm-ui .bm-home-search .bm-ai-home__search-card { background: var(--ui-surface) !important; border: 1px solid var(--ui-input-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); backdrop-filter: none; }
  .bm-ui .bm-home-search__input-row { display: flex; align-items: center; gap: 12px; padding: 16px; }
  .bm-ui .bm-home-search__input-row > svg { width: 22px; height: 22px; color: var(--ui-muted); }
  .bm-ui .bm-home-search__input-row textarea { min-width: 0; width: 100%; min-height: 72px; padding: 8px; border: 0; border-radius: 8px; color: var(--ui-ink); background: var(--ui-surface); font-size: 16px !important; font-weight: var(--bm-weight-body); line-height: 1.65; }
  .bm-ui .bm-home-search__input-row textarea::placeholder { color: var(--ui-muted); }
  .bm-ui .bm-home-search .bm-ai-home__search-card textarea { font-weight: var(--bm-weight-body) !important; }
  .bm-ui .bm-home-search__input-row > div { flex-shrink: 0; }
  .bm-ui :is(.bm-home-search__voice, .bm-home-search__submit) { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; border-radius: 8px; flex-shrink: 0; }
  .bm-ui .bm-home-search__voice { color: var(--ui-muted); background: var(--ui-soft); border: 1px solid var(--ui-line); }
  .bm-ui .bm-home-search__submit { width: auto; padding-inline: 16px; }
  .bm-ui .bm-home-search__submit:disabled { color: var(--ui-muted); background: var(--ui-soft); border-color: var(--ui-line); opacity: 1; }
  .bm-ui .bm-home-search__modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; border-top: 1px solid var(--ui-line); background: var(--ui-soft); }
  .bm-ui .bm-home-search__mode { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 3px 8px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ui-muted); text-align: left; }
  .bm-ui .bm-home-search__mode svg { width: 18px; height: 18px; color: currentColor; }
  .bm-ui .bm-home-search__mode span { font-size: var(--bm-type-label); font-weight: var(--bm-weight-strong); }
  .bm-ui .bm-home-search__mode small { grid-column: 2; font-size: var(--bm-type-caption); font-weight: var(--bm-weight-body); color: var(--ui-muted); white-space: normal; }
  .bm-ui .bm-home-search__mode[aria-pressed=true] { color: var(--ui-accent-ink); border-color: var(--ui-accent); background: var(--ui-surface); }
  .bm-ui .bm-home-search__mode:hover { background: var(--ui-surface); }
  .bm-ui .bm-home-search__history { margin-top: 20px; }
  .bm-ui .bm-home-search__history > button { background: var(--ui-surface); border-color: var(--ui-line); border-radius: 8px; box-shadow: none; }
  .bm-ui .bm-home-search__history > button :is(span, svg) { color: var(--ui-muted); }
  .bm-ui .bm-home-search__suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .bm-ui .bm-home-search__suggestions > button { padding: 8px 12px; gap: 8px; border-color: var(--ui-line); border-radius: 8px; color: var(--ui-muted); background: var(--ui-surface); box-shadow: none; }
  .bm-ui .bm-home-search__suggestions > button > div { padding: 0; color: var(--ui-muted); background: transparent; }
  .bm-ui .bm-home-search__suggestions > button span { color: var(--ui-muted); font-size: var(--bm-type-caption); font-weight: var(--bm-weight-label); }
  .bm-ui .bm-home-search__suggestions > button:hover { color: var(--ui-accent-ink); border-color: var(--ui-accent); background: var(--ui-accent-soft); }
  .bm-ui .bm-home-search__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--ui-line); }
  .bm-ui .bm-home-search__links button { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--ui-muted); background: transparent; font-weight: var(--bm-weight-label); }
  .bm-ui .bm-home-search__links svg { width: 16px; height: 16px; }
  .bm-ui .bm-ai-home__answer > div { padding: 24px; border-color: var(--ui-line); background: var(--ui-surface); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
  .bm-ui .bm-ai-home__answer > div > .absolute { display: none; }
  .bm-ui .bm-ai-home__answer .text-lg { color: var(--ui-ink); font-size: var(--bm-type-body); font-weight: var(--bm-weight-body); }
  @media (max-width: 767px) {
    .bm-ui .bm-home-search__input-row { flex-wrap: wrap; padding: 12px; gap: 8px; }
    .bm-ui .bm-home-search__input-row textarea { flex-basis: 100%; }
    .bm-ui .bm-home-search__input-row > div { margin-left: auto; }
    .bm-ui .bm-home-search__modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bm-ui .bm-home-search__mode { padding: 10px 8px; }
    .bm-ui .bm-home-search__intro { margin-bottom: 16px; }
    .bm-ui .bm-ai-home__answer > div { padding: 16px; }
  }
  html.bm-ui[data-ui-mode=veteran] { --bm-type-page: 26px; --bm-type-section: 22px; --bm-type-card: 20px; --bm-type-body: 18px; --bm-type-label: 16px; --bm-type-caption: 14px; }
}
