@import url('/assets/icons/themes.css');

[data-access-denied] { display: none !important; }
.purchase-prices-denied .bom-price,
.purchase-prices-denied .bom-value { display: none !important; }
.topbar { justify-content: flex-start; gap: 14px; padding: 0 12px; flex-wrap: wrap; align-content: center; }
.topbar-legacy-summary { display: none; }
.topbar-actions { flex: 0 1 auto; min-width: 0; justify-content: flex-start; }
.topbar-actions > .save-files-menu { order: -10; }
.topbar-actions > .save-files-menu,
.topbar-actions > .measures-menu,
.topbar-actions > .language-menu,
.topbar-actions > .refresh-project-button { flex: 0 0 auto; }
.topbar-actions > .save-files-menu > summary,
.topbar-actions > .measures-menu > summary,
.topbar-actions > .language-menu > summary,
.topbar-actions > .refresh-project-button { width: auto; min-width: 85px; }
.topbar-actions > #themeToggle { min-width: 106px; }
.topbar > .app-info-menu { flex: 0 0 auto; margin-left: auto; }
.save-files-menu > .save-files-panel { left: 0; right: auto; }
.command-status-row { align-items: center; flex: 1 1 240px; gap: 7px; min-width: 0; }
.command-status-row:not(.has-export-target):not(.has-document-task):not(:has(.command-status[data-mode="progress"])):not(:has(#exportStopButton:not([hidden]))) { display: none; }
.command-status-row.has-document-task { flex-wrap: wrap; }
.command-status-row.has-document-task .command-status { flex: 1 1 240px; white-space: normal; overflow-wrap: anywhere; }
.command-status-row .document-ready { height: auto; min-height: 19px; white-space: normal; max-width: 100%; }
.command-status-row .command-status { display: block; margin: 0; font-size: 10px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.command-status-row button { margin: 0; }
.viewer-feedback { position: absolute; bottom: 0; left: 0; right: 0; z-index: 6; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }
.viewer-feedback .hint { position: static; width: auto; max-width: none; margin: 0; padding: 4px 10px; border: 0; border-radius: 0; background: transparent; font-size: 10px; line-height: 14px; }
.message-history { height: 22px; padding: 2px 10px; overflow: hidden; border-top: 1px solid var(--line); box-sizing: border-box; outline-offset: -2px; font-size: 10px; line-height: 18px; background: var(--panel); }
.message-history.is-expanded { height: 76px; overflow-y: auto; scrollbar-gutter: stable; }
.message-line { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; height: 18px; }
.message-line time { opacity: .65; font-variant-numeric: tabular-nums; }
.message-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-line[data-mode='error'] { color: #f07178; }
.message-line[data-mode='success'] { color: #279d78; }
.message-line[data-mode='progress'] { color: var(--text); }

.workspace-dialog { width: min(780px, calc(100vw - 28px)); max-height: min(640px, calc(100dvh - 28px)); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; font: 12px Arial, sans-serif; letter-spacing: 0; }
.workspace-dialog::backdrop { background: #0006; }
.workspace-dialog.has-steps-setup { width: min(1740px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); }
.steps-setup-scroll { max-height: calc(100dvh - 195px); overflow: auto; border: 1px solid var(--line); }
.steps-setup-table { border-collapse: separate; border-spacing: 0; min-width: 1330px; width: 100%; font: 12px Arial, sans-serif; font-variant-numeric: tabular-nums; }
.steps-setup-table th, .steps-setup-table td { padding: 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.steps-setup-table thead { position: sticky; top: 0; z-index: 1; background: var(--panel2); }
.steps-setup-table th { text-align: center; font-weight: 500; }
.steps-setup-table td { background: var(--panel); }
.steps-setup-table .steps-setup-alternate td { background: var(--panel2); }
.steps-setup-table td:has(input:checked) { background: color-mix(in srgb, #269f90 22%, var(--panel)); }
.steps-setup-table label { justify-content: center; cursor: pointer; min-height: 20px; }
.steps-setup-table td.steps-setup-below-minimum { color: #ef4444; }
body[data-theme='day'] .steps-setup-table td.steps-setup-below-minimum { color: #c62828; }
.steps-setup-table label:has(input:disabled) { color: var(--muted); cursor: default; }
.steps-setup-table td.steps-setup-notices { min-width: 255px; max-width: 330px; text-align: left; white-space: pre-line; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .steps-setup-table td.steps-setup-notices { width: 175px; min-width: 175px; max-width: 175px; }
}
.steps-setup-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.steps-setup-actions [role='status'] { flex: 1; color: var(--muted); }
.workspace-dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.workspace-dialog h2 { margin: 0; font-size: 15px; font-weight: 500; }
.workspace-dialog button { min-height: 28px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--text); font: bold 11px Arial, sans-serif; cursor: pointer; }
.workspace-dialog button:disabled { opacity: .45; cursor: default; }
.workspace-dialog button:hover:not(:disabled) { border-color: #269f90; }
.workspace-dialog :focus-visible { outline: 2px solid #269f90; outline-offset: 2px; }
.workspace-preferences-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 365px; }
.workspace-preferences-tabs { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-right: 1px solid var(--line); background: var(--panel2); }
.workspace-preferences-tabs button { font-weight: 400; text-align: left; padding: 10px; white-space: normal; overflow-wrap: anywhere; }
.workspace-preferences-tabs [aria-selected='true'] { border-color: #269f90; background: color-mix(in srgb, #269f90 15%, var(--panel)); }
.workspace-preferences-panels { min-width: 0; padding: 16px; max-height: calc(100dvh - 110px); overflow: auto; }
.workspace-preferences-panels > section { padding: 0; border: 0; background: transparent; border-radius: 0; box-shadow: none; }
.workspace-preferences-panels > section[hidden] { display: none; }
.workspace-preferences-panels > section > * { margin-bottom: 12px; }
.workspace-preferences-panels .preferences-choice-submenu { display: flex !important; flex-wrap: wrap; position: static !important; min-width: 0; width: auto; max-height: 200px; overflow-y: auto; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; gap: 6px; padding: 7px 0; background: transparent; }
.workspace-preferences-panels .preferences-choice-submenu button { width: auto; }
.workspace-preferences-panels .preferences-choice-menu > button { background: transparent; padding-left: 0; border: 0; text-align: left; font-weight: 400; display: flex; justify-content: space-between; width: 100%; }
.workspace-preferences-panels .preferences-choice-menu > button::after { content: none; }
.workspace-preferences-panels .preferences-choice-menu strong { font-weight: 400; color: var(--muted); }
.workspace-preferences-panels #templatesMenu .preferences-choice-submenu { flex-direction: column; align-items: flex-start; }
.workspace-preferences-panels label { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 12px; }
.workspace-dialog input:not([type='checkbox']), .workspace-dialog select { min-width: 0; width: 100%; box-sizing: border-box; padding: 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); background: var(--field); font: 12px Arial, sans-serif; }
.workspace-dialog input[type='checkbox'] { width: 15px; height: 15px; margin: 0; accent-color: #269f90; flex: 0 0 auto; }
.workspace-preferences-panels .demo-preference-row { min-height: 32px; gap: 10px; }
.demo-preference-caption { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.demo-preference-value { width: 28px; flex: 0 0 28px; text-align: right; color: var(--muted); }
.demo-preference-separator { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
[data-demo-project][hidden] { display: none !important; }
.workspace-preferences-panels .preferences-number-row input { width: 80px; }
.access-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
.access-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.access-editor { display: grid; gap: 12px; }
.access-editor > select { max-width: 100%; }
.access-user-form { display: grid; gap: 10px; }
.workspace-preferences-panels .access-user-form > label { display: grid; grid-template-columns: 110px minmax(0,1fr); }
.access-permission-list { display: grid; gap: 10px; margin-bottom: 16px; }
.access-editor-status, .access-login [role='alert'] { font-size: 11px; color: #dd686d; overflow-wrap: anywhere; }
.access-login { width: min(360px, calc(100vw - 28px)); padding: 20px; }
.access-login-required::backdrop { background: rgba(92, 96, 101, .82); }
.access-login { box-sizing: border-box; }
.access-login form { display: grid; gap: 14px; }
.access-login label { display: grid; gap: 5px; }
.access-login [hidden] { display: none !important; }
.access-login .access-approval-status { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text); }
.access-login footer { display: flex; justify-content: flex-end; gap: 8px; }

/* The raster includes the outline. Never recenter a glyph independently. */
img[src*='/assets/icons/day/'], img[src*='/assets/icons/night/'] { object-fit: contain; filter: none !important; vertical-align: middle; }
.view-home, body[data-theme='day'] .view-home, .app-info-toggle, .flight-add-button { padding: 0 !important; border: 0 !important; background: transparent !important; display: grid; place-items: center; aspect-ratio: 1; line-height: 0; }
.mobile-info-toggle { padding: 0 !important; border: 0 !important; background: transparent !important; }
.view-home img, .app-info-toggle img, .mobile-info-toggle img { width: 100%; height: 100%; margin: 0; display: block; }
.flight-add-button { width: 24px; height: 24px; flex: 0 0 24px; }
.flight-add-button::before { inset: 0; width: 100%; height: 100%; transform: none; mask: none; -webkit-mask: none; background: var(--icon-flight-add) center / contain no-repeat; }
.flight-add-button:focus-visible, .view-home:focus-visible, .app-info-toggle:focus-visible { outline: 2px solid #269f90; outline-offset: 2px; }
.flight-add-button:hover { filter: drop-shadow(0 0 2px #269f90); }
.browser-toggle::before { transform: scaleX(-1); }
.browser-toggle[aria-expanded='true']::before { transform: none; }
.landing-geometry-rotate-button::before, .view-cube .view-roll-left::before, .view-cube .view-roll-right::before { mask: none; -webkit-mask: none; inset: 0; width: 100%; height: 100%; background: center / contain no-repeat; }
.landing-geometry-rotate-left::before, .view-cube .view-roll-left::before { background-image: var(--icon-view-rotate-ccw); }
.landing-geometry-rotate-right::before, .view-cube .view-roll-right::before { background-image: var(--icon-view-rotate-cw); }
/* The PNGs share a black outline; use their alpha as a theme-aware silhouette. */
.view-cube .view-roll-left::before, .view-cube .view-roll-right::before {
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.view-cube .view-roll-left::before { -webkit-mask-image: var(--icon-view-rotate-ccw); mask-image: var(--icon-view-rotate-ccw); }
.view-cube .view-roll-right::before { -webkit-mask-image: var(--icon-view-rotate-cw); mask-image: var(--icon-view-rotate-cw); }
#workspacePreferences { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); margin: 0; z-index: 2000; }
#workspacePreferences[open] { display: flex; flex-direction: column; overflow: hidden; }
#workspacePreferences > header { flex: 0 0 auto; }
#workspacePreferences .workspace-preferences-body { min-height: 0; overflow: hidden; flex: 1 1 auto; }
#workspacePreferences .workspace-preferences-panels { min-height: 0; max-height: none; }
#workspacePreferences > header { cursor: move; touch-action: none; }
.png-close { font-size: 0 !important; background: var(--icon-close) center / 14px 14px no-repeat !important; }
.direction-icon { font-size: 0; background: var(--icon-direction-ccw) center / contain no-repeat; }
.direction-icon.clockwise { transform: translateY(-50%); background-image: var(--icon-direction-cw); }
@media (max-width: 720px) {
    .preferences-modal { padding: 8px; }
    .preferences-dialog { max-height: calc(100dvh - 16px); }
    .preferences-header { flex-wrap: wrap; padding: 4px 16px 10px; gap: 8px; }
    .spacemouse-preferences { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
    .spacemouse-axis-headings, .spacemouse-axis-row { grid-template-columns: 44px 44px minmax(0, 1fr) 52px; gap: 6px; }
    .spacemouse-master-speed { margin: 0 8px; padding: 8px; grid-template-columns: 50px minmax(0, 1fr) 42px; gap: 6px; }
    .preferences-footer { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
    .preferences-actions { flex-wrap: wrap; }
}
/* The native picker keeps keyboard/mobile behavior while allowing PNG options. */
@supports (appearance: base-select) {
    .direction-control select,
    .direction-control select::picker(select) { appearance: base-select; }
    .direction-control select { display: flex; align-items: center; padding-right: calc(10px * var(--menu-density)); }
    .direction-control select::picker-icon { margin-left: auto; padding-left: calc(48px * var(--menu-density)); }
    .direction-control select::picker(select) {
        color: var(--text); background: var(--field); border: 1px solid var(--line);
        border-radius: 4px; padding: 3px;
    }
    .direction-control option {
        display: flex; align-items: center; gap: 8px; padding: 6px 9px;
        font: inherit; font-weight: 400; white-space: nowrap;
    }
    .direction-control option::before {
        content: ''; display: block; flex: 0 0 16px; width: 16px; height: 16px;
        background: var(--icon-direction-ccw) center / contain no-repeat;
    }
    .direction-control option[value='Clockwise']::before { background-image: var(--icon-direction-cw); }
    .direction-control option::checkmark { order: 2; margin-left: auto; }
    .direction-control option:checked,
    .direction-control option:hover { background: color-mix(in srgb, #269f90 16%, var(--field)); }
}
.bom-price-button-face, .bom-catalog-setup-button, .bom-fold-toggle { padding: 0 !important; border: 0 !important; background: transparent !important; }
.bom-price-button-face img, .bom-catalog-setup-button img, .bom-fold-toggle img { width: 100%; height: 100%; object-fit: contain; margin: 0; }
.bom-prices-toggle input:checked + .bom-price-button-face { outline: 1px solid #269f90; outline-offset: 1px; }
.browser-toggle { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; }
.browser-toggle::before { width: 100%; height: 100%; mask: none; -webkit-mask: none; background: var(--icon-bom-panel-button) center / contain no-repeat; }
@media (max-width: 900px) {
    body:has(.command-status-row.has-export-target), body:has(#exportStopButton:not([hidden])) { --mobile-topbar-height: 96px; }
    body:has(.command-status-row.has-document-task) { --mobile-topbar-height: 144px; }
    .topbar:has(.has-document-task) { grid-template-columns: minmax(0, 1fr) auto; }
    .topbar:has(.has-document-task) > .topbar-actions { grid-column: 1; grid-row: 1; }
    .topbar:has(.has-document-task) > .app-info-menu { grid-column: 2; grid-row: 1; }
    .topbar > .command-status-row.has-document-task { grid-column: 1 / -1; grid-row: 2; width: 100%; padding-left: 34px; }
    .view-cube { top: calc(var(--mobile-topbar-height) + 8px); }
    .view-home { left: 8px; top: 28px; }
    .view-cube-mode-row { top: 84px; }
    .view-cube-secondary { top: 104px; }
    .topbar { gap: 4px; padding: 4px 8px; }
    .topbar-actions { justify-content: flex-start; }
    .topbar-actions > .save-files-menu > summary, .topbar-actions > .measures-menu > summary, .topbar-actions > .language-menu > summary, .topbar-actions > .refresh-project-button { min-width: 62px; }
    .topbar-actions > #themeToggle { min-width: 78px; }
    .command-status-row { flex-basis: 100%; }
    .viewer-feedback .hint { padding: 3px 8px; font-size: 9px; line-height: 12px; }
    .workspace-preferences-body { grid-template-columns: 116px minmax(0,1fr); }
    .workspace-preferences-tabs { padding: 6px; }
    .workspace-preferences-tabs button { padding: 8px 5px; }
    .workspace-preferences-panels { padding: 10px; }
    .workspace-preferences-panels .access-user-form > label { grid-template-columns: 1fr; }
}
