/* Designer (design.html only): the template page and the designer app.
   Split from site.css so the other pages don't download it. Loaded after site.css. */

/* ---------- designer (design.html) ---------- */
.tpl-grid { display: grid; gap: 36px; padding-bottom: 20px; }
.tpl-group-h { font-size: 20px; margin-bottom: 14px; }
.tpl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tpl-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 18px 22px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  transition: translate var(--lift-t), box-shadow var(--lift-t), border-color var(--lift-t);
}
.tpl-card:hover, .tpl-card:focus-visible { translate: 0 var(--lift); box-shadow: var(--shadow-1); border-color: var(--blue-100); }
.tpl-art { position: relative; width: 100%; aspect-ratio: 1 / 1; margin-bottom: 8px; border-radius: 14px; background: var(--soft); overflow: hidden; }
.tpl-art img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; }
.tpl-card b { font-size: 18px; font-weight: 700; }
.tpl-text { color: var(--muted); font-size: 14px; line-height: 1.5; }
.tpl-card .link { margin-top: auto; padding-top: 8px; color: var(--blue-ink); font-weight: 600; }
.tpl-alt { padding-top: 12px; padding-bottom: 88px; color: var(--muted); }

.dz-hint {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0; z-index: 3; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 7px 8px 7px 14px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 500; line-height: 1.35;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
}
.dz-hint.is-warn { background: #B42318; }
.seg-sm.dark { background: rgba(255, 255, 255, .12); }
.seg-sm.dark button { height: 26px; padding: 0 9px; color: rgba(255, 255, 255, .78); font-size: 12.5px; }
.seg-sm.dark button[aria-checked="true"] { background: #fff; color: var(--text); }

/* edges you can fillet or chamfer, drawn over the 3D view */
.dz-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.dz-edges line { stroke-linecap: round; filter: drop-shadow(0 0 1px rgba(15, 35, 50, .6)); }
.dz-edges .can { stroke: rgba(255, 255, 255, .8); stroke-width: 2.5; }
.dz-edges .hov { stroke: #FFB020; stroke-width: 5; }
.dz-edges .sel { stroke: #FFC300; stroke-width: 5; }
.dz-edges .back { stroke-dasharray: 4 5; opacity: .5; }
#viewer.moving canvas { cursor: grabbing; }

/* the small box next to a chosen edge */
.dz-pop {
  position: absolute; z-index: 4; display: grid; gap: 8px; width: 236px; padding: 10px 12px 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -12px rgba(15, 35, 50, .3);
}
.dz-pop[hidden] { display: none; }
.dz-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dz-pop-head b { font-size: 14px; }
.dz-pop .seg-sm { display: flex; }
.dz-pop .seg-sm button { flex: 1; padding: 0 6px; font-size: 12.5px; }
.dz-pop-size { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dz-pop-size input { width: 84px; }
.dz-pop-max { font-size: 12px; color: var(--muted); margin-top: -4px; }

/* numbered dots beside holes and cutouts */
.dz-marks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.dz-marks span {
  width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--text);
}
.dz-marks span { position: absolute; left: 0; top: 0; width: 18px; height: 18px; font-size: 10.5px; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(15, 35, 50, .3); transition: opacity .15s; }
.dz-marks span.behind { opacity: .3; }
.dz-marks span.sel { background: var(--blue-ink); }
.dz-marks span.bad { background: #D92D20; }
.dz-marks span.ovl { background: #DC6803; }
.dz-marks span.ovl.sel { background: var(--blue-ink); }

.dz-del { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.dz-del:hover { background: #fff; color: var(--text); }
.dz-del[data-del]:hover { color: #D92D20; }
.dz-del svg { width: 16px; height: 16px; }

@media (max-width: 1100px) {
  .tpl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .tpl-cards { grid-template-columns: 1fr; gap: 14px; }
  .tpl-card { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; }
  .tpl-art { width: 110px; aspect-ratio: 1; margin: 0; }
  .tpl-card > b { flex: 1; }
  .tpl-text, .tpl-card .link { width: 100%; }
}

/* ===========================================================================
   Designer app (design.html, js/design.js): a command bar with grouped tools, the model tree on
   the left, the 3D view in the middle, settings on the right. Small type, thin lines, 18 px icons.
   =========================================================================== */
/* the designer sits in the page like the rest of the site: a framed card, three columns that line up top to bottom */
.cad { --cad-bar: 60px; --cad-l: 224px; --cad-r: 292px; padding-top: 18px; padding-bottom: 56px; font-size: 13.5px; }
.cad-app { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow-1); }
.cad svg.ci, .cad svg.ci-s { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cad svg.ci { width: 18px; height: 18px; }
.cad svg.ci-s { width: 15px; height: 15px; }
.cad svg.ok { width: 14px; height: 14px; fill: none; stroke: #1F8A4C; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; display: inline-block; }

/* command bar */
.cad-bar { height: var(--cad-bar); display: grid; grid-template-columns: var(--cad-l) minmax(0, 1fr) var(--cad-r); align-items: stretch; border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 5; }
.cad-doc { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 10px 0 8px; border-right: 1px solid var(--line); }
.cad-back { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.cad-back:hover { background: var(--soft); color: var(--text); }
.cad-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cad-docname { display: grid; min-width: 0; }
.cad-name { width: 100%; min-width: 0; height: 24px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: 14.5px; font-weight: 650; color: var(--text); text-overflow: ellipsis; }
.cad-name:hover { border-color: var(--line); }
.cad-name:focus { outline: none; border-color: var(--blue-ink); background: #fff; }
.cad-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cad-state i { width: 7px; height: 7px; border-radius: 50%; background: #E8A317; }
.cad-state.is-warn { color: #9A6408; }
.cad-state.is-ok { color: #1F8A4C; }
.cad-cmds { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cad-cmds::-webkit-scrollbar { display: none; }
.cad-grp { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 8px; border-left: 1px solid var(--line); }
.cad-grp:first-child { border-left: 0; }
.cad-grp-btns { display: flex; align-items: center; gap: 1px; }
.cad-grp-l { font-size: 9.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: #8A96A1; line-height: 1; }
.cad-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 46px; height: 42px; padding: 0 6px;
  border: 0; border-radius: 7px; background: none; color: #33424E; font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, color .12s;
}
.cad-btn:hover { background: var(--soft); color: var(--text); }
.cad-btn[aria-pressed="true"] { background: var(--blue-50); color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue-100); }
.cad-btn:disabled { opacity: .35; cursor: default; background: none; }
.cad-btn-row { flex-direction: row; gap: 6px; height: 32px; min-width: 0; padding: 0 9px; font-size: 12.5px; font-weight: 600; }
.cad-file { display: flex; align-items: center; justify-content: space-around; gap: 2px; padding: 0 8px; border-left: 1px solid var(--line); }
.cad-go-big:disabled { opacity: .5; cursor: not-allowed; }
/* sketching: the bar turns into the sketch palette */
.cad-bar.sketching { background: linear-gradient(#F4F9FE, #EEF5FC); }
.cad-grp-end { flex-direction: row; gap: 8px; margin-left: auto; padding-right: 10px; }
.cad-grp-end .cad-grp-btns { gap: 6px; }
.cad-finish { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
.cad-finish svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* three panes */
.cad-body { display: grid; grid-template-columns: var(--cad-l) minmax(0, 1fr) var(--cad-r); height: clamp(540px, calc(100vh - var(--hdr) - 150px), 740px); }
.cad-tree, .cad-props { overflow-y: auto; overscroll-behavior: contain; background: #fff; scrollbar-width: thin; }
.cad-tree { border-right: 1px solid var(--line); padding: 8px 8px 16px; }
.cad-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: #fff; }
.cad-go { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(#FBFCFD, #fff); }
.cad-go .cad-sum { margin: 10px 0 0; }
.cad-go .cad-warn { margin: 8px 0 0; }
.cad-props { flex: 1; min-height: 0; padding: 4px 16px 20px; }
.cad-view { position: relative; min-width: 0; overflow: hidden; background: radial-gradient(ellipse 80% 70% at 50% 45%, #FBFCFD, #EDF1F4); }
.cad-view .viewer { position: absolute; inset: 0; }
.cad-view .loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--soft); z-index: 6; }
.cad-view .loading[hidden] { display: none; }
.cad-view .loading > div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }

/* section headings in both side panes */
.cad-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8A96A1; }
.cad-h small { font-size: 10.5px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.cad-tree > .cad-h:first-child { margin: 6px 8px 6px; }
.cad-h2 { margin: 12px 6px 4px; }

/* model tree */
.cad-rows { display: grid; gap: 1px; }
.cad-row { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 22px; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 8px; border-radius: 7px; cursor: pointer; color: #33424E; outline-offset: -2px; }
.cad-row:hover { background: var(--soft); }
.cad-row.on { background: var(--blue-50); color: var(--blue-ink); }
.cad-row .ci { width: 16px; height: 16px; color: #6B7884; }
.cad-row.on .ci { color: var(--blue-ink); }
.cad-row-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cad-row-v { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cad-row.on .cad-row-v { color: var(--blue-ink); }
.cad-row.bad .cad-row-n { color: #B42318; }
.cad-row.bad .cad-row-n::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #D92D20; margin-left: 6px; vertical-align: 1px; }
.cad-row-x { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #8A96A1; cursor: pointer; opacity: 0; }
.cad-row:hover .cad-row-x, .cad-row:focus-within .cad-row-x, .cad-row.on .cad-row-x { opacity: 1; }
.cad-row-x:hover { background: #fff; color: #D92D20; }
.cad-row-x .ci { width: 14px; height: 14px; color: currentColor; }
.cad-num-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-right: 6px; padding: 0 3px; border-radius: 8px; background: var(--text); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.cad-row.on .cad-num-badge { background: var(--blue-ink); }
.cad-empty { margin: 10px 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* properties */
.cad-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: 0 -14px 4px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.cad-ph h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.005em; }
.cad-icon-btn { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.cad-icon-btn:hover { background: var(--soft); color: #D92D20; }
.cad-icon-btn .ci { width: 16px; height: 16px; }
.cad-f { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); align-items: center; gap: 10px; min-height: 34px; }
.cad-fl { font-size: 13px; color: #3A4854; font-weight: 500; }
.cad-fl label { cursor: inherit; }
.cad-fv { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cad-fv select { height: 28px; max-width: 170px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); }
.cad-in { display: inline-flex; align-items: center; gap: 4px; }
.cad-in input, .cad-step input, .cad-text {
  width: 74px; height: 28px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.cad-in input::-webkit-outer-spin-button, .cad-in input::-webkit-inner-spin-button, .cad-step input::-webkit-outer-spin-button, .cad-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cad-in input:focus, .cad-step input:focus, .cad-text:focus, .cad-fv select:focus { outline: none; border-color: var(--blue-ink); box-shadow: 0 0 0 3px var(--blue-100); }
.cad-in i { font-style: normal; font-size: 11.5px; color: var(--muted); min-width: 0; }
.cad-in i:empty { display: none; }
.cad-text { width: 170px; text-align: left; }
.cad-step { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.cad-step button { width: 26px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 7px; }
.cad-step button:hover { background: var(--soft); color: var(--text); }
.cad-step .i { width: 14px; height: 14px; }
.cad-step input { width: 62px; height: 26px; border: 0; border-radius: 0; text-align: center; padding: 0 2px; }
.cad-step input:focus { box-shadow: none; background: var(--blue-50); }
.cad-step input:disabled { background: none; color: var(--muted); }
.cad .seg-sm button { height: 26px; padding: 0 9px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.cad-note { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cad-note.center { text-align: center; }
.cad-meta { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.cad-meta b { color: var(--text); font-weight: 600; margin-right: 4px; }
.cad-warn { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: #FEF3F2; color: #B42318; font-size: 12.5px; line-height: 1.45; }
.cad-link { margin: 6px 0 2px; color: var(--blue-ink); font-weight: 600; font-size: 12.5px; }
.cad-check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12.5px; cursor: pointer; }
.cad-check input { width: 15px; height: 15px; accent-color: var(--blue-ink); }
.cad .btn-sm { height: 32px; font-size: 13px; border-radius: 8px; gap: 6px; }
.cad .btn-ghost.btn-block { margin-top: 6px; }
.cad-switch { cursor: pointer; }
.cad-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cad-switch i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); transition: background-color .2s; }
.cad-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 35, 50, .25); transition: translate .2s var(--ease); }
.cad-switch input:checked + i { background: var(--blue-ink); }
.cad-switch input:checked + i::after { translate: 14px 0; }
.cad-switch input:focus-visible + i { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.cad-edges { display: grid; gap: 2px; }
.cad-edge { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 3px 6px; margin: 0 -6px; border-radius: 7px; }
.cad-edge.on { background: var(--blue-50); }
.cad-edge-n { padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; text-align: left; color: #4A5864; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cad-edge-n:hover { color: var(--blue-ink); }
.cad-edge select { height: 26px; padding: 0 4px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; font: inherit; font-size: 12px; font-weight: 600; }
.cad-edge .cad-in input { width: 58px; height: 26px; }
.cad-sum { margin: 8px 0; display: grid; gap: 5px; font-size: 13px; }
.cad-sum dd small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.cad-sum div { display: flex; justify-content: space-between; gap: 10px; }
.cad-sum dt { color: var(--muted); }
.cad-sum dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.cad-sum dd.bad { color: #B42318; }
.cad-go-big { height: 42px; font-size: 14.5px; border-radius: 10px; }
.cad-go-big .i { width: 16px; height: 16px; }
.cad-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.cad-how li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; font-size: 12px; line-height: 1.45; color: #4A5864; }
.cad-how .ci { width: 16px; height: 16px; color: var(--blue-ink); margin-top: 1px; }
.cad-how b { color: var(--text); font-weight: 650; }
.cad-tips { margin: 0; padding-left: 16px; display: grid; gap: 6px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.cad kbd { display: inline-block; padding: 0 4px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: #fff; font: inherit; font-size: 11px; font-weight: 600; color: var(--text); }
.cad-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cad-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 30px; padding: 0 2px 0 8px; border-radius: 7px; background: var(--soft); font-size: 12.5px; }
.cad-big { margin: 10px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cad-big small { font-size: 14px; font-weight: 600; color: var(--muted); }
.cad-shape { border-radius: 8px; margin: 0 -6px; padding: 0 2px 0 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cad-shape.on { background: var(--blue-50); }
.cad-shape-h { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--text); cursor: pointer; text-align: left; }
.cad-shape-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cad-shape-h .ci { width: 15px; height: 15px; color: var(--blue-ink); }
.cad-shape-f { grid-column: 1 / -1; padding: 0 8px 8px 23px; }
.cad-edit-sk .ci-s { color: var(--blue-ink); }
.cad-guide { margin: 12px 0 8px; padding: 11px 12px 10px; border-radius: 10px; background: var(--blue-50); color: #24435C; }
.cad-guide b { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--blue-ink); margin-bottom: 6px; }
.cad-guide .ci { width: 16px; height: 16px; }
.cad-guide ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12.5px; line-height: 1.45; }
.cad-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.cad-chip { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.cad-chip:hover { border-color: var(--blue-ink); color: var(--blue-ink); }
.cad-chip.is-done::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #FFB020; vertical-align: 1px; }
.cad-elist li { height: 32px; }
.cad-elist li.on { background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-100); }
.cad-elist .cad-edge-n { flex: 1; font-size: 12.5px; }
.cad-tag { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* over the 3D view */
.cad-viewbtns { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.cad .vt-icon { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 1px 2px rgba(15, 35, 50, .08), inset 0 0 0 1px var(--line); }
.cad .vt-icon[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(15, 35, 50, .08), inset 0 0 0 1.5px var(--blue-ink); }
.cad .vt-icon .rv-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cad .vt-icon .ban-ico { width: 20px; height: 20px; }
.cad .vt-icon .ax-ico { width: 19px; height: 19px; }
.cad .vt-icon .area-ico { width: 14px; height: 14px; }
.cad .vt-icon::after { font-size: 12px; padding: 5px 9px; }
.cad-status { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .9); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--muted); }
.cad-status b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.cad-st-bad { color: #B42318; font-weight: 650; }
.cad .dz-hint { bottom: 12px; padding: 6px 7px 6px 12px; border-radius: 10px; font-size: 12.5px; background: rgba(15, 35, 50, .92); }
.cad-done { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border: 0; border-radius: 8px; background: #1A86DA; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 0 0 3px rgba(26, 134, 218, .35); animation: donePulse 2.4s ease-in-out infinite; }
.cad-done:hover { background: #0A66B3; }
.cad-done .ci-s { width: 15px; height: 15px; stroke-width: 2.4; }
.cad-done kbd { margin-left: 2px; padding: 1px 5px; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .22); color: #fff; font-size: 11px; font-weight: 700; }
@keyframes donePulse { 50% { box-shadow: 0 0 0 6px rgba(26, 134, 218, .12); } }
@media (prefers-reduced-motion: reduce) { .cad-done { animation: none; } }
.dz-pop-foot { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.dz-pop-foot .cad-done { animation: none; box-shadow: none; }
.cad-banner { position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 8px; background: var(--blue-ink); color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(10, 102, 179, .8); }
.cad-banner[hidden] { display: none; }
.cad-banner .ci { width: 16px; height: 16px; }
.cad-ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
.cad-face { fill: rgba(255, 255, 255, .62); }
.cad-face.on { fill: rgba(255, 255, 255, .42); }
/* the outline: built in design.js as cls + "-edge" (cad-face-edge, and cad-face on-edge while sketching) */
.cad-face-edge { fill: none; stroke: #107CD2; stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 2px rgba(16, 124, 210, .6)); }
.cad-face.on-edge { fill: none; stroke: #107CD2; stroke-width: 2; stroke-dasharray: 6 4; }
.sk-fill { fill: rgba(16, 124, 210, .22); }
.sk-line { fill: none; stroke: #0A66B3; stroke-width: 2.5; stroke-linejoin: round; }
.sk-line.sel { stroke: #E8590C; stroke-width: 3; }
.sk-pre { fill: none; stroke: #0A66B3; stroke-width: 2; stroke-dasharray: 6 4; }
.sk-guide { fill: none; stroke: #E8590C; stroke-width: 1.2; stroke-dasharray: 3 4; }
.sk-dot { fill: #fff; stroke: #0A66B3; stroke-width: 1.8; }
.sk-hair { stroke: #0F2332; stroke-width: 1.4; opacity: .75; }
.sk-pt { fill: #fff; stroke: #0A66B3; stroke-width: 2.5; filter: drop-shadow(0 1px 2px rgba(15, 35, 50, .45)); }
.sk-pt.snap { fill: #DCFCE7; stroke: #1F8A4C; stroke-width: 3; }
.cad-tip { position: absolute; left: 0; top: 0; z-index: 4; padding: 4px 9px; border-radius: 7px; background: #0F2332; color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .4); }
.cad-tip[hidden] { display: none; }
.ms-line { stroke: #E8590C; stroke-width: 2; stroke-dasharray: 6 4; }
.ms-pt { fill: #E8590C; stroke: #fff; stroke-width: 2; }
.ms-hov { fill: rgba(232, 89, 12, .15); stroke: #E8590C; stroke-width: 2; }
.cad-mlabel { position: absolute; left: 0; top: 0; z-index: 3; padding: 3px 8px; border-radius: 6px; background: #E8590C; color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35); }
.cad-mlabel[hidden] { display: none; }
#viewer[data-tool="sketch"] canvas, #viewer[data-tool="hole"] canvas, #viewer[data-tool="text"] canvas, #viewer[data-tool="shell"] canvas { cursor: crosshair; }

/* the number box by the pointer while sketching */
.cad-hud { position: absolute; z-index: 4; display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: rgba(15, 35, 50, .94); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }
.cad-hud[hidden] { display: none; }
.hud-f { display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 7px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .72); font-size: 11px; font-weight: 600; }
.hud-f input { width: 54px; height: 20px; padding: 0 4px; border: 0; border-radius: 4px; background: transparent; color: #fff; font: inherit; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.hud-f input:focus { outline: none; background: rgba(255, 255, 255, .16); }
.hud-f i { font-style: normal; font-size: 10.5px; opacity: .7; }
.hud-f.locked { background: #fff; color: var(--muted); }
.hud-f.locked input { color: var(--text); }

/* dialogs (save before leaving, share link) */
.cad-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(15, 35, 50, .42); animation: fadeIn .18s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.cad-modal-box { width: min(440px, 100%); padding: 20px 20px 16px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-2); font-size: 14px; }
.cad-modal-box h2 { font-size: 18px; margin-bottom: 8px; }
.cad-modal-box p { color: #4A5864; line-height: 1.5; margin-bottom: 10px; }
.cad-modal-box .cad-note { font-size: 12.5px; }
.cad-modal-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.cad-modal-btns .btn { height: 36px; font-size: 13.5px; border-radius: 9px; }
.cad-danger { color: #B42318; }
.cad-danger:hover { border-color: #B42318; }
.cad-link-box { display: flex; gap: 6px; }
.cad-link-box input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; font-size: 12.5px; color: var(--muted); background: var(--soft); }

/* start page: the two "start" cards */
.tpl-start .tpl-art { display: grid; place-items: center; background: linear-gradient(180deg, #F7FAFC, #EEF3F7); }
.tpl-start .tpl-blank { width: 78%; height: auto; }
.tpl-start { border-style: dashed; border-color: var(--line-2); }
.tpl-start:hover { border-style: solid; }
/* a .printhead file dragged over the start page: the "Open a saved design" card is where it goes */
.tpl-start.is-drag { border-style: dashed; border-color: var(--blue-ink); background: var(--blue-50); }
.tpl-start.is-over { border-style: solid; border-color: var(--blue-ink); background: var(--blue-50); translate: 0 var(--lift); box-shadow: var(--shadow-1); }
.tpl-start.is-drag *, .tpl-start.is-over * { pointer-events: none; }

@media (max-width: 1180px) {
  .cad { --cad-l: 196px; --cad-r: 262px; }
  .cad-btn { min-width: 40px; }
}
/* phones and small screens get a short note instead of the designer */
.dz-small { display: none; }
@media (max-width: 899px) {
  .dz-small { display: block; padding: 56px 20px 72px; text-align: center; }
  #dz-pick, #dz-edit { display: none !important; }
  body.cad-on .announce { display: block; }
}
.dz-small-in { max-width: 30em; margin: 0 auto; display: grid; justify-items: center; gap: 12px; }
.dz-small-ico { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-50); display: grid; place-items: center; margin-bottom: 6px; }
.dz-small-ico svg { width: 46px; height: 46px; fill: none; stroke: var(--blue-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz-small h1 { font-size: 28px; }
.dz-small .lead { font-size: 16px; text-align: center; }
.dz-small-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

.cad-status[hidden] { display: none; }
