/* DXF viewer app: the shared .v3 shell (../viewer.css) plus .cad rules. */
/* ../viewer.css and ../toolbar.css are linked by the page before this file (site/sitegen/apps.py SHARED_CSS). */
/* ---- DXF viewer additions ---- */
.cad .cad-stage{background:#1e2229;touch-action:none}
.cad[data-bg="light"] .cad-stage{background:#fff}
.cad .cad-over{position:absolute;inset:0;width:100%;height:100%;cursor:grab;outline:none}
.cad .v3-drop-in{background:color-mix(in srgb,var(--card) 92%,transparent)}
.cad .v3-v{display:inline-flex;align-items:center;gap:5px}
.cad-lay select{font:inherit;font-size:14px;min-height:36px;max-width:160px;padding:4px 8px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
@media (max-width:900px){.cad-lay select{min-height:44px}}   /* keeps the 44 px tap target of viewer.css */
.cad-lay[hidden]{display:none}
.cad-xy{position:absolute;left:10px;bottom:10px;z-index:4;font:12.5px/1.3 ui-monospace,Menlo,Consolas,monospace;background:color-mix(in srgb,var(--card) 90%,transparent);border:1px solid var(--line);border-radius:8px;padding:4px 8px;color:var(--ink);pointer-events:none;max-width:calc(100% - 20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cad-xy[hidden]{display:none}
.cad-name{font-weight:650;margin:0 0 8px;overflow-wrap:anywhere}
.cad-llist,.cad-blist,.cad-mlist,.cad-dlist{list-style:none;margin:6px 0 0;padding:0;max-height:260px;overflow-y:auto}
.cad-llist .v3-chk{padding:3px 0;gap:8px}
.cad-llist i{width:12px;height:12px;border-radius:3px;border:1px solid var(--line);flex:0 0 auto}
.cad-llist span{flex:1;min-width:0;overflow-wrap:anywhere}
.cad-llist small,.cad-blist small{color:var(--muted)}
.cad-lrow-btns{display:flex;gap:6px}
.cad-blist li{display:flex;justify-content:space-between;gap:10px;padding:4px 0;border-top:1px dashed var(--line);overflow-wrap:anywhere}
.cad-dlist li{padding:3px 0;font-size:13px}.cad-dlist span{color:var(--muted)}
.cad-mlist li{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:6px 0;border-top:1px dashed var(--line)}
.cad-mlist div{display:flex;flex-direction:column;min-width:0}
.cad-mlist span{color:var(--muted);font-size:12.5px}
.cad-mlist b{font-size:17px;font-weight:650}
.cad-mlist small{color:var(--muted);font-size:12.5px}
.cad-mlist .v3-x{min-height:28px;width:28px;height:28px;padding:4px;display:flex;align-items:center;justify-content:center}
.cad .v3-small{margin-top:8px}
.cad-flash{animation:cadflash .9s ease}
@keyframes cadflash{0%,100%{background:transparent}30%{background:var(--accent-bg)}}
.cad-fmts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:6px 0 10px}
.cad-fmt{position:relative;display:block;cursor:pointer;margin:0!important}
.cad-fmt input{position:absolute;opacity:0}
.cad-fmt span{display:flex;flex-direction:column;gap:2px;border:1.5px solid var(--line);border-radius:12px;padding:10px;height:100%}
.cad-fmt b{font-size:16px}
.cad-fmt small{font-weight:400;font-size:12px;color:var(--muted);line-height:1.3}
.cad-fmt input:checked+span{border-color:var(--accent);background:var(--accent-bg)}
.cad-fmt input:focus-visible+span{outline:2px solid var(--accent-text);outline-offset:2px}
.v3-dlg-body .v3-kv select{font:inherit;font-size:14px;padding:4px 8px;border-radius:8px;border:1px solid var(--line);background:var(--card);color:var(--ink);max-width:60%}
.v3-dlg-body [hidden]{display:none!important}
.v3-dlg-body .v3-chk{font-weight:400;display:flex}
.v3-dlg-body .v3-chk input{width:auto}
.cad-xres .v3-note{font-size:13.5px}
.cad-steps{padding-left:20px;font-size:14.5px}.cad-steps li{margin:4px 0}
.cad .v3-note svg{vertical-align:-2px}
@media (max-width:860px){.cad.v3-page .v3-v span{display:none}.cad-lay select{max-width:120px}}
@media (max-width:480px){.cad-fmts{grid-template-columns:1fr}.cad-fmt small{display:none}}
/* laser check (openui.js): open shapes, marked in orange on the drawing */
.cad-open{margin:8px 0 0}
.cad-open.warn{padding:8px 10px;border-radius:10px;background:var(--warn-bg)}
.cad-open.warn p{margin:0}
.cad-open.warn b{color:var(--warn)}
.cad-open.warn .v3-note{margin-top:2px}
.cad-open.ok{color:var(--ok)}
/* units line under the size (unitsui.js) */
.cad-units{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0 0;padding:8px 10px;border-radius:10px;background:var(--bg2)}
.cad-units.warn{background:var(--warn-bg)}
.cad-units p{flex:1 1 100%;margin:0;font-size:13.5px;line-height:1.4}
.cad-units button{min-height:40px}
/* wrong-file message inside the drop card (viewer.js / cad.js error), never over it */
.v3-drop-err{margin:12px auto 0;max-width:420px;padding:10px 12px;border-radius:10px;border-left:4px solid var(--warn);background:var(--warn-bg,#fff4ec);color:var(--ink);font-size:14px;line-height:1.45;text-align:left}
.v3-drop-err[hidden]{display:none}
/* one Export in view (audit 2 §2): beside the drawing the panel's big Export is the one; the toolbar's shows only on phones,
   where the panel sits below the picture */
@media (min-width:861px){.cad.v3-page .v3-bar>[data-act="export"]{display:none}}
