/* CAD Viewer — Kewo Engineering Corporation.
 * Palette, typography, and app framing follow ETAP Viewer Rev 2 (2026-10-10).
 */
:root { color-scheme: light; --navy: #254775; --navy-deep: #1b3559; --navy-wash: #e9eef5; --ink: #1e2935; --ink-2: #4d5a68; --ink-3: #657382; --line: #d6dde6; --line-2: #e7ebf0; --page: #edf1f5; --panel: #fff; --focus: #2f6db5; --good: #217442; --warn: #926000; --crit: #b93434; --canvas: #151f2c; --font: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; --r: 6px; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; overflow: hidden; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.4; }
button, input, select { font: inherit; color: inherit; }
button, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--navy); }
.icon-defs, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 8px 12px; background: #fff; border: 1px solid var(--navy); border-radius: 4px; }
.skip-link:focus { top: 7px; }
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.icon.small { width: 14px; height: 14px; }
.appbar { height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 18px; color: #fff; background: var(--navy); }
.logo { height: 30px; width: 114px; object-fit: contain; flex: none; }
.app-name { border-left: 1px solid #ffffff4d; padding-left: 16px; line-height: 1.15; }
.app-name h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.app-name p { margin: 3px 0 0; font-size: 12px; color: #d0dced; }
.read-only-badge { font-size: 11px; letter-spacing: .025em; background: #ffffff12; border: 1px solid #ffffff33; border-radius: 12px; padding: 2px 9px; white-space: nowrap; }
.app-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r); padding: 6px 12px; font-size: 13.5px; line-height: 20px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); color: #fff; }
.btn-header-primary { color: var(--navy); border-color: #fff; font-weight: 600; }
.btn-header-primary:hover:not(:disabled) { background: #edf3fc; border-color: #edf3fc; }
.btn-ghost { background: transparent; color: #fff; border-color: #ffffff66; }
.btn-ghost:hover:not(:disabled) { background: #ffffff14; color: #fff; border-color: #fff; }
.btn-small { font-size: 12.5px; padding: 3px 9px; }
.workspace { height: calc(100% - 60px); display: grid; grid-template-columns: 256px minmax(0,1fr) 270px; }
.workspace.info-hidden { grid-template-columns: 256px minmax(0,1fr); }
.workspace.info-hidden .info-panel { display: none; }
.side { min-height: 0; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); overflow: auto; }
.sbox { padding: 15px 15px 13px; border-bottom: 1px solid var(--line-2); }
.sbox h2, .sbox h3 { display: flex; align-items: center; gap: 7px; font-size: 11.5px; line-height: 17px; letter-spacing: .075em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); margin: 0 0 10px; }
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.count { margin-left: auto; color: var(--ink-3); font-size: 11.5px; background: #f0f3f7; border-radius: 10px; padding: 0 6px; line-height: 18px; white-space: nowrap; }
.field-label { display: block; font-size: 12px; color: var(--ink-2); margin: 0 0 5px; }
.full-select { width: 100%; min-width: 0; background: #fff; border: 1px solid var(--line); padding: 7px 8px; border-radius: 5px; font-size: 13px; text-overflow: ellipsis; }
.full-select:disabled { background: #f7f9fb; color: var(--ink-3); }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.4; margin: 8px 0 0; }
.project-box .note { max-width: 210px; }
.layers-box { flex: 1; min-height: 205px; display: flex; flex-direction: column; padding-bottom: 0; }
.search-field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 6px 8px; color: var(--ink-3); }
.search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.search-field input { border: 0; outline: 0; width: 100%; min-width: 0; padding: 0; font-size: 13px; background: transparent; }
.search-field input::placeholder { color: #75818e; }
.layer-actions { display: flex; gap: 9px; align-items: center; padding: 9px 0; }
.layer-actions .note { margin: 0 auto 0 0; font-size: 11.5px; }
.text-button { padding: 2px 0; border: 0; background: transparent; color: var(--navy); font-size: 12px; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.layer-list { overflow-y: auto; min-height: 65px; flex: 1; margin: 0 -15px; padding: 0 0 10px; border-top: 1px solid var(--line-2); }
.list-empty { font-size: 12.5px; color: var(--ink-3); margin: 0; padding: 11px 0; }
.layer-list .list-empty { padding: 14px 15px; }
.layer-row { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 5px 15px; font-size: 12.5px; cursor: pointer; }
.layer-row:hover { background: #f0f4f9; }
.layer-row input { accent-color: var(--navy); margin: 0; width: 14px; height: 14px; flex: none; }
.layer-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; border: 1px solid #00000022; }
.layer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-total { font-variant-numeric: tabular-nums; margin-left: auto; color: var(--ink-3); font-size: 11px; }
.layer-row.off .layer-name { color: var(--ink-3); }
.xref-box { max-height: 220px; flex: none; overflow: auto; }
.xref-list { font-size: 12px; }
.xref-row { padding: 7px 0; border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; }
.xref-row:last-child { border-bottom: 0; }
.xref-name { display: block; font-weight: 600; }
.xref-path { color: var(--ink-3); font-size: 11px; }
.xref-status { font-size: 11px; }
.xref-status.resolved, .success { color: var(--good); }
.xref-status.missing, .warning { color: var(--warn); }
.side-footer { padding: 10px 15px; font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.privacy-dot { width: 5px; height: 5px; border-radius: 50%; background: #4d8761; }
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.canvas-bar { display: flex; align-items: center; gap: 8px; padding: 6px 9px; background: #fff; border-bottom: 1px solid var(--line); min-height: 43px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 2px; border-right: 1px solid var(--line-2); padding-right: 8px; }
.toolbar-end { margin-left: auto; border: 0; padding: 0; }
.icon-button, .tool-button { display: inline-flex; justify-content: center; align-items: center; gap: 5px; height: 29px; padding: 3px 7px; border: 1px solid transparent; border-radius: 5px; color: var(--ink-2); background: transparent; font-size: 12px; white-space: nowrap; }
.icon-button { width: 29px; padding: 0; }
.icon-button:hover:not(:disabled), .tool-button:hover:not(:disabled) { background: var(--navy-wash); color: var(--navy); }
.tool-button[aria-pressed="true"], .icon-button[aria-expanded="true"] { color: var(--navy); background: var(--navy-wash); }
.compact-select { border: 1px solid var(--line); border-radius: 5px; font-size: 12px; padding: 4px 5px; background: #fff; max-width: 114px; }
.zoom-readout { font-size: 11.5px; min-width: 38px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.canvas-wrap { min-height: 0; position: relative; flex: 1; overflow: hidden; background: var(--canvas); }
#cad-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; outline-offset: -3px; }
#cad-canvas canvas { display: block; }
.canvas-wrap[data-theme="light"] { --canvas: #f8fafc; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; pointer-events: none; background-image: radial-gradient(#ffffff0c 1px, transparent 1px); background-size: 24px 24px; }
.empty-card { max-width: 442px; width: 100%; padding: 26px 28px 0; text-align: center; background: #fff; border: 1px solid #d6dde6; border-radius: 10px; box-shadow: 0 14px 45px #00000025; overflow: hidden; pointer-events: auto; }
.drawing-symbol { width: 86px; height: 67px; margin: 0 auto 17px; }
.drawing-symbol svg { width: 100%; height: 100%; fill: none; stroke: var(--navy); stroke-width: 1.4; stroke-linejoin: round; }
.drawing-symbol .symbol-accent { stroke: #8096b2; stroke-width: .8; }
.empty-card h2 { margin: 0 0 9px; color: var(--navy); font-weight: 600; font-size: 23px; letter-spacing: -.02em; }
.empty-card > p { color: var(--ink-2); margin: 0 auto 19px; font-size: 14px; max-width: 330px; }
.row-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.drop-copy { font-size: 12px; color: var(--ink-3); margin: 11px 0 22px; }
.empty-card > .empty-tip { display: block; font-size: 12px; color: var(--ink-2); padding-top: 15px; border-top: 1px solid var(--line-2); line-height: 1.55; margin-bottom: 19px; }
.empty-tip .icon { width: 14px; height: 14px; margin-right: 3px; color: var(--ink-3); }
.empty-tip strong { font-weight: 600; }
.format-note { margin: 0 -28px; padding: 10px 14px; background: #f4f7fa; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 11px; }
.drop-overlay { position: absolute; z-index: 30; inset: 12px; border: 2px dashed #91b9ef; border-radius: 9px; background: #1b3559ee; color: #fff; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 13px; font-size: 18px; pointer-events: none; }
.drop-overlay .icon { width: 40px; height: 40px; stroke-width: 1; }
.busy-overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: #142134a6; }
.busy-card { display: flex; align-items: center; gap: 13px; padding: 17px 22px; background: #fff; border-radius: 8px; box-shadow: 0 8px 35px #0003; }
.spinner { width: 25px; height: 25px; border: 2px solid #dae4f0; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.measure-readout { position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 3px 12px #0002; font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
.statusbar { height: 27px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 10px; background: #fff; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11px; white-space: nowrap; }
#status-message { overflow: hidden; text-overflow: ellipsis; }
.coordinates { margin-left: auto; font-variant-numeric: tabular-nums; }
.info-panel { min-height: 0; overflow: auto; background: #fff; border-left: 1px solid var(--line); }
.info-heading { padding: 17px 16px 15px; border-bottom: 1px solid var(--line-2); }
.eyebrow { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.info-heading h2 { margin: 7px 0 10px; font-size: 17px; font-weight: 600; color: var(--navy); line-height: 1.3; overflow-wrap: anywhere; }
.badge { display: inline-block; background: var(--navy-wash); color: var(--navy); border-radius: 10px; font-size: 11px; padding: 1px 8px; }
.badge.success { background: #e5f2e8; color: #216139; }
.badge.warning { background: #fff3d9; color: #815600; }
.badge.error { background: #fbe7e7; color: #a22f2f; }
.drawing-info { margin: 0; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 7px 12px; font-size: 12px; }
.drawing-info dt { color: var(--ink-3); }
.drawing-info dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.diagnostics-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 12px; }
.diagnostic { margin: 0 0 8px; padding: 8px 9px; background: #f3f6f9; border-left: 2px solid #b6c8dd; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.diagnostic.warning { background: #fff8e9; border-color: #d7a94b; color: #805514; }
.diagnostic.error { background: #fbeeee; border-color: #c76262; color: #992e2e; }
.viewer-hints dl { display: grid; grid-template-columns: 48px 1fr; gap: 5px 8px; margin: 0 0 15px; font-size: 12px; }
.viewer-hints dt { color: var(--ink); font-weight: 600; }
.viewer-hints dd { margin: 0; color: var(--ink-3); }
.revision { padding: 14px 15px; color: var(--ink-3); font-size: 10px; line-height: 1.65; letter-spacing: .02em; margin: 0; }
.help-dialog { width: min(610px, calc(100vw - 32px)); max-height: 87vh; border: 1px solid var(--line); border-radius: 10px; padding: 0; color: var(--ink); box-shadow: 0 20px 80px #14233855; }
.help-dialog::backdrop { background: #14233880; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--navy); }
.dialog-content { padding: 7px 22px 16px; }
.dialog-content h3 { font-size: 14px; color: var(--navy); margin: 16px 0 6px; font-weight: 600; }
.dialog-content p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.dialog-footer { padding: 11px 22px; border-top: 1px solid var(--line); color: var(--ink-3); background: #f6f8fb; font-size: 11.5px; }
.noscript-note { position: fixed; z-index: 100; bottom: 35px; left: 50%; transform: translateX(-50%); background: #fff3d9; padding: 15px; border: 1px solid #b3822a; border-radius: 6px; }
@media (max-width: 1280px) { .workspace { grid-template-columns: 230px minmax(0,1fr) 245px; } .workspace.info-hidden { grid-template-columns: 230px minmax(0,1fr); } .canvas-bar { gap: 5px; } .toolbar-group { padding-right: 5px; } .tool-button { padding: 3px 5px; } .zoom-readout { display: none; } }
@media (max-width: 1050px) { .workspace { grid-template-columns: 226px minmax(0,1fr); position: relative; } .info-panel { position: absolute; z-index: 20; right: 0; top: 43px; bottom: 27px; width: 270px; box-shadow: -6px 0 24px #15233522; } .workspace.info-hidden { grid-template-columns: 226px minmax(0,1fr); } .read-only-badge { display: none; } .appbar { gap: 13px; padding: 0 12px; } .btn { padding: 5px 10px; } }
@media (max-width: 720px) { .appbar { height: 100px; flex-wrap: wrap; align-content: center; gap: 10px 12px; padding: 8px 12px; } .logo { width: 100px; height: 26px; } .app-name { padding-left: 12px; } .app-name h1 { font-size: 17px; } .app-name p { font-size: 11px; } .app-actions { width: 100%; margin: 0; } .app-actions .btn { flex: 1; font-size: 12px; padding: 3px 7px; } .app-actions .btn .icon { width: 14px; height: 14px; } .workspace, .workspace.info-hidden { height: calc(100% - 100px); grid-template-columns: 185px minmax(0,1fr); } .sbox { padding: 12px 10px; } .layer-list { margin: 0 -10px; } .layer-row { padding: 5px 10px; } .layer-list .list-empty { padding: 12px 10px; } .side-footer { padding: 10px; font-size: 10px; } .canvas-bar { padding: 5px; gap: 4px; } .toolbar-group { border: 0; padding-right: 0; } .toolbar-end { margin-left: 0; } .tool-button span { display: none; } .compact-select { max-width: 105px; font-size: 11px; } .empty-state { padding: 12px; } .empty-card { padding: 20px 15px 0; } .empty-card h2 { font-size: 20px; } .empty-card > p { font-size: 12.5px; } .drawing-symbol { width: 68px; height: 53px; } .format-note { margin: 0 -15px; font-size: 10px; } .empty-tip { display: none !important; } .coordinates, #entity-count { display: none; } .info-panel { top: 79px; max-width: 100%; } }
@media (max-width: 470px) { .workspace, .workspace.info-hidden { grid-template-columns: 145px minmax(0,1fr); } .side .sbox { padding: 11px 8px; } .sbox h2 { font-size: 10px; letter-spacing: .02em; } .section-heading { gap: 3px; } .count { font-size: 10px; padding: 0 4px; } .section-heading .icon { display: none; } .full-select { padding: 5px 4px; font-size: 11px; } .project-box .note, .side-footer { display: none; } .layer-actions { flex-wrap: wrap; gap: 3px 9px; } .layer-actions .note { width: 100%; } .search-field { padding: 5px; } .search-field input { font-size: 11px; } .search-field .icon { width: 13px; height: 13px; } .empty-state { padding: 8px; } .empty-card { padding: 16px 10px 0; } .drawing-symbol { display: none; } .empty-card h2 { font-size: 18px; } .row-buttons .btn { width: 100%; font-size: 12px; } .empty-card .drop-copy { font-size: 11px; } .format-note { margin: 0 -10px; } .xref-box { max-height: 155px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
/* The embedded engine supplies editing UI by default. This host is view-only. */
#cad-canvas .ml-cli-container,
#cad-canvas .ml-ui-shortcut-toolbar-shell,
#cad-canvas .ml-mobile-cmd,
#cad-canvas .ml-desktop-session-accessory { display: none !important; }
.xref-item { display:flex; align-items:flex-start; gap:7px; padding:8px 0; border-bottom:1px solid var(--line-2); overflow-wrap:anywhere; }
.xref-item strong { font-weight:600; font-size:12px; }
.xref-item small { color:var(--ink-3); font-size:11px; }
