/* Screen-only presentation layer. Do not change model, export or print styling. */
.dw-ui, .dw-legacy-return, .dw-legacy-return[hidden], .dw-section-close { display: none; }
.dw-station-basics { display: contents; }
.dw-station-added-heading { display: none; }
@media screen {
  body.dw-enabled {
    --primary: #137766; --primary-hover: #0e6154; --primary-light: #e9f4ef;
    --secondary: #137766; --bg-color: #f0f4f6; --sidebar-bg: #fff; --bg-input: #fff;
    --text-main: #293f49; --text-muted: #667d87; --border: #dce5e9;
    --dw-rail: 176px; --dw-panel: 340px; --dw-head: 72px;
    display: grid; grid-template-columns: var(--dw-rail) var(--dw-panel) minmax(0, 1fr);
    grid-template-rows: var(--dw-head) minmax(0, 1fr); height: 100vh; height: 100dvh;
    width: 100%; position: relative; overflow: hidden; font-family: 'Segoe UI', 'Noto Sans TC', system-ui, sans-serif;
    color: var(--text-main); background: var(--bg-color); font-size: 16px;
  }
  .dw-enabled .dw-ui { box-sizing: border-box; }
  .dw-enabled .dw-ui button { font: inherit; cursor: pointer; }
  .dw-enabled .dw-ui svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .dw-enabled .dw-ui button:focus-visible, .dw-enabled #sidebar :is(input, select, button, summary, a):focus-visible { outline: 3px solid #70b4ce; outline-offset: 3px; }
  .dw-enabled .dw-topbar { display: flex; grid-column: 1 / -1; grid-row: 1; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--border); background: #fff; z-index: 50; min-width: 0; }
  .dw-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
  .dw-brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #137766; color: white; }
  .dw-brand strong { display: block; font-size: 21px; letter-spacing: .04em; }
  .dw-brand div > span { display: block; color: #748993; font-size: 12px; margin-top: 2px; }
  .dw-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 24px; border-left: 1px solid #dce5e9; font-size: 14px; color: #5c7380; }
  .dw-top-actions { display: flex; gap: 8px; margin-left: auto; flex: 0 0 auto; }
  .dw-enabled .dw-top-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 13px; border-radius: 8px; background: white; border: 1px solid #dce5e9; color: #566f7b; font-size: 14px; white-space: nowrap; }
  .dw-enabled .dw-top-actions .dw-review-button { background: #137766; border-color: #137766; color: white; }
  .dw-enabled .dw-top-actions .dw-search-toggle { width: 42px; padding: 8px; }
  .dw-enabled .dw-navigation { display: flex; grid-column: 1; grid-row: 2; flex-direction: column; gap: 18px; min-height: 0; padding: 24px 12px 18px; background: #f7f9fa; border-right: 1px solid #dce5e9; z-index: 40; }
  .dw-nav-label { padding: 0 10px; color: #738894; font-size: 13px; letter-spacing: .12em; }
  .dw-nav-items { display: flex; flex-direction: column; gap: 7px; }
  .dw-enabled .dw-nav-item { display: flex; align-items: center; gap: 10px; padding: 16px 10px; width: 100%; min-height: 68px; border: 1px solid transparent; background: transparent; border-radius: 10px; color: #617780; text-align: left; font-size: 15px; }
  .dw-nav-item span { font-weight: 600; white-space: nowrap; }
  .dw-nav-item small { margin-left: auto; font-size: 12px; color: #8ea0a8; }
  .dw-enabled .dw-nav-item:hover { background: #edf4f1; }
  .dw-enabled .dw-nav-item.active { color: #137766; background: #fff; border-color: #cfe3db; box-shadow: 0 4px 14px #264d3b08; }
  .dw-nav-footer { margin-top: auto; border-top: 1px solid #dce5e9; padding: 17px 7px 0; color: #7a8f98; font-size: 12px; line-height: 1.8; }
  .dw-search-panel { position: relative; min-width: 0; }
  .dw-search-label { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 42px; border: 1px solid #d8e3e7; background: #fff; border-radius: 8px; }
  .dw-search-label svg { color: #7a929b; width: 17px !important; height: 17px !important; }
  .dw-search-label input { width: 100%; min-width: 0; border: 0; background: none; outline: 0; padding: 0; color: #294551; font: inherit; font-size: 14px; }
  .dw-search-results { position: absolute; top: 49px; left: 0; width: 290px; max-width: calc(100vw - 32px); max-height: min(480px, 65dvh); overflow: auto; background: #fff; border: 1px solid #d4e2e7; border-radius: 10px; box-shadow: 0 12px 30px #203f4b21; z-index: 60; }
  .dw-search-results[hidden] { display: none; }
  .dw-enabled .dw-search-result { display: block; width: 100%; border: 0; border-bottom: 1px solid #edf1f3; padding: 13px; background: #fff; color: #294551; font-size: 14px; text-align: left; }
  .dw-enabled .dw-search-result:hover { background: #ecf5f1; }
  .dw-search-result small { display: block; margin-top: 4px; color: #738893; font-size: 12px; }
  .dw-search-empty { margin: 14px; line-height: 1.7; font-size: 14px; color: #6a818d; }
  .dw-enabled #sidebar { grid-column: 2; grid-row: 2; width: auto; height: auto; min-height: 0; overflow: hidden; box-shadow: none; padding: 0; border-right: 1px solid var(--border); z-index: 20; background: white; }
  .dw-enabled .dw-panel-heading { display: block; flex: 0 0 auto; order: 0; padding: 16px 16px 10px; border-bottom: 1px solid #e5ecef; }
  .dw-heading-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .dw-heading-line h2 { font-size: 18px; margin: 0; letter-spacing: .01em; font-weight: 600; }
  .dw-step { font-size: 12px; color: #568777; border: 1px solid #dbe8e2; background: #f5f9f7; padding: 4px 6px; border-radius: 5px; }
  .dw-panel-heading p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: #758995; }
  .dw-table-context { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
  .dw-panel-heading[data-dual-table="false"] .dw-table-context { display: none; }
  .dw-table-context > span { font-size: 12px; color: #7c919a; white-space: nowrap; }
  .dw-enabled #table-switcher { flex: 1; gap: 6px !important; margin: 0 !important; min-width: 0; }
  .dw-enabled #table-switcher button { min-height: 38px; padding: 7px 9px !important; font-size: 14px !important; border-radius: 7px !important; }
  .dw-panel-heading[data-quote-unavailable="true"]::after { content: '此帳號不顯示報價工具，案件儲存與現場照仍可依原權限操作。'; display: block; margin-top: 14px; padding: 10px; background: #f4f7f9; font-size: 13px; line-height: 1.7; color: #617987; border-radius: 7px; }
  .dw-enabled #form-container { order: 2; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px 18px; scrollbar-width: thin; scrollbar-color: #cedce1 transparent; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .dw-enabled .dw-filtered { display: none !important; }
  .dw-enabled #sidebar details.main-section { margin: 0 0 8px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
  .dw-enabled #sidebar details.main-section > summary { box-sizing: border-box; min-height: 44px; font-size: 14px; font-weight: 600; padding: 7px 0; margin: 0 0 6px; border: 0; border-bottom: 1px solid #dce5e9; color: #4d6875; background: none; }
  .dw-enabled #sidebar details.main-section:not([open]) > summary { margin-bottom: 0; }
  .dw-enabled #form-container summary { transition: color .15s, background-color .15s; }
  .dw-enabled #form-container details > summary::after { content: '›'; transform: none; flex-shrink: 0; font-size: 18px; line-height: 1; opacity: .65; }
  .dw-enabled #form-container details[open] > summary::after { transform: rotate(90deg); }
  .dw-enabled #sidebar .dw-basic-section > summary { display: none; }
  .dw-enabled #sidebar .details-content { padding: 0; }
  .dw-enabled #sidebar .form-group { min-width: 0; margin-bottom: 10px; }
  .dw-enabled #sidebar label { font-size: 13px; font-weight: 500; color: #516c79; line-height: 1.45; }
  .dw-enabled #sidebar .dw-env-gas { color: #a64b3e !important; }
  .dw-enabled #sidebar .dw-env-water { color: #326da0 !important; }
  .dw-enabled #sidebar .dw-env-drain { color: #26765c !important; }
  .dw-enabled #sidebar :is(input:not([type="range"]):not([type="checkbox"]), select, textarea) { box-sizing: border-box; min-width: 0; max-width: 100%; min-height: 38px; padding: 6px 8px; color: #294551; background: #fff; border: 1px solid #d6e1e7; border-radius: 5px; font-size: 14px; box-shadow: none; }
  .dw-enabled #sidebar input[id^="num-"] { width: 72px !important; padding: 6px !important; font-weight: 500; }
  .dw-enabled #sidebar input[type="range"] { accent-color: #137766; min-height: 26px; margin: 2px 0 0; }
  .dw-enabled #sidebar input[type="checkbox"] { width: 19px; height: 19px; flex: 0 0 auto; accent-color: #137766; }
  .dw-enabled #sidebar input::placeholder { color: #7a8e98 !important; }
  .dw-enabled #sidebar .checkbox-group { box-sizing: border-box; min-height: 36px; gap: 8px; margin-bottom: 4px; }
  .dw-enabled #sidebar .checkbox-group > label { display: flex; align-items: center; min-height: 36px; margin: 0; }
  .dw-enabled #sidebar .row-2 { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-enabled #sidebar .range-header { align-items: center; gap: 8px; }
  .dw-enabled #sidebar .range-header label { min-width: 0; }
  .dw-enabled #sidebar .range-header > label { margin-bottom: 0; }
  .dw-enabled #sidebar #param-depth + div { margin-top: 2px !important; font-size: 12px !important; line-height: 1.5; font-weight: 400 !important; color: #667d87; }
  .dw-enabled #sidebar #param-depth + div > span { font-size: inherit !important; }
  /* Compact rows retain the original controls, including their conditional display rules. */
  .dw-enabled #table-config-section { margin-bottom: 8px !important; }
  .dw-enabled #table-config-section > .checkbox-group,
  .dw-enabled #sidebar .dw-basic-section > .details-content > .checkbox-group { min-height: 44px; padding: 0 !important; margin: 0 0 4px !important; background: transparent !important; border: 0 !important; border-bottom: 1px solid #edf1f3 !important; border-radius: 0 !important; }
  .dw-enabled #table-config-section > .checkbox-group > span,
  .dw-enabled #sidebar .dw-basic-section > .details-content > .checkbox-group > label { font-weight: 500 !important; font-size: 13px; }
  .dw-enabled #table-config-hint { font-size: 12px !important; line-height: 1.5; }
  .dw-enabled #sidebar button { min-height: 40px; }
  .dw-enabled #sidebar #stations-container > details { border: 0 !important; border-bottom: 1px solid #e0e8e8 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin-bottom: 0 !important; }
  .dw-enabled #sidebar #stations-container > details[open] { border-bottom-color: #bbd7cc !important; }
  .dw-enabled #sidebar #stations-container > details > summary { box-sizing: border-box; min-height: 44px; padding: 7px 2px !important; margin: 0 !important; border: 0 !important; border-radius: 0; color: #375e59 !important; font-size: 14px; font-weight: 500 !important; background: transparent; }
  .dw-enabled #sidebar #stations-container > details[open] > summary { color: #137766 !important; font-weight: 600 !important; }
  .dw-enabled #sidebar #stations-container > details > .details-content { padding: 4px 0 8px; }
  .dw-enabled #sidebar .purpose-display { flex: 1; min-width: 0; margin-left: 8px !important; font-size: 12px !important; overflow-wrap: anywhere; }
  .dw-enabled #sidebar :is(.station-faucet-controls, #roof-settings, #hood-settings, #exhaust-settings, #chimney-settings, #side-chimney-options) { min-width: 0; padding: 8px 10px !important; margin-top: 4px !important; margin-bottom: 8px !important; background: #f7faf9 !important; border: 0 !important; border-left: 2px solid #dce9e3 !important; border-radius: 0 !important; box-shadow: none !important; }
  /* Quiet grouping inside an expanded station; collapsed rows stay compact. */
  .dw-enabled #sidebar #stations-container .dw-station-group { box-sizing: border-box; min-width: 0; padding: 9px 10px !important; margin: 0 0 8px !important; background: #f3f6f8 !important; border: 1px solid #e2e8eb !important; border-radius: 7px !important; box-shadow: none !important; }
  .dw-enabled #sidebar #stations-container .dw-station-basics { display: block; background: #eff6f3 !important; border-color: #dce9e2 !important; }
  .dw-enabled #sidebar #stations-container .section.dw-station-group { background: #f6f7f4 !important; border-color: #e5e8e0 !important; }
  .dw-enabled #sidebar #stations-container .dw-station-heading { display: block; margin: 0 0 7px !important; color: #48635e !important; font-size: 12px !important; font-weight: 600 !important; line-height: 1.5; letter-spacing: .03em; }
  .dw-enabled #sidebar #stations-container .dw-station-basics > .row-2:last-child .form-group,
  .dw-enabled #sidebar #stations-container .pot-settings > .row-2 .form-group,
  .dw-enabled #sidebar #stations-container .offset-settings > .form-group:last-child { margin-bottom: 0; }
  .dw-enabled #sidebar #stations-container .pot-settings > .row-2 { row-gap: 8px; }
  .dw-enabled #sidebar #stations-container .pot-settings > .row-2 + .row-2 { margin-top: 6px; }
  .dw-enabled #sidebar #stations-container .station-faucet-controls { background: #fff !important; border: 1px solid #e2e8e3 !important; border-radius: 5px !important; }
  .dw-enabled #sidebar :is(#roof-settings, #hood-settings, #exhaust-settings) label { color: #516c79 !important; }
  .dw-enabled #sidebar #quote-container { margin-top: 0 !important; }
  .dw-enabled #sidebar .quote-card { background: #f7faf9; border-color: #d5e5df; box-shadow: none; }
  .dw-enabled #sidebar .quote-title { font-size: 17px; color: #345d52; }
  .dw-enabled #sidebar .quote-total { color: #137766; }
  .dw-enabled #sidebar > .header { order: 3; flex: 0 0 auto; padding: 7px 22px 11px; border: 0; }
  .dw-enabled #sidebar > .header :is(h1, p) { display: none; }
  .dw-enabled #sidebar > .header > button { position: static !important; width: 100%; background: #fff !important; border: 1px solid #ead5d5 !important; color: #a44444 !important; box-shadow: none !important; justify-content: center; font-size: 14px !important; }
  .dw-enabled #sidebar #platform-sidebar-session { order: 1; flex: 0 0 auto; margin: 0 !important; padding: 10px 22px !important; border: 0 !important; border-bottom: 1px solid #e5ecef !important; background: #f8fafb !important; border-radius: 0 !important; box-shadow: none !important; color: #4a6571 !important; }
  .dw-enabled #platform-sidebar-session .platform-session-name { color: #435f6c !important; font-size: 13px !important; }
  .dw-enabled #platform-sidebar-session .platform-session-meta { font-size: 12px !important; color: #607987 !important; gap: 6px !important; }
  .dw-enabled #platform-sidebar-session .platform-session-status { color: #3e7d68 !important; overflow-wrap: anywhere; }
  .dw-enabled #platform-sidebar-session .platform-session-status[data-error="true"] { color: #b53c3c !important; }
  .dw-enabled #platform-sidebar-session .platform-session-role { color: #477364 !important; background: #eaf3ee !important; border-color: #d4e5da !important; font-size: 12px !important; }
  .dw-enabled #sidebar #platform-sidebar-actions { order: 4; flex: 0 0 auto; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; margin: 0 !important; padding: 12px 18px max(12px, env(safe-area-inset-bottom)) !important; border-top: 1px solid #dce5e9; background: #fff; }
  .dw-enabled #platform-sidebar-actions :is(.platform-photo-upload, .platform-session-actions) { display: contents !important; }
  .dw-enabled #platform-sidebar-actions .platform-photo-upload > span { display: none; }
  .dw-enabled #platform-sidebar-actions .platform-session-action { box-sizing: border-box; min-height: 42px; padding: 9px 8px !important; border: 1px solid #d9e4e8 !important; border-radius: 7px !important; font-size: 14px !important; color: #4c6977 !important; background: #fff !important; text-align: center; justify-content: center; }
  .dw-enabled #platform-sidebar-actions .platform-session-action.primary { background: #137766 !important; color: #fff !important; border-color: #137766 !important; }
  .dw-enabled #platform-sidebar-actions .platform-session-action.logout { grid-column: auto !important; color: #995050 !important; background: #fffafa !important; }
  .dw-enabled #platform-sidebar-actions [hidden] { display: none !important; }
  .dw-enabled #sidebar :disabled { cursor: not-allowed !important; opacity: .6; }
  .dw-enabled #canvas-wrapper { grid-column: 3; grid-row: 2; width: auto; height: auto; min-width: 0; min-height: 0; flex-grow: 0; }
  .dw-enabled #canvas-container { min-width: 0; min-height: 0; width: 100%; height: 100%; }
  .dw-enabled .dw-canvas-caption { display: flex; position: absolute; top: 22px; left: 24px; gap: 8px; flex-direction: column; color: #426575; pointer-events: none; z-index: 1000; }
  .dw-canvas-caption strong { font-size: 17px; font-weight: 600; }
  .dw-canvas-caption .dw-size { font-size: 13px; color: #6f8793; }
  .dw-enabled.platform-model-loading .dw-canvas-caption { display: none; }
  .dw-enabled .view-buttons { position: absolute; left: 16px; right: 16px; bottom: 16px; transform: none; width: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 7px; background: #ffffffee; border: 1px solid #dce5e9; border-radius: 10px; box-shadow: 0 5px 20px #24405212; backdrop-filter: blur(12px); z-index: 1100; }
  .dw-enabled .view-buttons button { width: auto; min-height: 38px; border: 1px solid transparent; background: transparent; color: #577380; font-size: 13px; line-height: 1.3; padding: 7px 9px; white-space: nowrap; word-break: normal; }
  .dw-enabled .view-buttons button.active { color: #137766; background: #e6f2ec; border-color: #c6dfd1; }
  .dw-enabled .view-buttons button[hidden] { display: none !important; }
  /* The toolbar wraps differently on every screen. Its measured top is the panel's floor. */
  .dw-enabled #section-panel { box-sizing: border-box; left: auto; right: 12px; bottom: var(--dw-toolbar-clearance, 174px); transform: none; width: min(360px, calc(100% - 24px)); max-height: calc(100% - var(--dw-toolbar-clearance, 174px) - 8px); min-height: 0; padding: 10px; gap: 6px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 10px; box-shadow: 0 5px 20px #24405226; }
  .dw-enabled #section-panel > * { flex-shrink: 0; }
  .dw-enabled #section-panel .dw-section-heading { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 1; background: #fff; min-height: 44px; padding: 0 !important; margin: 0 !important; font-size: 14px; }
  .dw-enabled #section-panel .dw-section-title { margin-right: auto; white-space: nowrap; }
  .dw-enabled #section-panel .dw-section-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px; border: 1px solid #d9e4e8; border-radius: 7px; background: #f4f8f7; color: #137766; font-family: inherit; font-size: 13px; line-height: 1.4; white-space: nowrap; }
  .dw-enabled #section-panel .dw-section-close:focus-visible { outline: 3px solid #70b4ce; outline-offset: -3px; }
  .dw-enabled #section-panel .checkbox-group { min-height: 44px; gap: 6px; margin: 0 !important; align-self: end; }
  .dw-enabled #section-panel .form-group { margin: 0; min-width: 0; }
  .dw-enabled #section-panel label { color: #516c79; font-size: 13px; line-height: 1.4; margin-bottom: 3px; white-space: nowrap; }
  .dw-enabled #section-panel .checkbox-group label { display: flex; align-items: center; min-height: 44px; margin-bottom: 0; cursor: pointer; }
  .dw-enabled #section-panel input[type="checkbox"] { width: 19px; height: 19px; flex-shrink: 0; accent-color: #137766; }
  .dw-enabled #section-panel select { box-sizing: border-box; width: 100%; min-height: 44px; padding: 6px 8px; background: #fff; color: #294551; border: 1px solid #d6e1e7; border-radius: 7px; font-size: 16px; }
  .dw-enabled #section-panel input[type="range"] { margin: 0; min-height: 36px; accent-color: #137766; }
  .dw-enabled #collision-banner { box-sizing: border-box; max-width: min(560px, calc(100vw - 32px)); left: auto; right: 16px; top: auto; bottom: 114px; transform: none; font-size: 14px; text-align: left; align-items: flex-start; }
  .dw-enabled #collision-text { max-height: min(112px, 20dvh); overflow-y: auto; overscroll-behavior: contain; white-space: normal; }
  .dw-enabled #collision-banner .material-icons { font-size: 0; flex: 0 0 18px; }
  .dw-enabled #collision-banner .material-icons::before { content: '!'; display: block; font: bold 18px/1.4 sans-serif; text-align: center; }
  .dw-enabled .dw-notice { display: block; position: fixed; z-index: 12000; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 13px 18px; background: #244f45; color: #fff; box-shadow: 0 6px 24px #132f3626; border-radius: 9px; max-width: min(520px, calc(100vw - 40px)); font-size: 14px; line-height: 1.7; opacity: 0; pointer-events: none; }
  .dw-enabled .dw-notice.visible { opacity: 1; }
  .dw-highlight { outline: 3px solid #66b8a1 !important; outline-offset: 4px; }
  .dw-legacy-return { display: block; position: fixed; z-index: 12000; right: 16px; top: 16px; padding: 10px 14px; border: 1px solid #8ebaaa; border-radius: 8px; background: #137766; color: white; font: 14px 'Segoe UI', sans-serif; cursor: pointer; box-shadow: 0 4px 12px #102e4226; }
  @media (min-width: 1600px) { body.dw-enabled { --dw-rail: 194px; --dw-panel: 368px; } }
  @media (min-width: 1025px) and (max-width: 1180px) {
    body.dw-enabled { --dw-rail: 112px; --dw-panel: 320px; }
    .dw-enabled .dw-navigation { padding: 20px 8px; }
    .dw-enabled .dw-nav-item { flex-direction: column; gap: 7px; padding: 12px 5px; font-size: 14px; }
    .dw-nav-item small, .dw-nav-label, .dw-nav-footer { display: none; }
    .dw-search-label { padding: 0 6px; gap: 4px; }
    .dw-search-label input { font-size: 13px; }
    .dw-enabled .dw-panel-heading, .dw-enabled #form-container { padding-left: 14px; padding-right: 14px; }
  }
  @media (max-width: 1024px) {
    body.dw-enabled { --dw-head: 64px; grid-template-columns: minmax(0, 1fr) 350px; grid-template-rows: var(--dw-head) auto minmax(0, 1fr); }
    .dw-enabled .dw-topbar { padding: 0 16px; gap: 12px; }
    .dw-project-name { display: none; }
    .dw-enabled .dw-navigation { grid-column: 1 / -1; grid-row: 2; padding: 7px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid #dce5e9; background: #fff; }
    .dw-nav-label, .dw-nav-footer { display: none; }
    .dw-nav-items { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; order: 0; }
    .dw-enabled .dw-nav-item { justify-content: center; min-height: 58px; gap: 8px; padding: 8px 4px; font-size: 14px; border-radius: 8px; }
    .dw-nav-item small { display: none; }
    .dw-enabled .dw-nav-item.active { background: #edf6f1; box-shadow: none; }
    .dw-search-panel { display: none; order: 1; }
    .dw-search-open .dw-search-panel { display: block; }
    .dw-search-results { width: 100%; max-width: none; }
    .dw-enabled #sidebar { grid-column: 2; grid-row: 3; border-left: 1px solid #dce5e9; border-right: 0; }
    .dw-enabled #canvas-wrapper { grid-column: 1; grid-row: 3; }
    .dw-enabled .dw-canvas-caption { left: 18px; top: 20px; }
    .dw-canvas-caption strong { font-size: 16px; }
    .dw-enabled #form-container { padding: 12px 16px 18px; }
    .dw-enabled .dw-panel-heading { padding: 14px 16px 10px; }
    .dw-enabled #sidebar :is(input:not([type="range"]):not([type="checkbox"]), select, textarea) { min-height: 44px; font-size: 16px; }
    .dw-enabled #sidebar button, .dw-enabled #platform-sidebar-actions .platform-session-action { min-height: 44px; }
    .dw-enabled #sidebar .checkbox-group, .dw-enabled #sidebar .checkbox-group > label { min-height: 44px; }
    .dw-enabled .view-buttons { left: 10px; right: 10px; bottom: 10px; gap: 3px; padding: 5px; }
    .dw-enabled .view-buttons button { min-height: 42px; padding: 7px; font-size: 13px; }
  }
  @media (min-width: 701px) and (max-width: 1024px) and (orientation: portrait) {
    body.dw-enabled { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px auto clamp(250px, 34dvh, 420px) minmax(0, 1fr); }
    .dw-enabled #canvas-wrapper { grid-column: 1; grid-row: 3; }
    .dw-enabled #sidebar { grid-column: 1; grid-row: 4; border-left: 0; border-top: 1px solid #dce5e9; }
    .dw-enabled .dw-panel-heading { padding-top: 14px; padding-bottom: 11px; }
    .dw-enabled .dw-table-context { margin-top: 10px; }
    .dw-enabled #sidebar #platform-sidebar-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 9px !important; padding-bottom: 9px !important; }
  }
  @media (max-width: 700px), (max-width: 1024px) and (max-height: 500px) {
    body.dw-enabled { position: fixed; inset: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px auto 44px minmax(0, 1fr); }
    .dw-enabled .dw-topbar { padding: 0 12px; gap: 8px; }
    .dw-brand { gap: 7px; }
    .dw-brand-mark { width: 28px; height: 28px; border-radius: 8px; }
    .dw-brand strong { font-size: 16px; }
    .dw-brand div > span { display: none; }
    .dw-top-actions { gap: 6px; }
    .dw-enabled .dw-top-actions button { min-height: 44px; padding: 7px; font-size: 12px; border-color: transparent; }
    .dw-enabled .dw-top-actions .dw-search-toggle { width: 44px; }
    .dw-enabled .dw-top-actions .dw-review-button { display: none; }
    .dw-enabled .dw-navigation { padding: 4px 6px; }
    .dw-nav-items { gap: 3px; }
    .dw-enabled .dw-navigation .dw-nav-item { flex-direction: column; gap: 2px; min-height: 50px; padding: 5px 1px; font-size: 12px; line-height: 1.4; transition: background-color .15s, border-color .15s, color .15s; }
    .dw-enabled .dw-nav-item svg { width: 17px; height: 17px; }
    .dw-nav-item span { font-weight: 500; letter-spacing: -.03em; }
    .dw-enabled .dw-mobile-modes { display: flex; grid-column: 1; grid-row: 3; gap: 0; background: #f4f8f7; border-bottom: 1px solid #d7e4e4; z-index: 25; }
    .dw-enabled .dw-mobile-modes button { display: flex; flex: 1; gap: 7px; align-items: center; justify-content: center; padding: 7px; min-height: 44px; border: 0; background: transparent; color: #6a818d; font-size: 14px; }
    .dw-enabled .dw-mobile-modes button[aria-pressed="true"] { background: #e3f0e9; color: #126957; box-shadow: inset 0 -2px #278b6e; font-weight: 600; }
    .dw-enabled .dw-mobile-modes svg { width: 18px; height: 18px; }
    .dw-enabled #sidebar, .dw-enabled #canvas-wrapper { grid-column: 1; grid-row: 4; width: 100%; height: 100%; min-height: 0; margin: 0; border: 0; }
    /* Keep the canvas measurable while editing so the original camera never gets a zero aspect ratio. */
    .dw-enabled[data-dw-view="settings"] #canvas-wrapper { visibility: hidden; pointer-events: none; }
    .dw-enabled[data-dw-view="model"] #sidebar { visibility: hidden; pointer-events: none; }
    .dw-enabled #sidebar { padding: 0; }
    /* The active category already names this view. Keep only a real dual-table selector. */
    .dw-enabled .dw-panel-heading { padding: 5px 12px; }
    .dw-enabled .dw-panel-heading[data-dual-table="false"][data-quote-unavailable="false"] { display: none; }
    .dw-enabled .dw-heading-line, .dw-enabled .dw-panel-heading > p, .dw-enabled .dw-table-context > span { display: none; }
    .dw-enabled .dw-table-context { margin-top: 0; }
    .dw-enabled .dw-panel-heading[data-quote-unavailable="true"]::after { margin-top: 4px; padding: 6px; font-size: 12px; }
    .dw-enabled #form-container { padding: 10px 12px 16px; }
    .dw-enabled #sidebar #table-switcher button { min-height: 44px; }
    /* Keep the live save/error status, but move duplicate account details into More. */
    .dw-enabled #sidebar #platform-sidebar-session { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 4px 14px !important; }
    .dw-enabled #platform-sidebar-session .platform-session-heading { flex: 1 1 auto; min-width: 0; margin: 0; }
    .dw-enabled #platform-sidebar-session .platform-session-person { gap: 6px; font-weight: 500; }
    .dw-enabled #platform-sidebar-session .platform-session-name { font-size: 12px !important; }
    .dw-enabled #platform-sidebar-session .platform-online-dot { width: 6px; height: 6px; box-shadow: none; }
    .dw-enabled #platform-sidebar-session .platform-session-role, .dw-enabled #platform-sidebar-session .platform-session-account { display: none; }
    .dw-enabled #platform-sidebar-session .platform-session-meta { flex: 0 1 auto; min-width: 0; max-width: 62%; margin: 0; font-size: 11px !important; }
    .dw-enabled #platform-sidebar-session .platform-session-status { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }
    .dw-enabled #sidebar #platform-sidebar-actions { position: relative; z-index: 70; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 56px; padding: 6px 10px max(6px, env(safe-area-inset-bottom)) !important; gap: 6px !important; }
    .dw-enabled #platform-sidebar-actions .platform-session-action { min-height: 44px; padding: 7px 6px !important; font-size: 13px !important; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; }
    .dw-enabled #platform-sidebar-actions .dw-more-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 8px; border: 1px solid #d9e4e8; border-radius: 7px; color: #4c6977; background: #fff; font-size: 13px; line-height: 1.4; white-space: nowrap; }
    .dw-enabled #platform-sidebar-actions .dw-more-toggle[aria-expanded="true"] { color: #137766; border-color: #9bc9b8; background: #edf6f1; }
    .dw-enabled #platform-sidebar-actions .dw-action-menu { display: grid; position: absolute; right: 10px; bottom: calc(100% + 4px); width: min(240px, calc(100vw - 24px)); max-height: min(300px, calc(100dvh - 214px)); overflow-y: auto; overscroll-behavior: contain; gap: 6px; padding: 10px; border: 1px solid #d7e4df; border-radius: 10px; background: #fff; box-shadow: 0 6px 24px #203f4b26; }
    .dw-enabled #platform-sidebar-actions .dw-action-menu[hidden] { display: none !important; }
    .dw-enabled .dw-account-detail { padding: 0 2px 4px; color: #687e88; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
    .dw-enabled .view-buttons { overflow: auto; max-height: 150px; justify-content: flex-start; }
    .dw-enabled .view-buttons .hide-mobile-btn { display: inline-flex !important; }
    .dw-enabled .view-buttons button { align-items: center; justify-content: center; min-height: 44px; font-size: 14px; padding: 8px 10px; }
    .dw-enabled .view-buttons > div.hide-mobile-btn { display: none !important; }
    .dw-enabled .view-buttons button[hidden] { display: none !important; }
    .dw-enabled #collision-banner { bottom: 164px; right: 12px; max-width: calc(100vw - 24px); }
  }
  @media (max-width: 700px) and (max-height: 670px) {
    .dw-enabled #form-container { padding-top: 10px; }
  }
  @media (max-width: 1024px) and (max-height: 500px) {
    body.dw-enabled { grid-template-rows: 48px auto 44px minmax(0, 1fr); }
    .dw-brand div > span, .dw-enabled .dw-nav-item svg { display: none; }
    .dw-enabled .dw-nav-item { min-height: 44px; }
    .dw-enabled #sidebar { overflow: hidden; }
    .dw-enabled #form-container { flex: 1 1 auto; overflow-y: auto; }
  }
  @media (prefers-reduced-motion: reduce) { .dw-enabled * { scroll-behavior: auto !important; } }
}
