/* Drafting Studio keeps a calm paper field over a soft felt carrier. */
.app-window[data-win-id="drafting-studio"] .window-body.drafting-studio-window-body {
  overflow: hidden;
  padding: 0;
  container: drafting-studio / inline-size;
}
.drafting-studio {
  --ds-ground: #d2dacf;
  --ds-field: #e5e9e1;
  --ds-control: rgba(255,255,255,.64);
  --ds-control-strong: rgba(255,255,255,.86);
  --ds-text: #26342d;
  --ds-muted: #66756b;
  --ds-rule: rgba(39,57,46,.14);
  --ds-accent: #557d63;
  --ds-accent-wash: rgba(82,122,94,.13);
  --ds-shadow: 0 5px 14px rgba(34,47,37,.09), inset 0 1px rgba(255,255,255,.55);
  width: 100%; height: 100%; min-width: 0; min-height: 0; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 9px; padding: 12px;
  overflow: auto; position: relative; color: var(--ds-text);
  background: linear-gradient(145deg, #d8e0d5 0%, var(--ds-ground) 54%, #c5d0c3 100%);
  font: 13px/1.35 var(--font-sans, Inter, "Helvetica Neue", system-ui, sans-serif);
  color-scheme: light;
}
.drafting-studio[data-theme="dark"] {
  --ds-ground: #283530;
  --ds-field: #303d37;
  --ds-control: rgba(240,245,237,.095);
  --ds-control-strong: rgba(240,245,237,.15);
  --ds-text: #eff3ea;
  --ds-muted: #b0beb2;
  --ds-rule: rgba(239,243,234,.13);
  --ds-accent: #9cc4a2;
  --ds-accent-wash: rgba(153,195,160,.13);
  --ds-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.075);
  background: linear-gradient(145deg, #303d37 0%, var(--ds-ground) 54%, #202b27 100%);
  color-scheme: dark;
}
.drafting-studio *, .drafting-studio *::before, .drafting-studio *::after { box-sizing: border-box; }
.drafting-studio button, .drafting-studio input, .drafting-studio select { font: inherit; color: inherit; }
.ds-top { display:flex; align-items:center; justify-content:space-between; gap:12px; flex:0 0 auto; min-height:46px; }
.ds-identity { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
.ds-overline { color:var(--ds-muted); font-size:9px; line-height:1.2; font-weight:800; letter-spacing:.15em; }
.ds-title { width:min(360px, 42vw); max-width:100%; border:0; border-bottom:1px solid transparent; outline:0; background:transparent; color:var(--ds-text); padding:1px 0; font-size:17px!important; font-weight:700!important; letter-spacing:-.025em; }
.ds-title:hover, .ds-title:focus { border-color:var(--ds-rule); }
.ds-save-state { color:var(--ds-muted); font-size:10px; }
.ds-document-actions { display:flex; align-items:center; gap:4px; flex:0 0 auto; }
.ds-document-actions .ds-history { margin-right:5px; padding:0 8px 0 0; border-left:0; border-right:1px solid var(--ds-rule); }
.ds-quiet-action, .ds-small-text, .ds-add-view, .ds-projection button, .ds-history button, .ds-small-action, .ds-primary-action, .ds-suggestion-dismiss, .ds-suggestion-accept {
  border:1px solid var(--ds-rule); border-radius:9px; background:var(--ds-control); box-shadow:var(--ds-shadow); cursor:pointer; transition:background .15s, transform .15s, box-shadow .15s;
}
.ds-quiet-action { padding:6px 9px; font-size:11px; font-weight:650; white-space:nowrap; }
.ds-quiet-action[data-action="save"] { background:var(--ds-control-strong); }
.ds-document-actions .ui-icon { width:13px; height:13px; vertical-align:-2px; }
.ds-files-toggle { display:none; align-items:center; justify-content:center; gap:4px; }
.ds-files-toggle [data-ds-icon] { display:inline-flex; }
.ds-quiet-action:hover, .ds-small-text:hover, .ds-add-view:hover, .ds-projection button:hover, .ds-history button:hover, .ds-small-action:hover, .ds-primary-action:hover { background:var(--ds-control-strong); transform:translateY(-1px); }
.ds-quiet-action:focus-visible, .ds-tool:focus-visible, .ds-view-tab:focus-visible, .ds-color:focus-visible, .ds-history button:focus-visible, .drafting-studio button:focus-visible, .ds-title:focus-visible { outline:2px solid var(--ds-accent); outline-offset:2px; }
.ds-tools-row { display:flex; align-items:center; gap:10px; flex:0 0 auto; padding:7px 8px; border:1px solid var(--ds-rule); border-radius:14px; background:rgba(255,255,255,.29); box-shadow:inset 0 1px rgba(255,255,255,.32), 0 2px 8px rgba(30,47,34,.045); }
.drafting-studio[data-theme="dark"] .ds-tools-row { background:rgba(0,0,0,.08); }
.ds-tools { display:flex; align-items:center; gap:5px; min-width:0; }
.ds-tool { min-width:58px; height:42px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:0; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--ds-muted); cursor:pointer; font-size:17px; line-height:1.1; }
.ds-tool span { font-size:9px; font-weight:650; letter-spacing:.01em; }
.ds-tool .ds-tool-icon { display:inline-flex; align-items:center; justify-content:center; }
.ds-tool-icon .ui-icon { width:18px; height:18px; }
.ds-tool-small { min-width:34px; width:34px; height:34px; font-size:16px; }
.ds-tool-small .ds-tool-icon .ui-icon { width:18px; height:18px; }
.ds-tool.is-active { color:var(--ds-text); background:var(--ds-control-strong); border-color:var(--ds-rule); box-shadow:0 2px 5px rgba(32,45,35,.11), inset 0 1px rgba(255,255,255,.55); }
.ds-tool-divider { width:1px; height:28px; background:var(--ds-rule); margin:0 2px; }
.ds-colors { position:relative; display:flex; gap:7px; align-items:center; margin-left:auto; }
.ds-color-current { display:none; align-items:center; justify-content:center; gap:4px; width:38px; height:38px; padding:4px; border:1px solid var(--ds-rule); border-radius:11px; background:var(--ds-control); box-shadow:var(--ds-shadow); cursor:pointer; }
.ds-color-current-swatch { display:block; width:19px; height:19px; border:2px solid rgba(255,255,255,.8); border-radius:50%; background:var(--swatch); box-shadow:0 1px 3px rgba(0,0,0,.24); }
.ds-color-current-caret { font-size:12px; line-height:1; color:var(--ds-muted); }
.ds-color-options { display:flex; gap:7px; align-items:center; }
.ds-color { width:20px; height:20px; padding:0; border-radius:50%; border:2px solid rgba(255,255,255,.7); background:var(--swatch); box-shadow:0 1px 3px rgba(0,0,0,.24); cursor:pointer; }
.ds-color.is-active { outline:2px solid var(--ds-accent); outline-offset:2px; }
.ds-history { display:flex; gap:3px; border-left:1px solid var(--ds-rule); padding-left:9px; }
.ds-history button { width:29px; height:29px; border-radius:8px; font-size:18px; line-height:1; }
.ds-history button:disabled { opacity:.38; cursor:default; transform:none; }
.ds-history .ui-icon { width:16px; height:16px; }
.ds-views { min-height:33px; display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.ds-view-tabs { display:flex; gap:5px; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.ds-view-tab { display:flex; gap:6px; align-items:center; padding:6px 10px; max-width:220px; border:1px solid transparent; border-radius:9px; color:var(--ds-muted); background:transparent; cursor:pointer; white-space:nowrap; font-size:11px; font-weight:650; }
.ds-view-tab small { font-size:8px; letter-spacing:.08em; opacity:.7; }
.ds-view-tab.is-active { color:var(--ds-text); border-color:var(--ds-rule); background:var(--ds-control); box-shadow:inset 0 1px rgba(255,255,255,.45); }
.ds-add-view { padding:5px 9px; border-radius:8px; color:var(--ds-text); font-size:11px; white-space:nowrap; }
.ds-add-view [data-ds-icon] { display:inline-flex; vertical-align:middle; }
.ds-add-view .ui-icon { width:12px; height:12px; }
.ds-details-toggle { display:flex; align-items:center; gap:5px; padding:5px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); box-shadow:var(--ds-shadow); cursor:pointer; font-size:10px; white-space:nowrap; }
.ds-details-toggle .ui-icon { width:13px; height:13px; }
.ds-construction-toggle { display:flex; align-items:center; justify-content:center; gap:4px; padding:5px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); box-shadow:var(--ds-shadow); cursor:pointer; font-size:10px; font-weight:700; white-space:nowrap; }
.ds-construction-toggle > span:first-child { display:grid; place-items:center; width:19px; height:17px; border-radius:5px; background:var(--ds-accent-wash); color:var(--ds-accent); font-size:8px; letter-spacing:.04em; }
.ds-construction-toggle:hover { background:var(--ds-control-strong); transform:translateY(-1px); }
.ds-spatial-toggle { display:flex; flex:0 0 auto; align-items:center; justify-content:center; gap:4px; padding:5px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); box-shadow:var(--ds-shadow); cursor:pointer; font-size:10px; font-weight:700; white-space:nowrap; }
.ds-spatial-toggle .ui-icon { width:13px; height:13px; }
.ds-spatial-toggle[aria-pressed="true"] { background:var(--ds-accent-wash); border-color:color-mix(in srgb, var(--ds-accent) 40%, transparent); }
.ds-projection { display:flex; gap:4px; margin-left:auto; }
.ds-projection button { padding:5px 8px; border-radius:7px; font-size:10px; color:var(--ds-muted); }
.ds-projection button[aria-pressed="true"] { background:var(--ds-accent-wash); color:var(--ds-text); border-color:color-mix(in srgb, var(--ds-accent) 38%, transparent); }
.ds-main { position:relative; display:grid; grid-template-columns:minmax(0,1fr); flex:1 1 auto; min-height:280px; gap:9px; }
.ds-main.is-inspector-open { grid-template-columns:minmax(0,1fr) 252px; }
.ds-stage { min-width:0; min-height:270px; display:flex; flex-direction:column; overflow:hidden; border:1px solid rgba(60,78,62,.17); border-radius:16px; background:linear-gradient(160deg, rgba(250,250,244,.61), rgba(226,232,222,.78)); box-shadow:0 8px 18px rgba(42,59,44,.11), inset 0 1px rgba(255,255,255,.72); }
.drafting-studio[data-theme="dark"] .ds-stage { background:linear-gradient(160deg, rgba(12,19,16,.55), rgba(30,42,35,.74)); border-color:rgba(226,237,223,.13); box-shadow:0 9px 22px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.08); }
.ds-stage-top, .ds-stage-bottom { display:flex; align-items:center; justify-content:space-between; gap:10px; flex:0 0 auto; min-height:31px; padding:5px 11px; color:var(--ds-muted); font-size:9px; }
.ds-stage-top { border-bottom:1px solid var(--ds-rule); }
.ds-view-definition { font-weight:750; letter-spacing:.08em; color:var(--ds-text); }
.ds-plane-state { font-size:8px; font-weight:750; letter-spacing:.1em; white-space:nowrap; }
.ds-render-host { flex:1 1 auto; min-height:150px; position:relative; overflow:hidden; background:#e5e7e1; }
.drafting-studio[data-theme="dark"] .ds-render-host { background:#d5dbd1; }
.ds-canvas { display:block; width:100%; height:100%; touch-action:none; outline:0; }
.ds-hint { position:absolute; z-index:2; left:9px; bottom:9px; transform:none; display:flex; flex-direction:row; align-items:center; gap:7px; width:max-content; max-width:calc(100% - 18px); padding:5px 7px 5px 9px; border:1px solid rgba(70,88,72,.14); border-radius:999px; color:#3b5141; background:rgba(250,249,242,.78); backdrop-filter:blur(8px); text-align:left; pointer-events:none; box-shadow:0 3px 9px rgba(30,43,33,.06); }
.ds-hint > span { display:flex; align-items:center; gap:6px; min-width:0; }
.ds-hint b { font-size:9px; white-space:nowrap; }
.ds-hint span span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; opacity:.82; }
.ds-hint.is-hidden { display:none; }
.ds-stage-bottom { border-top:1px solid var(--ds-rule); }
.ds-intent-select { flex:0 0 auto; padding:4px 6px; border:1px solid var(--ds-rule); border-radius:6px; background:var(--ds-control); color:var(--ds-muted); cursor:pointer; font-size:8px; font-weight:800; letter-spacing:.07em; }
.ds-tool-description { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ds-scale-readout { white-space:nowrap; font-size:8px; }
.ds-inspector { display:none; flex-direction:column; gap:4px; min-width:0; min-height:0; overflow:auto; padding:2px; }
.ds-main.is-inspector-open .ds-inspector { display:flex; }
.ds-inspector-head { display:flex; align-items:center; justify-content:space-between; min-height:31px; padding:1px 2px 5px; color:var(--ds-text); font-size:12px; }
.ds-inspector-close { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; padding:0; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-muted); background:var(--ds-control); cursor:pointer; }
.ds-inspector-close .ui-icon { width:13px; height:13px; }
.ds-inspector-section { padding:9px 2px; border:0; border-bottom:1px solid var(--ds-rule); border-radius:0; background:transparent; box-shadow:none; }
.ds-inspector-section:last-of-type { border-bottom:0; }
.ds-section-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; color:var(--ds-muted); font-size:8px; line-height:1; font-weight:800; letter-spacing:.13em; }
.ds-expand-definition { border:0; background:transparent; color:var(--ds-accent); cursor:pointer; font-size:10px; font-weight:750; letter-spacing:0; }
.ds-view-name { display:block; font-size:14px; letter-spacing:-.02em; }
.ds-view-copy { display:block; margin-top:2px; color:var(--ds-muted); font-size:9px; line-height:1.35; }
.ds-projection-refresh { margin-top:6px; }
.ds-projection-refresh[hidden] { display:none; }
.ds-architecture-actions { display:grid; gap:5px; margin-top:8px; padding:7px; border:1px solid var(--ds-rule); border-radius:8px; background:rgba(255,255,255,.24); }
.ds-architecture-actions[hidden] { display:none; }
.ds-architecture-actions button { min-height:36px; border:1px solid var(--ds-rule); border-radius:7px; color:var(--ds-text); background:var(--ds-control); font-size:10px; font-weight:750; cursor:pointer; }
.ds-architecture-actions small { color:var(--ds-muted); font-size:8px; line-height:1.45; }
.ds-construction-annotation-option { display:flex; align-items:flex-start; gap:7px; min-height:44px; padding:7px; border:1px solid var(--ds-rule); border-radius:7px; color:var(--ds-text); background:var(--ds-control); cursor:pointer; }
.ds-construction-annotation-option[hidden] { display:none; }
.ds-construction-annotation-option input { width:15px; height:15px; flex:0 0 auto; margin:1px 0 0; accent-color:var(--ds-accent); }
.ds-construction-annotation-option > span { display:flex; min-width:0; flex-direction:column; gap:2px; }
.ds-construction-annotation-option b { font-size:9px; font-weight:700; }
.ds-construction-annotation-option small { font-size:8px; line-height:1.35; }
.ds-canonical-view-actions { position:absolute; z-index:8; top:8px; left:8px; display:flex; flex-wrap:wrap; gap:4px; max-width:calc(100% - 16px); max-height:42%; overflow:auto; clip-path:inset(50%); pointer-events:none; }
.ds-canonical-view-actions:focus-within { clip-path:none; pointer-events:auto; padding:3px; border:1px solid rgba(90,112,99,.45); border-radius:9px; background:rgba(244,242,231,.94); box-shadow:0 3px 12px rgba(30,40,32,.16); }
.ds-canonical-view-actions button { min-height:36px; padding:7px 10px; border:1px solid rgba(75,101,86,.45); border-radius:7px; color:#31483d; background:#f8f6ed; font-size:10px; font-weight:750; cursor:pointer; }
.ds-canonical-view-actions button:focus-visible,.ds-architecture-actions button:focus-visible { outline:2px solid var(--ds-accent); outline-offset:2px; }
@media (max-width:520px) { .ds-canonical-view-actions button { min-height:44px; padding:9px 10px; } }
.ds-architecture-menu-help { max-width:34em; margin:6px 2px 10px; color:var(--ds-muted); font-size:10px; line-height:1.5; }
.ds-architecture-demo-link { display:inline-block; margin:8px 2px 2px; color:var(--ds-accent); font-size:10px; font-weight:750; }
.ds-definition-fields { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.ds-fact { min-width:0; display:flex; flex-direction:column; padding:5px 6px; border-radius:7px; background:rgba(255,255,255,.31); }
.drafting-studio[data-theme="dark"] .ds-fact { background:rgba(0,0,0,.14); }
.ds-fact small { font-size:7px; font-weight:750; letter-spacing:.09em; color:var(--ds-muted); }
.ds-fact span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; font-weight:650; }
.ds-iteration-list, .ds-layer-list { display:flex; flex-direction:column; gap:3px; max-height:133px; overflow:auto; }
.ds-iteration-row { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:6px 7px; border:1px solid transparent; border-radius:8px; color:var(--ds-text); background:transparent; text-align:left; cursor:pointer; }
.ds-iteration-row:hover { background:var(--ds-control-strong); }
.ds-iteration-row.is-active { border-color:var(--ds-rule); background:var(--ds-control-strong); }
.ds-iteration-row.is-accepted .ds-iteration-status { color:var(--ds-accent); }
.ds-iteration-label { min-width:0; display:flex; flex-direction:column; }
.ds-iteration-label b { font-size:10px; font-weight:700; }
.ds-iteration-label small { color:var(--ds-muted); font-size:8px; text-transform:capitalize; }
.ds-iteration-status { flex:0 0 auto; color:var(--ds-muted); font-size:13px; }
.ds-iteration-actions { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:6px; }
.ds-primary-action { grid-column:1 / -1; padding:7px 9px; background:var(--ds-accent-wash); color:var(--ds-text); font-size:10px; font-weight:750; }
.ds-small-action { padding:6px 6px; color:var(--ds-muted); font-size:9px; font-weight:650; }
.ds-small-text { border:0; padding:2px; background:transparent; box-shadow:none; color:var(--ds-accent); font-size:9px; font-weight:750; }
.ds-iteration-note { display:block; padding-top:6px; color:var(--ds-muted); font-size:8px; line-height:1.35; }
.ds-layer-row { display:flex; align-items:center; gap:3px; min-width:0; }
.ds-layer-select { display:flex; align-items:center; gap:7px; width:100%; min-width:0; padding:5px 6px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--ds-text); text-align:left; cursor:pointer; }
.ds-layer-row.is-active .ds-layer-select { border-color:var(--ds-rule); background:var(--ds-control-strong); }
.ds-layer-eye { color:var(--ds-accent); font-size:11px; }
.ds-layer-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; font-size:9px; }
.ds-layer-count { color:var(--ds-muted); font-size:8px; }
.ds-layer-lock { border:0; background:transparent; color:var(--ds-muted); cursor:pointer; font-size:12px; }
.ds-layer-row.is-locked .ds-layer-name::after { content:" · trace"; color:var(--ds-muted); font-size:8px; }
.ds-trace-action { width:100%; margin-top:5px; }
.ds-storage-note { display:flex; align-items:center; gap:7px; margin-top:auto; padding:5px 7px; color:var(--ds-muted); font-size:8px; line-height:1.4; }
.ds-storage-note b { font-weight:700; color:var(--ds-text); }
.ds-storage-dot { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:#5d9168; box-shadow:0 0 0 3px rgba(91,145,104,.14); }
.ds-suggestion { display:flex; align-items:center; gap:8px; padding:8px; border:1px solid rgba(78,121,86,.26); border-radius:11px; background:var(--ds-accent-wash); }
.ds-suggestion-mark { color:var(--ds-accent); font-size:17px; }
.ds-suggestion-copy { display:flex; flex-direction:column; min-width:0; gap:2px; flex:1; }
.ds-suggestion-copy b { font-size:10px; }
.ds-suggestion-copy span, .ds-suggestion-copy small { color:var(--ds-muted); font-size:8px; }
.ds-suggestion-actions { display:flex; flex-direction:column; gap:3px; align-items:stretch; }
.ds-suggestion-accept, .ds-suggestion-dismiss { padding:5px 7px; font-size:8px; font-weight:700; white-space:nowrap; }
.ds-suggestion-accept { color:var(--ds-text); background:var(--ds-control-strong); }
.ds-suggestion-dismiss { color:var(--ds-muted); background:transparent; box-shadow:none; }
.ds-proposal-evidence { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr)); gap:5px; min-width:0; margin-top:5px; padding-top:6px; border-top:1px solid var(--ds-rule); }
.ds-proposal-evidence>b, .ds-proposal-evidence>small { grid-column:1/-1; }
.ds-proposal-evidence>b { color:var(--ds-text); font-size:8px; }
.ds-proposal-evidence>small { color:var(--ds-muted); font-size:8px; line-height:1.35; }
.ds-proposal-evidence-link { display:grid; gap:2px; min-width:0; padding:6px 7px; border:1px solid var(--ds-rule); border-radius:7px; background:var(--ds-control); color:var(--ds-text); text-align:left; cursor:pointer; }
.ds-proposal-evidence-link>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; font-weight:700; }
.ds-proposal-evidence-link>small { color:var(--ds-muted); font-size:7px; line-height:1.3; }
.ds-proposal-evidence-link>.ds-proposal-evidence-location { color:var(--ds-text); }
.ds-proposal-evidence-link:disabled { opacity:.55; cursor:not-allowed; }
.ds-proposal-evidence-link:focus-visible { outline:2px solid var(--ds-accent); outline-offset:2px; }
.ds-toast { position:absolute; z-index:8; left:50%; bottom:15px; transform:translate(-50%,8px); max-width:calc(100% - 24px); padding:8px 12px; border:1px solid var(--ds-rule); border-radius:9px; background:var(--ds-text); color:var(--ds-ground); box-shadow:0 6px 18px rgba(0,0,0,.2); font-size:10px; opacity:0; pointer-events:none; transition:opacity .15s,transform .15s; }
.ds-toast.is-visible { opacity:1; transform:translate(-50%,0); }
.ds-popover { position:absolute; z-index:12; top:74px; left:12px; width:min(340px,calc(100% - 24px)); max-height:min(440px,calc(100% - 100px)); overflow:auto; padding:10px; border:1px solid var(--ds-rule); border-radius:13px; background:var(--ds-ground); box-shadow:0 12px 32px rgba(24,37,28,.2); }
.ds-popover[hidden] { display:none; }
.ds-popover-head { display:flex; justify-content:space-between; align-items:center; padding:1px 3px 8px; font-size:11px; }
.ds-popover-status, .ds-empty-local { padding:5px 3px 9px; color:var(--ds-muted); font-size:9px; }
.ds-saved-row { display:flex; align-items:center; gap:5px; border-top:1px solid var(--ds-rule); }
.ds-saved-open, .ds-menu-choice { flex:1; display:flex; flex-direction:column; min-width:0; gap:2px; padding:8px 5px; border:0; border-radius:7px; background:transparent; text-align:left; cursor:pointer; }
.ds-saved-open:hover, .ds-menu-choice:hover { background:var(--ds-control-strong); }
.ds-saved-open b, .ds-menu-choice b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.ds-saved-open small, .ds-menu-choice small { color:var(--ds-muted); font-size:8px; }
.ds-file-command-list { display:grid; grid-template-columns:1fr 1fr; gap:2px; padding-bottom:6px; border-bottom:1px solid var(--ds-rule); }
.ds-file-command-list .ds-menu-choice { min-height:55px; padding:8px; }
.ds-popover-subheading { padding:8px 3px 4px; color:var(--ds-muted); font-size:8px; font-weight:800; letter-spacing:.12em; }
.ds-modal-backdrop { position:absolute; z-index:16; inset:0; display:grid; place-items:center; padding:18px; background:rgba(17,27,20,.35); backdrop-filter:blur(3px); }
.drafting-studio .ds-modal-backdrop { z-index:80; }
.ds-modal-backdrop[hidden] { display:none; }
.ds-modal { width:min(390px,100%); padding:16px; border:1px solid var(--ds-rule); border-radius:16px; background:var(--ds-ground); box-shadow:0 18px 45px rgba(0,0,0,.25); }
.ds-modal > header { display:flex; justify-content:space-between; align-items:center; }
.ds-modal-close { width:25px; height:25px; border:0; border-radius:50%; background:var(--ds-control); cursor:pointer; font-size:18px; }
.ds-modal h2 { margin:6px 0 14px; font-size:18px; letter-spacing:-.03em; }
.ds-modal-note { margin:-7px 0 12px; color:var(--ds-muted); font-size:10px; line-height:1.45; }
.ds-modal.is-iteration-comparison { width:min(960px,100%); max-height:min(82dvh,calc(100% - 12px),780px); overflow:auto; }
.ds-iteration-comparison { min-width:0; }
.ds-iteration-compare-selects { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:end; gap:10px; margin:4px 0 12px; }
.ds-iteration-compare-selects label { display:grid; min-width:0; gap:4px; color:var(--ds-muted); font-size:10px; font-weight:700; }
.ds-iteration-compare-selects select { width:100%; min-width:0; min-height:38px; padding:7px 9px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control-strong); color:var(--ds-text); font:inherit; }
.ds-iteration-compare-mark { padding:0 3px 10px; color:var(--ds-muted); }
.ds-iteration-compare-previews { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.ds-iteration-compare-previews figure { min-width:0; margin:0; padding:7px; border:1px solid var(--ds-rule); border-radius:10px; background:var(--ds-control); }
.ds-iteration-compare-previews figcaption { min-height:29px; overflow-wrap:anywhere; padding:2px 3px 6px; color:var(--ds-muted); font-size:9px; font-weight:700; line-height:1.4; }
.ds-iteration-compare-previews img { display:block; width:100%; aspect-ratio:11/8.5; object-fit:contain; border:1px solid #d4d8d2; border-radius:6px; background:#fff; }
.ds-iteration-compare-accept { width:100%; min-height:40px; margin-top:7px; }
.ds-iteration-compare-accept[hidden] { display:none; }
.ds-iteration-compare-status { margin:8px 2px; color:var(--ds-muted); font-size:10px; line-height:1.45; }
.ds-iteration-compare-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.ds-iteration-compare-actions button { min-height:40px; padding:7px 11px; }
.ds-iteration-compare-actions button:disabled { opacity:.5; cursor:not-allowed; }
.ds-definition-form { display:flex; flex-direction:column; gap:11px; }
.ds-definition-form[hidden] { display:none; }
.ds-form-fields { display:grid; gap:9px; }
.ds-form-field { display:flex; flex-direction:column; gap:4px; font-size:10px; font-weight:650; }
.ds-form-field input, .ds-form-field select { width:100%; padding:8px 9px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control-strong); }
.ds-definition-form > .ds-primary-action { width:100%; }
@media (max-width:520px) {
  .ds-modal-backdrop { padding:10px; }
  .ds-modal.is-iteration-comparison { max-height:min(84dvh,calc(100% - 8px)); padding:12px; }
  .ds-iteration-compare-selects { gap:6px; }
  .ds-iteration-compare-previews { grid-template-columns:1fr; }
  .ds-iteration-compare-accept { min-height:44px; }
  .ds-iteration-compare-actions { display:grid; grid-template-columns:1fr; }
}

/* The construction proof is a paper-first review surface within the same
   local drawing. It expands over the applet canvas rather than shrinking the
   drawing workspace into a panel. */
.ds-construction-proof { position:absolute; z-index:20; inset:0; min-width:0; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:auto; padding:clamp(12px,2vw,24px); background:linear-gradient(145deg,#d8e0d5 0%,var(--ds-ground) 54%,#c5d0c3 100%); color:var(--ds-text); }
.drafting-studio[data-theme="dark"] .ds-construction-proof { background:linear-gradient(145deg,#303d37 0%,var(--ds-ground) 54%,#202b27 100%); }
.ds-construction-proof[hidden] { display:none; }
.ds-proof-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex:0 0 auto; }
.ds-proof-heading { display:grid; grid-template-columns:auto auto; align-items:baseline; column-gap:12px; min-width:0; }
.ds-proof-heading .ds-overline { grid-column:1/-1; }
.ds-proof-heading h2 { margin:3px 0 0; font-size:clamp(18px,2.2vw,25px); letter-spacing:-.04em; }
.ds-proof-subtitle { color:var(--ds-muted); font-size:10px; }
.ds-proof-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:5px; }
.ds-proof-actions button, .ds-proof-evidence-link { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:5px 9px; border:1px solid var(--ds-rule); border-radius:9px; background:var(--ds-control); box-shadow:var(--ds-shadow); color:var(--ds-text); text-decoration:none; cursor:pointer; font-size:10px; font-weight:650; white-space:nowrap; }
.ds-proof-actions button:hover, .ds-proof-evidence-link:hover { background:var(--ds-control-strong); }
.ds-proof-actions [data-action="construction-revise"] { background:var(--ds-accent-wash); }
.ds-proof-sheet-tabs { display:flex; flex:0 0 auto; gap:5px; overflow:auto; }
.ds-proof-sheet-tab { flex:0 0 auto; padding:6px 10px; border:1px solid transparent; border-radius:8px; color:var(--ds-muted); background:transparent; cursor:pointer; font-size:10px; font-weight:700; white-space:nowrap; }
.ds-proof-sheet-tab.is-active { color:var(--ds-text); border-color:var(--ds-rule); background:var(--ds-control); box-shadow:inset 0 1px rgba(255,255,255,.4); }
.ds-proof-status { flex:0 0 auto; color:var(--ds-muted); font-size:10px; }
.ds-proof-navigation { display:flex; align-items:center; gap:8px; min-width:0; flex:0 0 auto; }
.ds-proof-navigation .ds-proof-view-tabs { flex:1 1 auto; min-width:0; }
.ds-proof-viewport-controls { display:flex; align-items:center; gap:4px; flex:0 0 auto; }
.ds-proof-viewport-controls button { min-width:34px; min-height:30px; padding:4px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); cursor:pointer; font:inherit; font-size:9px; font-weight:700; }
.ds-proof-viewport-controls button[aria-pressed="true"] { color:#fff; border-color:var(--ds-accent); background:var(--ds-accent); }
.ds-proof-viewport-controls button:disabled { opacity:.45; cursor:not-allowed; }
.ds-proof-viewport-toggle { display:none; min-height:30px; padding:4px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); cursor:pointer; font:inherit; font-size:9px; font-weight:700; }
.ds-proof-viewport-toggle[aria-expanded="true"] { color:#fff; border-color:var(--ds-accent); background:var(--ds-accent); }
.ds-proof-sheet-tabs[hidden] { display:none; }
.ds-proof-content { display:grid; grid-template-columns:minmax(0,1fr) minmax(210px,280px); align-items:stretch; gap:12px; flex:1 1 auto; min-height:0; }
.ds-construction-proof:not(.is-inspector-open) .ds-proof-content { grid-template-columns:minmax(0,1fr); }
.ds-construction-proof:not(.is-inspector-open) .ds-proof-inspector { display:none; }
.ds-proof-sheet-frame { display:grid; min-width:0; min-height:300px; place-items:center; overflow:auto; padding:12px; border:1px solid rgba(60,78,62,.17); border-radius:15px; background:rgba(31,45,35,.08); box-shadow:inset 0 1px rgba(255,255,255,.32); }
.ds-proof-sheet { width:100%; height:100%; min-width:0; min-height:0; max-width:none; max-height:none; aspect-ratio:auto; background:transparent; touch-action:none; user-select:none; }
.ds-proof-sheet svg { display:block; width:100%; height:100%; background:transparent; }
.ds-construction-proof.is-focused .ds-proof-sheet-frame { min-height:0; padding:0; overflow:hidden; }
.ds-construction-proof.is-focused .ds-proof-sheet { width:100%; height:100%; max-width:none; max-height:none; aspect-ratio:auto!important; }
.ds-construction-proof.is-focused .ds-proof-sheet svg { width:100%; height:100%; background:#fff; }
.ds-construction-proof.is-focused .ds-proof-content { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.ds-construction-proof.is-focused:not(.is-inspector-open) .ds-proof-inspector { display:none; }
.ds-construction-proof.is-focused.is-inspector-open .ds-proof-content { grid-template-columns:minmax(0,1fr) minmax(210px,280px); grid-template-rows:minmax(0,1fr); }
.ds-proof-inspector { min-width:0; overflow:auto; padding:13px 15px; border:1px solid var(--ds-rule); border-radius:14px; background:var(--ds-control); box-shadow:var(--ds-shadow); }
.ds-proof-inspector section { padding:0 0 12px; margin:0 0 12px; border-bottom:1px solid var(--ds-rule); }
.ds-proof-inspector section:last-of-type { margin-bottom:8px; }
.ds-proof-inspector h3 { margin:0 0 7px; color:var(--ds-muted); font-size:9px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.ds-proof-material-row { display:flex; align-items:flex-start; gap:7px; margin:5px 0; color:var(--ds-text); font-size:9px; line-height:1.35; }
.ds-proof-material-row small { flex:0 0 44px; color:var(--ds-muted); font-size:8px; font-weight:750; letter-spacing:.04em; text-transform:uppercase; }
.ds-proof-assumptions { display:grid; gap:5px; margin:0; padding-left:15px; color:var(--ds-muted); font-size:9px; line-height:1.4; }
.ds-proof-revision { display:grid; gap:6px; color:var(--ds-muted); font-size:9px; line-height:1.4; }
.ds-proof-revision strong { color:var(--ds-text); }
.ds-proof-revision .ds-proof-update-source { min-height:44px; padding:8px 10px; border:1px solid var(--ds-rule); border-radius:9px; color:var(--ds-text); background:var(--ds-control); cursor:pointer; font:inherit; font-weight:750; text-align:left; }
.ds-proof-revision .ds-proof-update-source:hover { border-color:var(--ds-accent); }
.ds-proof-revision .ds-proof-update-source:focus-visible { outline:2px solid var(--ds-accent); outline-offset:2px; }
.ds-proof-revision .is-review { color:#9c563e; font-weight:750; }
.drafting-studio[data-theme="dark"] .ds-proof-revision .is-review { color:#e7a98f; }
.ds-proof-limit { margin:0; color:var(--ds-muted); font-size:8px; line-height:1.45; }
.ds-proof-view-tabs { display:flex; flex:0 0 auto; gap:5px; overflow-x:auto; scrollbar-width:thin; }
.ds-proof-view-tab { flex:0 0 auto; min-height:30px; padding:5px 9px; border:1px solid transparent; border-radius:8px; color:var(--ds-muted); background:transparent; cursor:pointer; font-size:9px; font-weight:700; white-space:nowrap; }
.ds-proof-view-tab.is-active { color:var(--ds-text); border-color:var(--ds-rule); background:var(--ds-control); }
.ds-authoring-tools { position:relative; display:flex; align-items:center; gap:5px; min-height:34px; flex:0 0 auto; padding:3px 5px; border:1px solid var(--ds-rule); border-radius:10px; background:rgba(255,255,255,.26); }
.ds-authoring-tools[hidden] { display:none; }
.ds-authoring-tools button, .ds-authoring-drawer button, .ds-authoring-tools select, .ds-authoring-drawer select, .ds-authoring-tools input, .ds-authoring-drawer input { min-height:30px; padding:4px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); font:inherit; font-size:10px; }
.ds-authoring-tools button, .ds-authoring-drawer button { cursor:pointer; font-weight:700; }
.ds-authoring-tools button.is-active, .ds-authoring-drawer button.is-active { color:#fff; border-color:var(--ds-accent); background:var(--ds-accent); }
.ds-authoring-tools .ds-authoring-hint { flex:1 1 auto; min-width:0; overflow:hidden; color:var(--ds-muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.ds-authoring-drawer { position:relative; z-index:6; display:flex; flex-wrap:wrap; align-items:center; gap:6px; flex:0 0 auto; padding:8px; border:1px solid var(--ds-rule); border-radius:11px; background:var(--ds-ground); box-shadow:var(--ds-shadow); }
.ds-authoring-drawer[hidden] { display:none; }
.ds-authoring-material, .ds-authoring-note-field, .ds-construction-document-label { display:flex; align-items:center; gap:5px; color:var(--ds-muted); font-size:9px; }
.ds-authoring-reference, .ds-authoring-line-layer, .ds-authoring-line-weight { display:flex; align-items:center; gap:5px; color:var(--ds-muted); font-size:9px; }
.ds-authoring-line-weight input { width:80px; }
.ds-assembly-editor { display:grid; gap:8px; min-width:0; }
.ds-assembly-editor[hidden] { display:none; }
.ds-assembly-editor label { display:grid; gap:4px; min-width:0; }
.ds-assembly-editor input, .ds-assembly-editor select, .ds-assembly-editor button { box-sizing:border-box; width:100%; min-width:0; min-height:40px; padding:6px; border:1px solid var(--ds-rule); border-radius:7px; background:var(--ds-ground); color:var(--ds-text); font:inherit; }
.ds-assembly-editor p, .ds-assembly-editor li { overflow-wrap:anywhere; line-height:1.5; }
.ds-construction-document-label { min-height:32px; padding:0 5px; }
.ds-construction-document-label[hidden] { display:none; }
.ds-construction-document-label select { max-width:150px; }
.ds-authoring-note-field input { min-width:180px; }
.ds-authoring-item-properties { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:7px; margin:0 0 8px; border:1px solid var(--ds-rule); border-radius:9px; }
.ds-authoring-item-properties > strong, .ds-authoring-item-note, .ds-authoring-item-properties > .ds-authoring-override { grid-column:1/-1; }
.ds-authoring-property { display:grid; gap:2px; color:var(--ds-muted); font-size:8px; }
.ds-authoring-property input { min-width:0; width:100%; min-height:32px; padding:5px 6px; border:1px solid var(--ds-rule); border-radius:7px; color:var(--ds-text); background:var(--ds-ground); font-size:10px; }
.ds-authoring-item-properties > strong { overflow-wrap:anywhere; font-size:9px; }
.ds-authoring-item-note { color:var(--ds-muted); font-size:8px; line-height:1.35; }
.ds-authoring-view-properties label { display:grid; gap:4px; margin:5px 0; color:var(--ds-muted); font-size:9px; }
.ds-authoring-view-properties select { min-height:34px; padding:5px; color:var(--ds-text); background:var(--ds-ground); border:1px solid var(--ds-rule); border-radius:7px; }
.ds-authoring-view-properties input { min-width:0; min-height:34px; padding:5px; color:var(--ds-text); background:var(--ds-ground); border:1px solid var(--ds-rule); border-radius:7px; }
.ds-authoring-view-properties p { margin:6px 0 0; color:var(--ds-muted); font-size:8px; line-height:1.4; }
.ds-authoring-viewport-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 8px; padding:7px; margin:7px 0; border:1px solid var(--ds-rule); border-radius:8px; }
.ds-authoring-viewport-fields legend { padding:0 4px; color:var(--ds-muted); font-size:8px; font-weight:750; }
.ds-authoring-view-properties .ds-authoring-viewport-fields label { margin:0; }
.ds-authoring-viewport-fields input { width:100%; }
.ds-authoring-view-properties [data-action="construction-fit-drawing-crop"] { min-height:34px; padding:5px 8px; border:1px solid var(--ds-rule); border-radius:8px; color:var(--ds-text); background:var(--ds-control); cursor:pointer; font:inherit; font-size:9px; font-weight:700; }
.ds-proof-inspector > section[hidden] { display:none; }
.ds-proof-sheet .drawing-item { cursor:pointer; }
.ds-proof-sheet .drawing-item.is-selected { filter:drop-shadow(0 0 1.5mm #d58a32); }
.ds-proof-actions button:disabled { opacity:.5; cursor:not-allowed; }
.ds-authoring-relationships button:disabled { opacity:.5; cursor:not-allowed; }
@container drafting-studio (max-width: 900px) {
  .ds-proof-header { align-items:flex-start; flex-direction:column; }
  .ds-proof-actions { justify-content:flex-start; }
  .ds-proof-content { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(200px,1fr) auto; }
  .ds-construction-proof.is-inspector-open .ds-proof-content { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(200px,1fr) auto; }
  .ds-proof-sheet-frame { min-height:0; }
  .ds-proof-inspector { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; max-height:min(30vh,280px); }
  .ds-proof-inspector section { min-width:0; }
  .ds-proof-limit { grid-column:1/-1; }
}
@container drafting-studio (max-width: 480px) {
  .ds-construction-toggle { gap:2px; padding:4px 5px; }
  .ds-proof-content { grid-template-rows:minmax(210px,1fr) auto; }
  .ds-proof-sheet-frame { min-height:220px; padding:5px; }
  .ds-proof-sheet { width:100%; min-height:0; height:auto; }
  .ds-proof-inspector { grid-template-columns:1fr; max-height:33vh; padding:10px; }
  .ds-proof-heading { grid-template-columns:1fr; }
  .ds-proof-subtitle { margin-top:2px; }
  .ds-proof-actions button, .ds-proof-evidence-link { min-height:36px; padding:5px 7px; }
}
@media (max-width: 860px) {
  .ds-main { grid-template-columns:minmax(0,1fr) 216px; }
}
@media (max-width: 690px) {
  .drafting-studio { gap:7px; padding:9px; }
  .ds-top { flex-direction:row; flex-wrap:nowrap; gap:6px; min-height:42px; }
  .ds-identity { flex:1 1 auto; min-width:0; }
  .ds-title { width:min(175px, 38vw); }
  body.windowed-layout .app-window[data-win-id="drafting-studio"] .drafting-studio .ds-title { min-height:28px!important; }
  .ds-save-state { font-size:9px; white-space:nowrap; }
  .ds-document-actions { gap:2px; }
  .ds-quiet-action { padding:4px 5px; font-size:9px; }
  .ds-tools-row { gap:5px; flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; padding:5px 6px; }
  .ds-tools, .ds-colors, .ds-history { flex:0 0 auto; }
  .ds-tool { min-width:50px; }
  .ds-tool-small { min-width:30px; width:30px; }
  .ds-colors { gap:6px; }
  .ds-views { min-height:31px; gap:5px; }
  .ds-view-tabs { flex:1 1 auto; }
  .ds-projection { flex:0 0 auto; }
  .ds-main { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(210px,1fr) auto; flex:1 1 auto; min-height:0; }
  .ds-stage { min-height:230px; }
  .ds-render-host { min-height:170px; }
  .ds-inspector { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; overflow:visible; }
  .ds-storage-note { grid-column:1/-1; }
  .ds-suggestion { grid-column:1/-1; }
}
@media (max-width: 430px) {
  .ds-top { gap:4px; }
  .ds-identity { flex:0 1 132px; }
  .ds-title { width:100%; min-width:0; font-size:14px!important; }
  .ds-overline { font-size:8px; }
  .ds-document-actions { flex:0 0 auto; gap:2px; }
  .ds-quiet-action { padding:3px; font-size:8px; }
  .ds-document-actions .ui-icon { width:10px; height:10px; }
  .ds-history { padding-left:0; }
  .ds-tools { gap:1px; }
  .ds-tool { min-width:42px; font-size:15px; }
  .ds-tool-small { width:27px; min-width:27px; }
  .ds-color { width:17px; height:17px; }
  .ds-projection button { padding:4px 5px; }
  .ds-inspector { grid-template-columns:1fr; }
  .ds-stage-bottom { gap:5px; }
  .ds-scale-readout { display:none; }
}
@media (max-width: 500px) {
  .ds-top { min-height:44px; }
  .ds-document-actions .ds-history button { width:40px; height:40px; }
}
@container drafting-studio (min-width: 431px) and (max-width: 470px) {
  .ds-tools-row { gap:5px; padding:5px 6px; }
  .ds-tools, .ds-colors, .ds-history { flex:0 0 auto; }
  .ds-tools { gap:3px; }
  .ds-tool { min-width:42px; height:34px; font-size:14px; }
  .ds-tool span { font-size:8px; }
  .ds-tool-small { min-width:26px; width:26px; height:30px; }
  .ds-tool-divider { margin:0; }
  .ds-colors { gap:4px; margin-left:0; }
  .ds-color { width:15px; height:15px; }
  .ds-history { gap:2px; padding-left:5px; }
  .ds-history button { width:23px; height:25px; font-size:16px; }
}
@media (max-width: 360px) {
  .app-window[data-win-id="drafting-studio"] > .window-titlebar { height:52px!important; min-height:52px!important; padding-block:4px; }
  .drafting-studio { padding:2px 8px 4px; }
  .ds-top { gap:4px; }
  .ds-identity { flex:0 1 78px; }
  .ds-overline, .ds-save-state { display:none; }
  .ds-title { width:100%; font-size:11px!important; }
  .ds-document-actions { gap:0; }
  .ds-quiet-action { width:44px; padding:2px; font-size:7px; }
  .ds-document-actions .ui-icon { width:9px; height:9px; }
}
@media (prefers-reduced-motion: reduce) {
  .drafting-studio *, .drafting-studio *::before, .drafting-studio *::after { transition-duration:.01ms!important; }
}

/* The applet responds to its actual card width. A five-app hand tile is a
   compact drafting surface even when the browser viewport is desktop-sized. */
@container drafting-studio (max-width: 700px) {
  .drafting-studio { gap:5px; padding:6px; overflow:hidden; }
  .ds-top { min-height:32px; gap:6px; }
  .ds-identity { min-width:0; flex:1 1 auto; flex-direction:row; align-items:center; gap:7px; }
  .ds-overline, .ds-save-state { display:none; }
  .ds-title { width:auto; min-width:0; flex:1 1 auto; font-size:14px!important; }
  .ds-document-actions { gap:2px; }
  .ds-document-actions .ds-history { margin-right:2px; padding-right:5px; }
  .ds-document-actions .ds-history button { width:30px; height:30px; }
  .ds-document-actions > .ds-quiet-action[data-action="new"],
  .ds-document-actions > .ds-quiet-action[data-action="open"],
  .ds-document-actions > .ds-quiet-action[data-action="save"],
  .ds-document-actions > .ds-quiet-action[data-action="export"] { display:none; }
  .ds-document-actions .ds-files-toggle { display:flex; padding:4px 7px; font-size:9px; }
  .ds-document-actions .ds-files-toggle .ui-icon { width:13px; height:13px; }
  .ds-tools-row { min-height:39px; gap:4px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; padding:3px 4px; border-radius:11px; }
  .ds-tools, .ds-colors, .ds-history { flex:0 0 auto; }
  .ds-tools { gap:2px; }
  .ds-tool { min-width:43px; height:33px; gap:1px; font-size:12px; }
  .ds-tool span:not(.ds-tool-icon) { font-size:8px; }
  .ds-tool-icon .ui-icon, .ds-tool-small .ds-tool-icon .ui-icon { width:17px; height:17px; }
  .ds-tool-small { min-width:26px; width:26px; height:30px; }
  .ds-tool-divider { height:24px; margin:0; }
  .ds-colors { gap:4px; margin-left:0; }
  .ds-color { width:15px; height:15px; }
  .ds-history { gap:2px; padding-left:4px; }
  .ds-history button { width:23px; height:24px; }
  .ds-history .ui-icon { width:14px; height:14px; }
  .ds-views { min-height:28px; gap:4px; }
  .ds-view-tabs { flex:1 1 auto; gap:2px; }
  .ds-view-tab { gap:4px; padding:4px 6px; font-size:9px; }
  .ds-view-tab small { font-size:7px; }
  .ds-add-view { display:flex; align-items:center; gap:3px; padding:4px 6px; font-size:9px; }
  .ds-details-toggle { gap:3px; padding:4px 6px; font-size:9px; }
  .ds-details-toggle .ui-icon { width:12px; height:12px; }
  .ds-spatial-toggle { gap:3px; padding:4px 6px; font-size:9px; }
  .ds-spatial-toggle .ui-icon { width:12px; height:12px; }
  .ds-main, .ds-main.is-inspector-open { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); min-height:140px; gap:0; }
  .ds-stage { min-height:0; border-radius:12px; }
  .ds-stage-top, .ds-stage-bottom { min-height:24px; gap:6px; padding:3px 7px; font-size:8px; }
  .ds-view-definition { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ds-plane-state { font-size:7px; }
  .ds-render-host { min-height:0; }
  .ds-stage-bottom { justify-content:flex-start; }
  .ds-tool-description, .ds-scale-readout { display:none; }
  .ds-intent-select { padding:3px 5px; font-size:7px; }
  .ds-inspector { display:none; position:absolute; z-index:9; inset:4px 4px 4px auto; width:min(390px, calc(100% - 8px)); max-height:calc(100% - 8px); padding:9px 11px; overflow:auto; border:1px solid var(--ds-rule); border-radius:14px; background:linear-gradient(155deg, #e3e9df, #d5ddd2); box-shadow:0 13px 30px rgba(24,37,28,.24), inset 0 1px rgba(255,255,255,.45); }
  .drafting-studio[data-theme="dark"] .ds-inspector { background:linear-gradient(155deg, #34423b, #293630); box-shadow:0 13px 30px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.06); }
  .ds-main.is-inspector-open .ds-inspector { display:flex; }
  .ds-inspector-section { padding:8px 2px; }
  .ds-inspector-head { min-height:27px; padding-bottom:2px; }
  .ds-view-copy { max-width:100%; }
  .ds-storage-note { margin-top:5px; }
  .ds-hint { left:7px; bottom:7px; max-width:calc(100% - 14px); padding:4px 6px 4px 8px; }
  .ds-hint b { font-size:8px; }
  .ds-hint span span { font-size:7px; }
  .ds-toast { bottom:8px; }
}

@container drafting-studio (max-width: 430px) {
  .ds-top { min-height:30px; gap:4px; }
  .ds-title { font-size:13px!important; }
  .ds-document-actions .ds-files-toggle { padding:3px 5px; font-size:8px; }
  .ds-tools-row { position:relative; z-index:4; min-height:44px; flex-wrap:nowrap; overflow:visible; row-gap:0; column-gap:4px; padding:3px; }
  .ds-tools { flex:1 1 auto; min-width:0; max-width:calc(100% - 48px); gap:1px; justify-content:space-between; }
  .ds-tool { min-width:32px; width:32px; height:38px; }
  .ds-tool-small { min-width:25px; width:25px; height:36px; }
  .ds-tool-divider { width:1px; }
  .ds-colors { flex:0 0 44px; width:44px; order:0; gap:0; margin-left:0; }
  .ds-color-current { display:flex; width:44px; height:44px; }
  .ds-color-options { display:none; position:absolute; z-index:15; top:calc(100% + 5px); left:0; gap:5px; width:max-content; padding:6px; border:1px solid var(--ds-rule); border-radius:12px; background:var(--ds-ground); box-shadow:0 10px 24px rgba(24,37,28,.24); }
  .ds-colors.is-open .ds-color-options { display:flex; }
  .ds-color-options .ds-color { flex:0 0 44px; width:44px; height:44px; border-width:2px; }
  .ds-views { gap:3px; }
  .ds-view-tab { max-width:140px; padding:4px 5px; }
  .ds-add-view { gap:2px; padding:4px 5px; }
  .ds-details-toggle { gap:2px; padding:4px 5px; }
  .ds-spatial-toggle { min-width:40px; min-height:40px; padding:3px 5px; }
  .ds-spatial-toggle .ds-spatial-label { font-size:8px; }
  .ds-hint > span { gap:4px; }
}

@container drafting-studio (max-width: 310px) {
  .drafting-studio { gap:2px; padding:3px 5px; }
  .ds-top { min-height:28px; }
  .ds-document-actions .ds-files-toggle { min-height:40px!important; }
  .ds-tools-row { row-gap:0; column-gap:3px; padding:2px; }
  .ds-tools { gap:0; }
  .ds-tool { min-width:31px!important; width:31px; }
  .ds-tool-small { min-width:24px!important; width:24px; }
  .ds-colors { gap:0; }
  .ds-color-current { min-width:44px!important; min-height:44px!important; }
  .ds-color-options { gap:4px; padding:5px; }
  .ds-color-options .ds-color { min-width:44px!important; min-height:44px!important; }
  .ds-document-actions .ds-history { gap:1px; margin-right:2px; padding-right:3px; }
  .ds-document-actions .ds-history button { width:40px!important; height:40px!important; min-width:40px!important; min-height:40px!important; }
  .ds-tool, .ds-view-tab, .ds-add-view, .ds-details-toggle { min-height:40px!important; }
  .ds-identity { flex-basis:0; }
  .ds-title { font-size:12px!important; }
  .ds-document-actions .ds-files-toggle { height:40px; padding:3px 5px; }
  .ds-document-actions .ds-files-toggle .ui-icon { width:13px; height:13px; }
  .ds-add-view > span:not([data-ds-icon]) { display:none; }
  .ds-add-view { width:28px; height:26px; justify-content:center; padding:3px; }
  .ds-add-view .ui-icon { width:15px; height:15px; }
  .ds-details-toggle > span:last-child { display:none; }
  .ds-details-toggle { width:28px; height:26px; justify-content:center; padding:3px; }
  .ds-details-toggle .ui-icon { width:15px; height:15px; }
  .ds-spatial-toggle { min-width:40px!important; width:40px; height:40px; }
  .ds-view-tab { max-width:110px; }
  .ds-hint span span { display:none; }
}

@container drafting-studio (max-width: 480px) {
  .ds-construction-proof { gap:5px; padding:6px; overflow-x:hidden; overflow-y:auto; }
  .ds-proof-header { align-items:center; flex-direction:row; gap:5px; min-height:32px; overflow:hidden; }
  .ds-proof-heading { display:none; }
  .ds-proof-actions { flex:1 1 auto; min-width:0; flex-wrap:nowrap; justify-content:flex-start; overflow-x:auto; scrollbar-width:thin; }
  .ds-proof-actions button, .ds-proof-evidence-link { flex:0 0 auto; min-height:34px; padding:4px 7px; font-size:9px; }
  .ds-proof-status { min-height:18px; overflow:hidden; font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
  .ds-authoring-tools { z-index:6; min-height:42px; gap:4px; padding:3px; }
  .ds-authoring-tools > button[data-authoring-tool] { display:none; min-height:40px; }
  .ds-authoring-tools > button[data-authoring-tool].is-active { display:flex; align-items:center; justify-content:center; flex:1 1 auto; }
  .ds-authoring-tools .ds-authoring-tools-more { min-width:58px; min-height:40px; }
  .ds-authoring-tools .ds-authoring-hint { display:none; }
  .ds-authoring-drawer { position:absolute; left:5px; right:5px; top:calc(100% + 4px); }
  .ds-authoring-drawer button, .ds-authoring-drawer select, .ds-authoring-drawer input { min-height:40px; }
  .ds-authoring-drawer .ds-authoring-note-field { flex:1 1 100%; }
  .ds-authoring-drawer .ds-authoring-note-field input { flex:1 1 auto; min-width:0; }
  .ds-proof-sheet-tabs { display:flex; flex:0 1 auto; min-width:0; width:100%; max-width:100%; gap:3px; min-height:30px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
  .ds-proof-sheet-tabs::-webkit-scrollbar, .ds-proof-navigation .ds-proof-view-tabs::-webkit-scrollbar { display:none; }
  .ds-proof-sheet-tab { min-width:0; max-width:74vw; min-height:29px; padding:4px 7px; overflow:hidden; text-overflow:ellipsis; text-align:left; white-space:nowrap; font-size:8px; }
  .ds-proof-navigation { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px; min-height:34px; }
  .ds-proof-navigation .ds-proof-view-tabs { grid-column:1; width:100%; gap:3px; min-height:34px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
  .ds-proof-view-tab { min-height:32px; padding:4px 7px; font-size:8px; }
  .ds-proof-viewport-toggle { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; min-width:60px; min-height:34px; }
  .ds-proof-viewport-toggle { grid-column:2; grid-row:1; }
  .ds-proof-viewport-controls { position:static; grid-column:1/-1; display:none; width:100%; justify-content:space-between; gap:2px; padding:3px 2px 0; border:0; border-top:1px solid var(--ds-rule); border-radius:0; background:transparent; box-shadow:none; }
  .ds-construction-proof.is-viewport-controls-open .ds-proof-viewport-controls { display:flex; }
  .ds-proof-viewport-controls button { min-width:34px; min-height:34px; padding:4px 6px; font-size:8px; }
  .ds-proof-content { position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); flex:1 1 auto; min-height:0; }
  .ds-construction-proof.is-focused.is-inspector-open .ds-proof-content { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
  .ds-proof-sheet-frame { min-height:0; padding:3px; overflow:auto; }
  .ds-proof-sheet { width:100%; height:100%; min-height:0; max-height:none; aspect-ratio:auto; }
  .ds-construction-proof.is-focused .ds-proof-sheet-frame { overflow:hidden; }
  .ds-proof-inspector { display:none; position:absolute; z-index:12; inset:8% 3px 3px; width:auto; max-height:none; padding:12px; overflow:auto; border-radius:13px; background:var(--ds-ground); box-shadow:0 12px 30px rgba(0,0,0,.28); }
  .ds-construction-proof.is-inspector-open .ds-proof-inspector { display:block; }
  .ds-proof-inspector section { display:block; }
  .ds-proof-inspector .ds-authoring-item-properties { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Canvas navigation stays available without leaving the drawing tool. */
.ds-navigation { position:absolute; z-index:3; top:9px; right:9px; display:flex; align-items:center; gap:3px; padding:3px; border:1px solid var(--ds-rule); border-radius:9px; background:var(--ds-ground); box-shadow:var(--ds-shadow); }
.ds-navigation button { min-width:30px; min-height:30px; padding:4px 8px; border:0; border-radius:6px; color:var(--ds-text); background:var(--ds-control); font:500 11px/1.2 var(--font-sans,system-ui); cursor:pointer; }
.ds-navigation button:hover { background:var(--ds-control-strong); }
.ds-navigation button:focus-visible { outline:2px solid var(--ds-accent); outline-offset:1px; }
.ds-navigation > span { padding:0 6px; color:var(--ds-muted); font-size:10px; }
@container drafting-studio (max-width:700px) {
  .ds-navigation { top:5px; right:5px; }
  .ds-navigation > span { display:none; }
  .ds-navigation button { min-width:32px; min-height:32px; padding:4px 6px; font-size:10px; }
}
@container drafting-studio (max-width:430px) {
  .ds-details-toggle > span:last-child, .ds-construction-toggle > span:last-child { display:none; }
  .ds-construction-toggle { flex:0 0 40px; min-width:40px; min-height:40px; width:40px; padding:3px; }
}

/* The drawing owns the applet. Controls are small floating islands, never
   reserved rows or columns; open menus and inspectors remain over the work. */
.drafting-studio { padding:0; gap:0; overflow:hidden; }
.drafting-studio .ds-main { position:absolute; inset:0; min-height:0; display:block; }
.drafting-studio .ds-stage { position:absolute; inset:0; min-height:0; border:0; border-radius:0; }
.drafting-studio .ds-render-host { position:absolute; inset:0; min-height:0; }
.drafting-studio .ds-top, .drafting-studio .ds-views, .drafting-studio .ds-tools-row,
.ds-proof-command-bar, .drafting-studio .ds-authoring-tools, .drafting-studio .ds-proof-navigation,
.drafting-studio .ds-proof-sheet-tabs { position:absolute; z-index:24; width:max-content; max-width:calc(100% - 20px); margin:0; padding:5px; border:1px solid var(--ds-rule); border-radius:12px; background:var(--ds-ground); box-shadow:var(--ds-shadow); }
.drafting-studio .ds-top { z-index:10; top:10px; left:10px; min-height:42px; gap:12px; }
.drafting-studio .ds-identity { flex:1 1 auto; display:flex; flex-direction:row; align-items:center; gap:8px; min-width:0; }
.drafting-studio .ds-overline, .drafting-studio .ds-top .ds-save-state { display:none; }
.drafting-studio .ds-title { width:190px; min-width:0; font-size:13px!important; }
.drafting-studio .ds-document-actions > .ds-quiet-action:not(.ds-files-toggle) { display:none; }
.drafting-studio .ds-files-toggle { display:flex; min-height:32px; }
.drafting-studio .ds-history button { width:32px; height:32px; }
.drafting-studio .ds-views { z-index:9; left:10px; top:64px; min-height:34px; gap:4px; }
.drafting-studio .ds-tools-row { z-index:12; left:10px; bottom:10px; min-height:48px; gap:8px; }
.drafting-studio .ds-tool { min-width:44px; height:38px; }
.drafting-studio .ds-tool-small { min-width:32px; width:32px; }
.drafting-studio .ds-colors { margin-left:0; }
.ds-tools-menu,.ds-view-more,.ds-proof-command-bar button { min-height:32px; padding:5px 9px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control); color:var(--ds-text); font-size:11px; cursor:pointer; }
.drafting-studio .ds-navigation { top:10px; right:10px; }
.drafting-studio .ds-navigation > span { display:none; }
.drafting-studio .ds-stage-top { position:absolute; z-index:3; left:10px; bottom:70px; min-height:22px; max-width:calc(100% - 20px); padding:3px 7px; border:0; border-radius:7px; background:var(--ds-ground); pointer-events:none; }
.drafting-studio .ds-stage-bottom { position:absolute; z-index:4; right:10px; bottom:10px; min-height:32px; padding:0; background:transparent; }
.drafting-studio .ds-tool-description,.drafting-studio .ds-scale-readout { display:none; }
.drafting-studio .ds-hint { bottom:102px; }
.drafting-studio .ds-inspector { display:none; position:absolute; z-index:19; inset:108px 10px 10px auto; width:min(320px,calc(100% - 20px)); max-height:none; padding:12px; border:1px solid var(--ds-rule); border-radius:12px; background:var(--ds-ground); box-shadow:var(--ds-shadow); overflow:auto; }
.drafting-studio .ds-main.is-inspector-open .ds-inspector { display:flex; }
.drafting-studio .ds-drawing-tools-drawer { position:absolute; z-index:18; left:10px; bottom:70px; top:auto; max-width:calc(100% - 20px); background:var(--ds-ground); }
.drafting-studio .ds-view-drawer { position:absolute; top:calc(100% + 6px); right:0; z-index:18; min-width:170px; padding:6px; border:1px solid var(--ds-rule); border-radius:10px; background:var(--ds-ground); box-shadow:var(--ds-shadow); }
.drafting-studio .ds-view-drawer:not([hidden]) { display:grid; gap:5px; }
.drafting-studio .ds-view-drawer button { min-height:34px; padding:5px 10px; text-align:left; background:var(--ds-control); border:0; border-radius:6px; }
.drafting-studio .ds-view-drawer .ds-cross-view-datum-status { width:min(36ch,100%); margin:0; padding:6px 8px; border-left:2px solid var(--ds-accent); color:var(--ds-muted); font-size:10px; line-height:1.45; overflow-wrap:anywhere; }
.drafting-studio .ds-construction-proof { padding:0; gap:0; overflow:hidden; }
.drafting-studio .ds-proof-content,.drafting-studio .ds-construction-proof.is-focused.is-inspector-open .ds-proof-content { position:absolute; inset:0; display:block; min-height:0; }
.drafting-studio .ds-proof-sheet-frame { position:absolute; inset:0; padding:0; min-height:0; border:0; border-radius:0; }
.ds-proof-command-bar { top:10px; left:10px; display:flex; gap:5px; }
.drafting-studio .ds-proof-header { display:none; position:absolute; z-index:32; left:10px; top:60px; width:min(500px,calc(100% - 20px)); max-height:calc(100% - 140px); overflow:auto; padding:14px; border:1px solid var(--ds-rule); border-radius:12px; background:var(--ds-ground); box-shadow:var(--ds-shadow); }
.drafting-studio .is-commands-open .ds-proof-header { display:flex; flex-direction:column; align-items:stretch; }
.drafting-studio .ds-proof-heading { display:block; }
.drafting-studio .ds-proof-heading h2 { font-size:16px; }
.drafting-studio .ds-proof-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; overflow:visible; }
.drafting-studio .ds-proof-actions button { flex:1 0 auto; min-height:36px; }
.drafting-studio .ds-proof-navigation { right:10px; top:10px; max-width:calc(100% - 280px); flex-wrap:nowrap; gap:5px; }
.drafting-studio .ds-proof-sheet-tabs { left:10px; top:64px; max-width:calc(100% - 20px); }
.drafting-studio .ds-proof-status { position:absolute; z-index:22; bottom:66px; right:10px; max-width:calc(100% - 20px); padding:3px 7px; border-radius:7px; background:var(--ds-ground); font-size:9px; pointer-events:none; }
.drafting-studio .ds-authoring-tools { bottom:10px; left:10px; min-height:40px; }
.drafting-studio .ds-authoring-hint { display:none; }
.drafting-studio .ds-authoring-drawer { position:absolute; z-index:30; left:10px; bottom:64px; top:auto; right:auto; width:min(650px,calc(100% - 20px)); max-height:calc(100% - 140px); overflow:auto; }
.drafting-studio .ds-proof-inspector { display:none; position:absolute; z-index:29; top:64px; bottom:64px; right:10px; width:min(360px,calc(100% - 20px)); max-height:none; background:var(--ds-ground); }
.drafting-studio .ds-construction-proof.is-inspector-open .ds-proof-inspector { display:block; }
.ds-context-menu { position:absolute; z-index:60; width:230px; max-width:calc(100% - 12px); max-height:calc(100% - 12px); overflow:auto; display:grid; gap:2px; padding:6px; border:1px solid var(--ds-rule); border-radius:12px; background:var(--ds-ground); color:var(--ds-text); box-shadow:0 12px 35px rgba(0,0,0,.25); }
.ds-context-menu[hidden] { display:none; }
.ds-context-menu button { min-height:32px; padding:5px 9px; border:0; border-radius:6px; background:transparent; color:inherit; text-align:left; cursor:pointer; font-size:12px; }
.ds-context-menu button:hover,.ds-context-menu button:focus-visible { background:var(--ds-accent-wash); outline:2px solid var(--ds-accent); outline-offset:-2px; }
.ds-context-menu button:disabled { opacity:.4; cursor:default; }
.ds-context-heading { padding:7px 9px 3px; color:var(--ds-muted); font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
@container drafting-studio (max-width:700px) {
  .drafting-studio .ds-top { right:10px; width:auto; gap:5px; }
  .drafting-studio .ds-title { width:120px; flex:1 1 auto; }
  .drafting-studio .ds-views { right:10px; width:auto; }
  .drafting-studio .ds-navigation { top:110px; }
  .drafting-studio .ds-tools-row { right:10px; width:auto; gap:4px; }
  .drafting-studio .ds-stage-bottom { bottom:70px; }
  .drafting-studio .ds-stage-top { bottom:106px; }
  .drafting-studio .ds-hint { bottom:136px; }
  .drafting-studio .ds-proof-navigation { top:60px; right:10px; left:10px; max-width:none; width:auto; }
  .drafting-studio .ds-proof-sheet-tabs { top:110px; }
  .drafting-studio .ds-tools { max-width:calc(100% - 48px); }
  .drafting-studio .ds-colors { flex-shrink:0; }
}
.drafting-studio[data-theme] .ds-tools-row { background:var(--ds-ground); }
.drafting-studio .ds-intent-select { background:var(--ds-ground); color:var(--ds-text); }
.drafting-studio .ds-view-tab { min-width:0; overflow:hidden; text-overflow:ellipsis; flex-shrink:1; }

/* Drawing Studio uses the window manager's reversible maximize/restore state. */
.app-window[data-win-id="drafting-studio"].win-maximized,body.workspace-hand-enabled .app-window[data-win-id="drafting-studio"].workspace-seated.win-maximized { position:fixed!important; inset:0!important; left:0!important; top:0!important; right:0!important; bottom:0!important; width:100vw!important; height:100vh!important; height:100dvh!important; min-width:0!important; min-height:0!important; max-width:none!important; max-height:none!important; margin:0!important; transform:none!important; border-radius:0!important; overflow:hidden!important; transition:none!important; }
.drafting-studio .ds-navigation [data-action="studio-expand"] { min-width:92px; white-space:nowrap; border:1px solid var(--ds-accent); font-weight:700; }
@media (pointer:coarse) { .drafting-studio .ds-navigation [data-action="studio-expand"] { min-height:44px; } }

/* Drawing Studio's tutorial uses only a miniature, disposable SVG scene. */
.ds-guide-dialog { width:min(880px,calc(100vw - 28px)); max-width:none; max-height:calc(100dvh - 24px); margin:auto; padding:0; overflow:auto; border:1px solid #829386; border-radius:20px; background:#f5f4ec; color:#26332e; box-shadow:0 26px 90px #10191355; }
.ds-guide-dialog::backdrop { background:#17231dcc; backdrop-filter:blur(4px); }
.ds-guide-shell { min-height:0; display:grid; gap:15px; padding:clamp(14px,3vw,26px); }
.ds-guide-header,.ds-guide-footer,.ds-guide-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.ds-guide-kicker { color:#567462; font:750 10px/1.4 var(--font-sans,system-ui); letter-spacing:.12em; }
.ds-guide-header h2 { margin:3px 0 0; color:#26332e; font:650 clamp(19px,3vw,25px)/1.2 var(--font-sans,system-ui); }
.ds-guide-dialog button { min-height:38px; padding:8px 11px; border:1px solid #b4beb4; border-radius:9px; background:#eeefe7; color:#293a32; font:650 12px/1.25 var(--font-sans,system-ui); cursor:pointer; }
.ds-guide-dialog button:hover { background:#e2e8df; }
.ds-guide-dialog button:focus-visible,.ds-guide-dialog input:focus-visible { outline:3px solid #4e785e; outline-offset:2px; }
.ds-guide-dialog .ds-guide-close { width:40px; min-width:40px; padding:0; border-radius:50%; font-size:22px; }
.ds-guide-progress { display:grid; grid-template-columns:auto minmax(80px,1fr); align-items:center; gap:12px; color:#65756b; font:700 10px/1.2 var(--font-sans,system-ui); }
.ds-guide-progress-track { height:4px; overflow:hidden; border-radius:4px; background:#dbe1d8; }
.ds-guide-progress-track span { display:block; height:100%; border-radius:inherit; background:#5b8068; transition:width .28s ease; }
.ds-guide-body { display:grid; grid-template-columns:minmax(210px,.8fr) minmax(0,1.2fr); gap:18px; align-items:stretch; }
.ds-guide-story { display:flex; flex-direction:column; align-items:flex-start; }
.ds-guide-step-label { color:#567462; font:750 10px/1.4 var(--font-sans,system-ui); letter-spacing:.1em; }
.ds-guide-story h3 { margin:8px 0; color:#26332e; font:650 clamp(18px,2.4vw,23px)/1.25 var(--font-sans,system-ui); }
.ds-guide-story p { margin:0; color:#45564d; font:400 13px/1.55 var(--font-sans,system-ui); }
.ds-guide-safe-note { display:flex; gap:8px; margin-top:14px; padding:10px; border:1px solid #cfdbce; border-radius:10px; background:#edf2ea; color:#455b4d; font:500 11px/1.4 var(--font-sans,system-ui); }
.ds-guide-safe-note span:first-child { font-size:17px; }
.ds-guide-preference { display:flex; align-items:center; gap:7px; margin-top:auto; padding-top:15px; color:#3a4d42; font:600 11px/1.4 var(--font-sans,system-ui); cursor:pointer; }
.ds-guide-preference input { width:17px; height:17px; margin:0; accent-color:#52755d; }
.ds-guide-preview { position:relative; min-width:0; overflow:hidden; align-self:stretch; padding:9px; border:1px solid #d3dbd1; border-radius:14px; background:#e9eee6; }
.ds-guide-preview-tabs { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.ds-guide-preview-tabs button { min-height:30px; padding:5px 9px; font-size:10px; }
.ds-guide-preview-tabs button[aria-selected="true"] { border-color:#5e8068; background:#dce8dc; color:#283f30; }
.ds-guide-figure { margin:0; overflow:hidden; border-radius:9px; }
.ds-guide-figure svg { display:block; width:100%; height:auto; max-height:min(32vh,260px); }
.ds-guide-preview-caption { padding:7px 2px 1px; color:#53645a; font:500 10px/1.4 var(--font-sans,system-ui); }
.ds-guide-hand { position:absolute; right:5%; bottom:20%; z-index:2; width:56px; filter:drop-shadow(0 4px 3px #1a2e2430); pointer-events:none; animation:ds-guide-swoop 4s ease-in-out infinite; transform-origin:60% 70%; transition:right .7s cubic-bezier(.2,.8,.2,1),bottom .7s cubic-bezier(.2,.8,.2,1); }
.ds-guide-dialog[data-guide-step="1"] .ds-guide-hand { right:39%; bottom:44%; }
.ds-guide-dialog[data-guide-step="2"] .ds-guide-hand { right:54%; bottom:54%; }
.ds-guide-dialog[data-guide-step="3"] .ds-guide-hand { right:13%; bottom:27%; }
.ds-guide-dialog[data-guide-step="4"] .ds-guide-hand { right:61%; bottom:34%; }
.ds-guide-hand svg { display:block; width:100%; height:auto; }
@keyframes ds-guide-swoop { 0%,12% { transform:translate(22px,14px) rotate(-13deg) scale(.94); } 28% { transform:translate(-5px,-3px) rotate(7deg) scale(1); } 34%,51% { transform:translate(-5px,-3px) rotate(7deg) scale(.97); } 62% { transform:translate(-25px,-16px) rotate(-7deg) scale(1.02); } 68%,84% { transform:translate(-25px,-16px) rotate(-7deg) scale(.98); } 100% { transform:translate(22px,14px) rotate(-13deg) scale(.94); } }
.ds-guide-footer { padding-top:2px; border-top:1px solid #d5ddd4; }
.ds-guide-link { border-color:transparent!important; background:transparent!important; color:#4b7056!important; }
.ds-guide-actions { justify-content:flex-end; flex-wrap:wrap; }
.ds-guide-primary { border-color:#547760!important; background:#567b61!important; color:#fff!important; }
.ds-guide-primary:hover { background:#466b51!important; }
.ds-guide-dialog button[hidden] { display:none!important; }
@media(max-width:620px) { .ds-guide-body { grid-template-columns:1fr; gap:12px; } .ds-guide-preview { order:-1; } .ds-guide-figure svg { max-height:min(27vh,200px); } .ds-guide-hand { width:42px; } .ds-guide-footer { align-items:stretch; flex-direction:column; } .ds-guide-link { align-self:flex-start; } .ds-guide-actions { justify-content:flex-start; } }
@media(max-width:390px) { .ds-guide-actions button { flex:1 1 auto; } .ds-guide-header h2 { max-width:245px; } }
@media(prefers-reduced-motion:reduce) { .ds-guide-hand,.ds-guide-progress-track span { animation:none!important; transition:none!important; } }
@container drafting-studio (max-width:430px) {
  .drafting-studio .ds-view-tab small { display:none; }
}
.drafting-studio .ds-drawing-tools-drawer:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; width:230px; max-height:calc(100% - 140px); overflow:auto; padding:8px; border:1px solid var(--ds-rule); border-radius:12px; box-shadow:var(--ds-shadow); }
.drafting-studio .ds-drawing-tools-drawer .ds-tool { display:flex; flex-direction:row; gap:8px; width:auto; min-width:0; }
@container drafting-studio (max-width:430px) {
  .drafting-studio .ds-views > .ds-add-view,.drafting-studio .ds-views > .ds-details-toggle,.drafting-studio .ds-views > .ds-construction-toggle { display:none; }
  .drafting-studio .ds-view-tabs { flex:1 1 auto; min-width:0; }
  .drafting-studio .ds-tools-row { right:auto; width:max-content; }
  .drafting-studio .ds-tools { max-width:none; }
  .drafting-studio .ds-tools .ds-tool { display:none; }
  .drafting-studio .ds-tools .ds-tool.is-active { display:flex; min-width:52px; width:52px; }
  .drafting-studio .ds-tool-divider { display:none; }
  .drafting-studio .ds-colors { position:static; }
  .drafting-studio .ds-color-options { top:auto; bottom:calc(100% + 6px); left:0; right:auto; }
  .drafting-studio .ds-stage-bottom { bottom:10px; }
}

/* A view must be entered before its marks can be edited. */
.drafting-studio button[data-tool]:disabled,
.drafting-studio button[data-authoring-tool]:disabled { opacity:.35; cursor:default; box-shadow:none; }
.ds-plane-manager{display:grid;gap:4px;max-height:260px;overflow:auto;border-bottom:1px solid var(--ds-rule);padding-bottom:6px}.ds-plane-row{display:grid;grid-template-columns:minmax(105px,1fr) repeat(4,auto);gap:3px;align-items:center}.ds-plane-row>span{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ds-plane-row small{display:block;color:var(--ds-muted);font-size:9px}.drafting-studio .ds-plane-row button{min-width:36px;min-height:36px;padding:4px;font-size:10px;text-align:center}.drafting-studio .ds-view-drawer{width:min(420px,calc(100vw - 40px));max-height:min(540px,calc(100vh - 180px));overflow:auto}.ds-placement-panel{position:absolute;z-index:25;top:110px;right:10px;width:min(300px,calc(100% - 20px));max-height:calc(100% - 125px);overflow:auto;box-sizing:border-box;padding:12px;border:1px solid var(--ds-rule);border-radius:12px;background:var(--ds-ground);color:var(--ds-text);box-shadow:var(--ds-shadow);font-size:11px}.ds-placement-panel[hidden]{display:none}.ds-placement-panel p{color:var(--ds-muted);line-height:1.4}.ds-placement-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.ds-placement-fields label{font-size:10px}.ds-placement-fields input{width:100%;box-sizing:border-box;min-height:36px;background:var(--ds-control);color:var(--ds-text);border:1px solid var(--ds-rule);border-radius:5px}.ds-panel-actions{display:flex;gap:8px;margin-top:10px}.ds-panel-actions button{min-height:40px;flex:1}.ds-version-choice{pointer-events:auto;color:var(--ds-text);background:transparent;border:0;font-size:10px;cursor:pointer}.ds-plane-state{display:flex;align-items:center;gap:3px}.ds-placement-position{display:block;margin-top:8px}.drafting-studio:has(.ds-placement-panel:not([hidden])) .ds-tools button:not([data-tool=orbit]){opacity:.35}
@media(max-width:500px){.drafting-studio .ds-plane-row button{min-height:44px}.ds-plane-row{grid-template-columns:minmax(72px,1fr) repeat(4,auto)}.drafting-studio .ds-plane-row button{min-width:33px;font-size:9px}.ds-placement-fields input{min-height:44px}}
.ds-spatial-development,.ds-geometry-editor{border-bottom:1px solid var(--ds-rule);padding:8px 0;display:grid;gap:7px}.ds-spatial-development[hidden]{display:none}.ds-spatial-development h3,.ds-geometry-editor h3{margin:0}.ds-spatial-development p,.ds-geometry-editor p{font-size:11px;line-height:1.4;color:var(--ds-muted);margin:0}.ds-spatial-development label,.ds-geometry-editor label{display:grid;gap:3px;font-size:11px}.ds-spatial-development input,.ds-spatial-development select,.ds-geometry-editor input,.ds-geometry-editor select{max-width:100%;box-sizing:border-box;min-height:34px;color:var(--ds-text);background:var(--ds-control);border:1px solid var(--ds-rule);border-radius:5px}.ds-spatial-development button,.ds-geometry-editor button{min-height:36px;color:var(--ds-text);background:var(--ds-control);border:1px solid var(--ds-rule);border-radius:6px}.ds-geometry-editor fieldset{display:grid;gap:4px}.ds-geometry-editor fieldset label{display:flex;align-items:center;gap:6px}.ds-geometry-editor fieldset input{min-height:auto}.ds-spatial-development small{overflow-wrap:anywhere;font-size:10px}
.ds-geometry-editor .ds-revit-mass-export button{min-height:44px;padding:8px;text-align:left;white-space:normal}
.ds-geometry-editor .ds-revit-native-walls button{min-height:44px;padding:8px;text-align:left;white-space:normal}.ds-revit-native-walls{display:grid;gap:7px;margin-top:8px;padding-top:8px;border-top:1px solid var(--ds-rule)}.ds-revit-native-walls select{max-width:100%;min-height:44px;color:var(--ds-text);background:var(--ds-control);border:1px solid var(--ds-rule);border-radius:5px}
.ds-geometry-editor .ds-revit-commercial-walls button{min-height:44px;padding:8px;text-align:left;white-space:normal}.ds-revit-commercial-walls{display:grid;gap:7px;margin-top:8px;padding-top:8px;border-top:1px solid var(--ds-rule)}.ds-revit-commercial-walls select{max-width:100%;min-height:44px;color:var(--ds-text);background:var(--ds-control);border:1px solid var(--ds-rule);border-radius:5px}.ds-revit-commercial-opening-list{display:grid;gap:4px;margin:0;padding-left:18px;font-size:10px;line-height:1.4;color:var(--ds-muted)}
.ds-revit-commercial-output-choices{display:grid;gap:5px;min-width:0;margin:0;padding:8px;border:1px solid var(--ds-rule);border-radius:7px}.ds-revit-commercial-output-choices legend{padding:0 4px;color:var(--ds-muted);font-size:10px}.ds-geometry-editor .ds-revit-commercial-output-choice{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:7px;min-height:44px;cursor:pointer}.ds-revit-commercial-output-choice input{width:18px;height:18px;margin:0;accent-color:var(--ds-accent)}.ds-revit-commercial-output-choice span{font-size:12px}.ds-revit-commercial-output-choice small{grid-column:2;color:var(--ds-muted);font-size:10px;line-height:1.35}
.drafting-studio .ds-geometry-editor .ds-revit-commercial-walls .ds-panel-actions{position:sticky;bottom:-1px;z-index:4;padding:9px 0 3px;margin:6px 0 0;background:linear-gradient(to bottom,transparent 0,var(--ds-ground) 12px,var(--ds-ground) 100%)}
.ds-review-proposal{pointer-events:auto;min-height:36px;padding:6px 10px;border:1px solid var(--ds-accent);border-radius:8px;background:var(--ds-ground);color:var(--ds-text);font-size:11px}.ds-review-proposal[hidden]{display:none}
.drafting-studio .ds-plane-state{min-width:0;white-space:nowrap}.drafting-studio .ds-version-choice{min-width:0;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drafting-studio .ds-stage-top{gap:6px}.drafting-studio .ds-view-definition{flex-shrink:0}@media(max-width:500px){.drafting-studio .ds-version-choice{max-width:132px}}

/* A compact, paper-like brush atelier floats above the canvas; no reserved rail. */
.drafting-studio .ds-color-current { display:flex; width:auto; min-width:38px; padding:5px 9px; }
.ds-brush-launch-label { font-size:11px; white-space:nowrap; }
.drafting-studio .ds-brush-panel { position:absolute; z-index:45; top:auto; right:auto; bottom:calc(100% + 12px); margin:0; padding:14px; overflow:auto; overscroll-behavior:contain; border:1px solid var(--ds-rule); border-radius:18px; background:var(--ds-ground); color:var(--ds-text); box-shadow:0 18px 55px #132c2538,0 2px 7px #132c2520; box-sizing:border-box; }
.ds-brush-panel[hidden] { display:none!important; }
.ds-brush-header { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:15px; font-weight:600; }
.ds-brush-panel button,.ds-brush-panel select { min-height:36px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control); color:var(--ds-text); padding:6px 9px; font:inherit; font-size:11px; cursor:pointer; }
.ds-brush-panel button:disabled { opacity:.45; cursor:default; }
.ds-brush-panel button[aria-pressed="true"] { outline:2px solid var(--ds-accent); outline-offset:1px; }
.ds-brush-caption { font-size:11px; line-height:1.5; color:var(--ds-muted); margin:9px 0; }
.ds-brush-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin:12px 0; }
.ds-brush-cards button { display:flex; flex-direction:column; align-items:stretch; min-height:62px; padding:5px 8px 8px; background:#f4f3eb; color:#263534; }
.ds-brush-cards svg { width:100%; height:30px; }
.ds-brush-fields { display:grid; gap:9px; padding:10px 0; border-block:1px solid var(--ds-rule); }
.ds-brush-panel label { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; font-size:11px; margin:7px 0; }
.ds-brush-fields input[type="range"] { width:100%; accent-color:var(--ds-accent); }
.ds-brush-fields output { font-variant-numeric:tabular-nums; }
.ds-brush-fields input[type="color"] { width:44px; height:34px; padding:2px; border:1px solid var(--ds-rule); border-radius:7px; background:transparent; }
.ds-brush-swatches { display:flex; gap:7px; margin:12px 0; }
.ds-brush-swatches button { flex:1; min-width:0; height:42px; padding:0; background:var(--swatch); font-size:0; border:2px solid #ffffffa0; box-shadow:inset 0 0 0 1px #00000012; }
.ds-brush-generator,.ds-brush-actions { display:flex; flex-wrap:wrap; gap:6px; margin:9px 0; }
.ds-brush-generator select { flex:1; min-width:100px; }
.drafting-studio .ds-brush-panel .ds-color-options { position:static; inset:auto; display:flex; gap:8px; width:100%; padding:9px 0; margin:8px 0; border:0; box-shadow:none; background:transparent; }
.drafting-studio .ds-brush-panel .ds-color { width:44px; height:44px; min-height:44px; padding:0; flex:none; border-radius:50%; background:var(--swatch); }
.drafting-studio .ds-colors:not(.is-open) .ds-color-options { display:none; }
@container (max-width:600px) { .ds-brush-launch-label { display:none; } .drafting-studio .ds-color-current { width:38px; padding:4px; } }
@media (max-width:600px) { .ds-brush-launch-label { display:none; } .drafting-studio .ds-color-current { width:38px; padding:4px; } }
.drafting-studio .ds-colors { position:relative; }
.ds-input-badge { position:absolute; top:-8px; right:-3px; border-radius:4px; background:var(--ds-accent); color:var(--ds-ground); font-size:8px; font-weight:700; padding:1px 3px; pointer-events:none; }
.ds-input-badge:empty { display:none; }
.drafting-studio[data-input-mode="pen"] .ds-construction-proof::after { content:'PEN CANVAS'; position:absolute; z-index:30; right:12px; bottom:70px; padding:3px 6px; border-radius:5px; background:var(--ds-ground); color:var(--ds-text); border:1px solid var(--ds-rule); font-size:9px; pointer-events:none; }
.drafting-studio .ds-brush-panel[hidden] .ds-color-options { display:none; }

/* Device reach preferences affect controls, never the drawing or camera. */
.drafting-studio[data-dock-side="right"] .ds-tools-row { left:auto; right:10px; }
.drafting-studio[data-dock-position="top"] .ds-tools-row { bottom:auto; top:112px; }
.drafting-studio[data-dock-position="middle"] .ds-tools-row { bottom:auto; top:50%; transform:translateY(-50%); }
.drafting-studio .ds-popover label:has([data-dock-preference]) { display:flex; align-items:center; justify-content:space-between; gap:12px; }
@media (pointer:coarse) {
  .drafting-studio button, .drafting-studio select, .drafting-studio input[type="color"] { min-width:44px; min-height:44px; }
  .drafting-studio .ds-tool, .drafting-studio .ds-tool-small { width:auto; min-width:44px; height:44px; }
  .drafting-studio .ds-plane-row { min-height:44px; }
  .drafting-studio .ds-navigation { max-width:calc(100% - 20px); flex-wrap:wrap; }
  .drafting-studio .ds-navigation > span { display:none; }
  .drafting-studio .ds-tools-row { max-width:calc(100% - 20px); }
}
.drafting-studio[data-dock-side="right"] .ds-drawing-tools-drawer { left:auto; right:10px; }
.drafting-studio[data-dock-position="top"] .ds-drawing-tools-drawer { bottom:auto; top:176px; }
.drafting-studio[data-dock-position="middle"] .ds-drawing-tools-drawer { bottom:auto; top:calc(50% + 34px); max-height:calc(50% - 44px); }
@container drafting-studio (max-width:700px) {
  .drafting-studio[data-dock-position="top"] .ds-tools-row { top:174px; }
  .drafting-studio[data-dock-position="top"] .ds-drawing-tools-drawer { top:236px; }
}
.drafting-studio[data-dock-side="right"] .ds-authoring-tools,
.drafting-studio[data-dock-side="right"] .ds-authoring-drawer { left:auto; right:10px; }
.drafting-studio[data-dock-position="top"] .ds-authoring-tools { bottom:auto; top:174px; }
.drafting-studio[data-dock-position="top"] .ds-authoring-drawer { bottom:auto; top:236px; }
.drafting-studio[data-dock-position="middle"] .ds-authoring-tools { bottom:auto; top:50%; transform:translateY(-50%); }
.drafting-studio[data-dock-position="middle"] .ds-authoring-drawer { bottom:auto; top:calc(50% + 34px); max-height:calc(50% - 44px); }
.drafting-studio [data-action="camera-snap"] { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@container drafting-studio (min-width:701px) and (max-width:1000px) {
  .drafting-studio .ds-title { width:120px; }
  .drafting-studio .ds-top { gap:5px; }
}
@media (pointer:coarse) {
  .drafting-studio input:not([type="hidden"]), .drafting-studio textarea { min-height:44px; }
  .drafting-studio .ds-plane-row button { min-width:44px; min-height:44px; }
}
.drafting-studio .ds-popover[data-camera-catalog] { display:grid; gap:9px; }
.drafting-studio .ds-popover[data-camera-catalog][hidden] { display:none; }
.ds-camera-destinations { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.drafting-studio .ds-popover[data-camera-catalog] button { min-height:36px; padding:7px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control); color:var(--ds-text); font-size:11px; }
.drafting-studio .ds-popover[data-camera-catalog] input[type="text"],
.drafting-studio .ds-popover[data-camera-catalog] input:not([type]),
.drafting-studio .ds-popover[data-camera-catalog] select { max-width:100%; padding:7px; border:1px solid var(--ds-rule); border-radius:7px; background:var(--ds-control); color:var(--ds-text); }
@media(pointer:coarse) { .drafting-studio .ds-popover[data-camera-catalog] button { min-height:44px; } }
@container drafting-studio (max-width:1000px) {
  .drafting-studio .ds-navigation { top:110px; }
  .drafting-studio[data-flow-context="create"] .ds-support-session { bottom:16px; width:max-content; flex-wrap:wrap; justify-content:center; }
  .drafting-studio[data-dock-position="top"] .ds-tools-row { top:174px; }
  .drafting-studio[data-dock-position="top"] .ds-drawing-tools-drawer { top:236px; }
  .drafting-studio[data-dock-position="middle"] .ds-tools-row,
  .drafting-studio[data-dock-position="middle"] .ds-authoring-tools { top:max(174px,calc(50% - 28px)); transform:none; }
  .drafting-studio[data-dock-position="middle"] .ds-drawing-tools-drawer,
  .drafting-studio[data-dock-position="middle"] .ds-authoring-drawer { top:max(236px,calc(50% + 34px)); }
}

/* Secondary exact support tools remain over the canvas. */
.drafting-studio .ds-support-panel{display:flex;flex-direction:column;gap:8px;padding:16px;background:var(--ds-panel,#f4f2eb);color:var(--ds-ink,#27312e);box-shadow:0 12px 44px #0003;border:1px solid #8885;border-radius:14px;}
.drafting-studio .ds-support-panel[hidden]{display:none;}
.drafting-studio .ds-support-panel button,.drafting-studio .ds-support-session button{min-height:44px;padding:8px 12px;border:1px solid #8885;border-radius:8px;background:var(--ds-paper,#fff);color:inherit;}
.drafting-studio .ds-support-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;border-top:1px solid #8883;padding-top:8px;}
.drafting-studio .ds-support-panel label{display:flex;align-items:center;gap:8px;min-height:44px;}
.drafting-studio .ds-support-session{position:absolute;bottom:120px;left:50%;transform:translateX(-50%);z-index:12;display:flex;gap:6px;max-width:calc(100% - 16px);padding:6px;border-radius:12px;background:var(--ds-panel,#f4f2eb);box-shadow:0 4px 20px #0002;}
@media(max-width:500px){.drafting-studio .ds-support-session{bottom:130px;flex-wrap:wrap;justify-content:center;}}

.drafting-studio .ds-support-session{color:#27312e;background:#f4f2eb}.drafting-studio .ds-support-session button{color:#27312e;background:#fff}
.drafting-studio .ds-support-panel label{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,1fr);min-width:0;overflow-wrap:anywhere;}
.drafting-studio .ds-support-panel label:has(input[type="checkbox"]){display:flex;}
.drafting-studio .ds-support-panel input:not([type="checkbox"]),.drafting-studio .ds-support-panel select{box-sizing:border-box;min-width:0;max-width:100%;width:100%;}
.drafting-studio .ds-support-row>select{flex-basis:100%;}

/* Source evidence and long native IDs must not widen the floating inspector. */
.ds-geometry-editor,.ds-geometry-editor>*,.ds-geometry-editor fieldset,.ds-geometry-editor label{min-width:0;max-width:100%;overflow-wrap:anywhere}
.ds-geometry-editor select,.ds-geometry-editor textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.ds-geometry-editor .ds-commercial-sources label:has(select),.ds-geometry-editor .ds-commercial-sources label:has(textarea),.ds-geometry-editor .ds-commercial-sources label:has(input[type="number"]){display:grid;align-items:stretch}

.drafting-studio .ds-primitive-fields{display:grid;gap:8px;min-width:0}
.drafting-studio .ds-support-panel input:not([type="checkbox"]),.drafting-studio .ds-support-panel select{min-height:44px}
.drafting-studio .ds-support-panel{background:var(--ds-field);color:var(--ds-text);color-scheme:inherit}
.drafting-studio .ds-support-panel button{background:var(--ds-control);color:var(--ds-text);border-color:var(--ds-rule)}
.drafting-studio .ds-support-panel input:not([type="checkbox"]),.drafting-studio .ds-support-panel select{background:var(--ds-control-strong);color:var(--ds-text);border:1px solid var(--ds-rule);border-radius:7px;padding:7px 9px}
.drafting-studio .ds-support-panel option{background:var(--ds-field);color:var(--ds-text)}
.drafting-studio .ds-support-panel :is(input,select,button):focus-visible{outline:2px solid var(--ds-accent);outline-offset:2px}
.drafting-studio .ds-primitive-placement{border:1px solid var(--ds-rule);border-radius:8px;padding:6px;min-width:0}
.drafting-studio .ds-primitive-placement summary{min-height:44px;display:list-item;cursor:pointer;overflow-wrap:anywhere;padding:8px 3px}
.drafting-studio .ds-primitive-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px}
.drafting-studio .ds-primitive-actions button:last-child{grid-column:1/-1}

/* Orbit home exposes creation/selection. Paint controls belong to an edit context. */
.drafting-studio .ds-flow-actions{display:flex;gap:6px;align-items:center}
.drafting-studio .ds-flow-actions button,.drafting-studio .ds-flow-exit{min-height:44px;border:1px solid var(--ds-rule);border-radius:9px;background:var(--ds-control-strong);color:var(--ds-text);padding:8px 11px;font:inherit;font-weight:650;cursor:pointer}
.drafting-studio .ds-flow-actions[hidden],.drafting-studio .ds-flow-exit[hidden]{display:none!important}
.drafting-studio .ds-drawing-tools-drawer [data-tool="rectangle"][hidden],.drafting-studio .ds-drawing-tools-drawer [data-tool="line"][hidden]{display:none!important}
@media(pointer:coarse){.drafting-studio [data-inference-retry],.drafting-studio [data-inference-stop]{min-height:44px}}
.drafting-studio[data-flow-context="orbit"] .ds-tools>button:not([data-tool="orbit"]),.drafting-studio[data-flow-context="orbit"] .ds-tools>.ds-tool-divider,.drafting-studio[data-flow-context="orbit"] .ds-colors,.drafting-studio[data-flow-context="orbit"] .ds-tools-menu{display:none!important}
.drafting-studio[data-flow-context="create"] .ds-tools-row,.drafting-studio[data-flow-context="placing"] .ds-tools-row{display:none!important}
.drafting-studio[data-flow-context="surface"] .ds-support-session{display:none!important}
.drafting-studio .ds-navigation>[data-action="view-session"]{display:none!important}
.drafting-studio:not([data-flow-context="plane"]) .ds-navigation>[data-action="fit-view"]{display:none!important}
.drafting-studio .ds-views>.ds-add-view,.drafting-studio .ds-views>.ds-details-toggle,.drafting-studio .ds-views>.ds-construction-toggle,.drafting-studio .ds-views>.ds-spatial-toggle{display:none!important}
.drafting-studio:not([data-flow-context="plane"]) .ds-stage-top,.drafting-studio:not([data-flow-context="plane"]) .ds-stage-bottom{display:none!important}
.drafting-studio[data-flow-context="surface"] .ds-view-tabs,.drafting-studio[data-flow-context="create"] .ds-view-tabs,.drafting-studio[data-flow-context="placing"] .ds-view-tabs{display:none!important}
@container drafting-studio (max-width:500px){.drafting-studio .ds-flow-actions{gap:4px}.drafting-studio .ds-flow-actions button{max-width:105px;padding:6px 8px;font-size:11px}.drafting-studio .ds-flow-exit{max-width:90px;padding:6px 8px;font-size:11px}}
.drafting-studio .ds-support-panel>*,.drafting-studio .ds-support-row>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
.drafting-studio :is(.ds-flow-actions button,.ds-flow-exit):focus-visible{outline:2px solid var(--ds-accent);outline-offset:2px}
/* Floating navigation owns only its buttons, never the gaps over the drawing. */
.drafting-studio .ds-navigation{pointer-events:none;background:transparent;border:0;box-shadow:none;padding:0;gap:4px}
.drafting-studio .ds-navigation>button{pointer-events:auto;background:var(--ds-ground);border:1px solid var(--ds-rule);box-shadow:var(--ds-shadow)}
@container drafting-studio (max-width:700px){
  .drafting-studio[data-flow-context="surface"] .ds-top{right:80px}
  .drafting-studio[data-flow-context="surface"] .ds-views{left:auto;right:10px;top:10px;width:max-content;max-width:70px}
  .drafting-studio[data-flow-context="surface"] .ds-navigation{top:70px}
}

/* Project-camera choices stay actionable above an open placement preview. */
.drafting-studio .ds-popover[data-camera-catalog],.drafting-studio .ds-popover[data-view-popover],.drafting-studio .ds-popover[data-source-export-review],.drafting-studio .ds-popover[data-building-source-review],.drafting-studio .ds-popover[data-construction-refresh-review]{z-index:70}
.drafting-studio .ds-popover[data-construction-revit-review]{z-index:70;overflow-wrap:anywhere;max-height:min(620px,calc(100% - 32px))}
.drafting-studio .ds-popover[data-construction-revit-review] p{font-size:11px;line-height:1.45}
.drafting-studio .ds-popover[data-construction-revit-review] button{min-height:44px;padding:10px}
.drafting-studio .ds-popover[data-construction-revit-review] .ds-panel-actions{position:sticky;bottom:-10px;z-index:2;padding:9px 0 10px;margin:8px -10px -10px;background:linear-gradient(to bottom,transparent 0,var(--ds-ground) 10px,var(--ds-ground) 100%)}
.drafting-studio .ds-revit-dimension-review{display:grid;gap:7px;box-sizing:border-box;width:100%;min-width:0;margin:9px 0 0;padding:8px;border:1px solid var(--ds-rule);border-radius:8px}
.drafting-studio .ds-revit-dimension-review legend{padding:0 4px;font-size:10px;font-weight:700}
.drafting-studio .ds-revit-dimension-toggle{display:flex;align-items:center;gap:8px;min-height:44px;font-size:11px;line-height:1.4}
.drafting-studio .ds-revit-dimension-toggle input{flex:0 0 auto;width:18px;height:18px;margin:0}
.drafting-studio .ds-revit-dimension-review label:not(.ds-revit-dimension-toggle){display:grid;gap:3px;min-width:0;font-size:10px;font-weight:650}
.drafting-studio .ds-revit-dimension-review select{box-sizing:border-box;width:100%;min-width:0;min-height:40px;padding:6px;border:1px solid var(--ds-rule);border-radius:5px;background:var(--ds-control);color:var(--ds-text);font:inherit}
.drafting-studio .ds-revit-dimension-review small{display:block;color:var(--ds-muted);font-size:10px;line-height:1.4}
.drafting-studio .ds-revit-sheet-review{display:grid;gap:7px;min-width:0;margin:9px 0 0;padding:8px;border:1px solid var(--ds-rule);border-radius:8px}
.drafting-studio .ds-revit-sheet-review legend{padding:0 4px;font-size:10px;font-weight:700}
.drafting-studio .ds-revit-sheet-toggle{display:flex;align-items:center;gap:8px;min-height:44px;font-size:11px;line-height:1.4}
.drafting-studio .ds-revit-sheet-toggle input{flex:0 0 auto;width:18px;height:18px;margin:0}
.drafting-studio .ds-revit-sheet-fields{display:grid;gap:6px;padding-top:4px}
.drafting-studio .ds-revit-sheet-fields[hidden]{display:none}
.drafting-studio .ds-revit-sheet-fields label{display:grid;gap:3px;font-size:10px;font-weight:650}
.drafting-studio .ds-revit-sheet-fields input,.drafting-studio .ds-revit-sheet-fields select{box-sizing:border-box;width:100%;min-width:0;min-height:40px;padding:6px;border:1px solid var(--ds-rule);border-radius:5px;background:var(--ds-control);color:var(--ds-text);font:inherit}
.drafting-studio .ds-revit-sheet-note,.drafting-studio .ds-revit-sheet-warning{margin:0;color:var(--ds-muted);font-size:10px;line-height:1.4}
.drafting-studio .ds-popover[data-construction-revit-review] input:focus-visible,.drafting-studio .ds-popover[data-construction-revit-review] select:focus-visible{outline:2px solid var(--ds-accent);outline-offset:2px}
@media(pointer:coarse){.drafting-studio .ds-revit-sheet-fields input,.drafting-studio .ds-revit-sheet-fields select{min-height:44px}}
@media(pointer:coarse){.drafting-studio .ds-revit-dimension-review select{min-height:44px}}
.drafting-studio .ds-popover[data-construction-refresh-review]{overflow-wrap:anywhere}
.drafting-studio .ds-popover[data-construction-refresh-review] p,.drafting-studio .ds-popover[data-construction-refresh-review] .ds-building-review-values{font-size:11px;line-height:1.45}
.drafting-studio .ds-popover[data-construction-refresh-review] .ds-building-review-values{padding-left:18px}
.drafting-studio .ds-popover[data-construction-refresh-review] button{min-height:44px;padding:10px}
/* The open advanced menu must remain above floating paint controls. */
.drafting-studio .ds-views.is-drawer-open{z-index:30}

/* Source-review provenance stays readable without widening the drawing inspector. */
.drafting-studio .ds-spatial-development{min-width:0;overflow-wrap:anywhere}
.drafting-studio .ds-development-exclusions{padding-left:16px;font-size:10px;line-height:1.5}
.drafting-studio .ds-development-path-review{padding-left:16px;font-size:10px;line-height:1.5;overflow-wrap:anywhere}

.drafting-studio .ds-inference-diagnostics{padding-left:16px;overflow-wrap:anywhere}
.drafting-studio .ds-inference-diagnostics li{margin:8px 0}
.drafting-studio .ds-inference-diagnostics button{min-height:36px;margin-top:5px}
@media(pointer:coarse){.drafting-studio .ds-inference-diagnostics button{min-height:44px}}

/* Photo-to-sketch is an explicit local evidence review, with the retained image visible beside its calibration. */
.drafting-studio .ds-photo-dialog{width:min(1080px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);margin:auto;padding:22px;border:1px solid var(--ds-rule);border-radius:18px;background:var(--ds-ground);color:var(--ds-text);box-shadow:0 24px 90px rgba(0,0,0,.3);overflow:auto}
.drafting-studio .ds-photo-dialog::backdrop{background:rgba(11,20,16,.58);backdrop-filter:blur(3px)}
.drafting-studio .ds-photo-dialog[open]{display:block}
.drafting-studio .ds-photo-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.drafting-studio .ds-photo-header h2{margin:4px 0 0;font-size:21px;line-height:1.2}
.drafting-studio .ds-photo-dialog button,.drafting-studio .ds-photo-file-label{min-height:42px;border:1px solid var(--ds-rule);border-radius:9px;background:var(--ds-control-strong);color:var(--ds-text);padding:8px 12px;font:inherit;font-weight:650;cursor:pointer}
.drafting-studio .ds-photo-header button{min-width:44px;font-size:22px;line-height:1}
.drafting-studio .ds-photo-description,.drafting-studio .ds-photo-calibration p,.drafting-studio .ds-photo-suggestions p{max-width:78ch;color:var(--ds-muted);font-size:12px;line-height:1.5}
.drafting-studio .ds-photo-file-label{display:inline-flex;align-items:center;gap:10px}
.drafting-studio .ds-photo-file-label input{max-width:min(360px,55vw);font-size:11px}
.drafting-studio .ds-photo-status{min-height:20px;color:var(--ds-muted);font-size:12px;line-height:1.45}
.drafting-studio .ds-photo-library{margin:10px 0;padding:12px;border:1px solid var(--ds-rule);border-radius:11px;background:var(--ds-control)}
.drafting-studio .ds-photo-library-row{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--ds-rule);overflow-wrap:anywhere}
.drafting-studio .ds-photo-library-row small{color:var(--ds-muted);text-align:right}
.drafting-studio .ds-photo-workflow{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);gap:16px;align-items:start}
.drafting-studio .ds-photo-preview-wrap{min-width:0;padding:10px;border:1px solid var(--ds-rule);border-radius:12px;background:var(--ds-field)}
.drafting-studio .ds-photo-preview{display:block;width:100%;height:auto;max-height:54vh;object-fit:contain;touch-action:manipulation;cursor:crosshair}
.drafting-studio .ds-photo-preview:focus-visible{outline:2px solid var(--ds-accent);outline-offset:2px}
.drafting-studio .ds-photo-preview-wrap small{display:block;padding-top:7px;color:var(--ds-muted)}
.drafting-studio .ds-photo-calibration,.drafting-studio .ds-photo-suggestions{min-width:0;padding:13px;border:1px solid var(--ds-rule);border-radius:12px;background:var(--ds-control)}
.drafting-studio .ds-photo-calibration [hidden]{display:none!important}
.drafting-studio .ds-photo-calibration h3,.drafting-studio .ds-photo-suggestions h3{margin:0;font-size:14px}
.drafting-studio .ds-photo-calibration label{display:grid;gap:4px;margin:9px 0;color:var(--ds-muted);font-size:11px}
.drafting-studio .ds-photo-calibration input,.drafting-studio .ds-photo-calibration select{width:100%;min-width:0;min-height:38px;border:1px solid var(--ds-rule);border-radius:7px;background:var(--ds-ground);padding:6px;color:var(--ds-text)}
.drafting-studio .ds-photo-origin-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.drafting-studio .ds-photo-calibration [data-photo-action="analyze"],.drafting-studio .ds-photo-suggestions [data-photo-action="accept"]{width:100%;margin-top:7px}
.drafting-studio .ds-photo-dialog .ds-primary-action{background:var(--ds-accent);color:#fff}
.drafting-studio .ds-photo-dialog button:disabled{opacity:.45;cursor:not-allowed}
.drafting-studio .ds-photo-suggestions{grid-column:2;max-height:34vh;overflow:auto}
.drafting-studio .ds-photo-candidates{display:grid;gap:4px;margin:9px 0}
.drafting-studio .ds-photo-candidate{display:grid;grid-template-columns:20px 12px minmax(0,1fr);gap:8px;align-items:center;padding:6px 2px;border-top:1px solid var(--ds-rule);font-size:11px;overflow-wrap:anywhere}
.drafting-studio .ds-photo-candidate input{width:18px;height:18px;accent-color:var(--ds-accent)}
.drafting-studio .ds-photo-candidate-swatch{width:10px;height:3px;border-radius:2px;background:#287b74}
.drafting-studio .ds-photo-candidate:nth-child(4n) .ds-photo-candidate-swatch{background:#b84b22}
.drafting-studio .ds-photo-weak-toggle{display:flex;align-items:center;gap:8px;margin-top:8px;color:var(--ds-muted);font-size:11px}
.drafting-studio .ds-photo-weak-toggle input{width:18px;height:18px;accent-color:var(--ds-accent)}
.drafting-studio .ds-photo-footer{display:flex;justify-content:flex-end;margin-top:14px}
@media(max-width:680px){.drafting-studio .ds-photo-dialog{width:calc(100vw - 12px);max-height:calc(100dvh - 12px);padding:14px;border-radius:14px}.drafting-studio .ds-photo-workflow{grid-template-columns:minmax(0,1fr)}.drafting-studio .ds-photo-preview{max-height:35vh}.drafting-studio .ds-photo-suggestions{grid-column:1;max-height:25vh}.drafting-studio .ds-photo-library-row{flex-direction:column;gap:3px}.drafting-studio .ds-photo-library-row small{text-align:left}.drafting-studio .ds-photo-file-label{display:flex;flex-direction:column;align-items:flex-start}}
@media(pointer:coarse){.drafting-studio .ds-photo-dialog button,.drafting-studio .ds-photo-file-label{min-height:44px}}

/* Source review stays secondary to the retained sheet; all actions are tap sized. */
.drafting-studio .ds-popover[data-source-export-review] { overflow-wrap:anywhere; }
.drafting-studio .ds-popover[data-source-export-review] button { min-height:44px; padding:10px; }

/* Building evidence stays readable above secondary review actions. */
.drafting-studio .ds-suggestion:has(.ds-house-review-basis){display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start}
.drafting-studio .ds-suggestion:has(.ds-house-review-basis) .ds-suggestion-actions{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto}
.drafting-studio .ds-suggestion:has(.ds-house-review-basis) .ds-suggestion-actions button{white-space:normal;min-height:32px}
.drafting-studio .ds-suggestion-review{grid-column:1/-1;min-height:36px;border:1px solid var(--ds-rule);border-radius:7px;background:var(--ds-control-strong);color:var(--ds-text);cursor:pointer}
.drafting-studio .ds-popover[data-building-source-review]{overflow-wrap:anywhere}
.drafting-studio .ds-popover[data-building-source-review] p,.drafting-studio .ds-building-review-values{font-size:11px;line-height:1.45}
.drafting-studio .ds-building-review-values{padding-left:18px}
.drafting-studio .ds-popover[data-building-source-review] button{min-height:44px;padding:10px}
.drafting-studio .ds-suggestion:has([data-proposal-action="review-orthogonal"]){display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start}
.drafting-studio .ds-suggestion:has([data-proposal-action="review-orthogonal"]) .ds-suggestion-actions{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto}
.drafting-studio .ds-suggestion:has([data-proposal-action="review-orthogonal"]) .ds-suggestion-actions button{white-space:normal;min-height:36px}
.drafting-studio .ds-popover[data-orthogonal-source-review]{overflow-wrap:anywhere}
.drafting-studio .ds-popover[data-orthogonal-source-review] p,.drafting-studio .ds-popover[data-orthogonal-source-review] .ds-building-review-values{font-size:11px;line-height:1.45}
.drafting-studio .ds-popover[data-orthogonal-source-review] .ds-building-review-values{padding-left:18px}
.drafting-studio .ds-popover[data-orthogonal-source-review] button{min-height:44px;padding:10px}
@media(pointer:coarse){.drafting-studio .ds-suggestion:has(.ds-house-review-basis) .ds-suggestion-actions button{min-height:44px}}
@media(pointer:coarse){.drafting-studio .ds-suggestion:has([data-proposal-action="review-orthogonal"]) .ds-suggestion-actions button{min-height:44px}}
@media(pointer:coarse){.drafting-studio .ds-proposal-evidence-link{min-height:44px}}

/* Cross-view proposals can reopen the exact photo lines and calibrated editable overlay without eager image loading. */
.drafting-studio .ds-photo-source-review{container:ds-photo-review/inline-size;min-width:0;margin-top:5px;border:1px solid var(--ds-rule);border-radius:8px;background:var(--ds-control)}
.drafting-studio .ds-photo-source-review>summary{min-height:32px;padding:6px 8px;color:var(--ds-text);font-size:9px;font-weight:700;line-height:1.35;cursor:pointer}
.drafting-studio .ds-photo-source-item{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:8px;align-items:start;margin:0;padding:0 8px 8px}
.drafting-studio .ds-photo-source-visual{position:relative;width:100%;max-height:190px;overflow:hidden;border-radius:6px;background:var(--ds-field)}
.drafting-studio .ds-photo-source-item img{display:block;width:100%;height:100%;max-height:190px;object-fit:contain;border-radius:6px;background:var(--ds-field)}
.drafting-studio .ds-photo-source-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.drafting-studio .ds-photo-source-item figcaption{display:grid;min-width:0;gap:4px;overflow-wrap:anywhere;color:var(--ds-muted);font-size:8px;line-height:1.4}
.drafting-studio .ds-photo-source-item figcaption b{color:var(--ds-text);font-size:9px}
.drafting-studio .ds-photo-source-item figcaption small{font-size:8px;line-height:1.45}
@media(max-width:680px){.drafting-studio .ds-photo-source-item{grid-template-columns:minmax(0,1fr)}.drafting-studio .ds-photo-source-visual,.drafting-studio .ds-photo-source-item img{max-height:160px}}
@container ds-photo-review (max-width:560px){.drafting-studio .ds-photo-source-item{grid-template-columns:minmax(0,1fr)}.drafting-studio .ds-photo-source-visual,.drafting-studio .ds-photo-source-item img{max-height:190px}}
/* Files remains actionable while a pending placement is preserved for validation. */
.drafting-studio .ds-popover[data-files-popover]{z-index:70}

/* Plane creation and overlap choices stay short and reachable. */
.drafting-studio .ds-plane-menu-close{min-width:44px;min-height:44px;font-size:18px}
.drafting-studio .ds-popover [data-pick-view]{min-height:44px;white-space:normal;overflow-wrap:anywhere}
/* Plane selection is contextual; the existing manager stays under More. */
.drafting-studio .ds-view-tabs{display:none}
.drafting-studio .ds-views{left:auto;right:10px;width:max-content}
@media(pointer:coarse){.drafting-studio .ds-document-actions .ds-files-toggle{min-height:44px!important}}
@container drafting-studio (max-width:1000px){.drafting-studio:not([data-flow-context="surface"]) .ds-navigation{top:126px}}

/* Persistent controls use compact icons; full names remain available to assistive technology and tooltips. */
.drafting-studio .ds-icon-control{width:44px!important;min-width:44px!important;height:44px;min-height:44px!important;padding:9px!important;display:inline-flex;align-items:center;justify-content:center;flex:none}
.drafting-studio .ds-icon-control .ds-control-label,.drafting-studio .ds-tools>.ds-tool>span:not(.ds-tool-icon){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.drafting-studio .ds-icon-control svg{display:block;width:20px;height:20px}
.drafting-studio .ds-tools>.ds-tool{min-width:44px;min-height:44px;padding:9px}

.drafting-studio .ds-color-current{min-width:44px!important;min-height:44px!important;width:44px!important;justify-content:center;padding:7px!important}
.drafting-studio .ds-brush-launch-label{display:none}

/* Tracking geometry is immediate: even reduced-motion global transitions can
   leave a touch target at its previous position until the next frame. */
.drafting-studio .ds-popover[data-view-popover]{transition:none!important}

/* A placement-only Key Plan; no persistent navigation control is added. */
.ds-placement-panel[data-key-plan-active]{display:flex;flex-direction:column;overflow:hidden;padding:8px;transition:none!important}
.ds-placement-panel[data-key-plan-active]>.ds-key-plan{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.ds-placement-panel[data-key-plan-active]>.ds-placement-position{flex:0 0 auto}
.ds-placement-panel[data-key-plan-active]>b{display:none}
.drafting-studio .ds-key-plan-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;min-width:0;min-height:32px;padding:0;margin:0;height:auto;width:auto;background:none;border:0}
.ds-key-plan-target{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
.ds-key-plan-toggle{width:32px;height:32px;padding:6px;border:0;background:transparent;color:var(--ds-text)}
.ds-key-plan-diagrams{display:flex;gap:6px;margin:3px 0}
.ds-key-plan-diagrams figure{flex:1;min-width:0;margin:0;text-align:center}
.ds-key-plan-diagrams figcaption{font-size:10px}
.ds-key-plan-diagrams svg{display:block;width:100%;height:54px;background:var(--ds-control);border-radius:5px}
.ds-key-plan-diagrams polyline{stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.ds-key-plan-context{stroke:var(--ds-muted);stroke-dasharray:3 2;opacity:.65}
.ds-key-plan-selected{stroke:var(--ds-accent);stroke-width:2!important}
.ds-key-plan-anchor{stroke:var(--ds-accent);stroke-width:2!important}
.ds-key-plan-zero{fill:var(--ds-muted)}.ds-key-plan-heading{stroke:var(--ds-text)}.ds-key-plan-ruler{stroke:var(--ds-text)}
.ds-key-plan-diagrams text{font-size:9px;fill:var(--ds-text)}
.ds-key-plan-arrows{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:3px}
.ds-key-plan-axis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;position:relative;padding-top:12px}
.ds-key-plan-axis>span{position:absolute;top:0;left:0;right:0;text-align:center;font-size:10px}
.ds-key-plan-axis button{min-width:44px;min-height:44px;font-size:19px;line-height:1;background:var(--ds-control);color:var(--ds-text);border:1px solid var(--ds-rule);border-radius:5px}
.ds-key-plan-settings{display:flex;gap:8px;align-items:start;margin-top:4px}.ds-key-plan-settings>label{display:flex;gap:5px;align-items:center;white-space:nowrap;font-size:10px}
.ds-key-plan-settings input{width:74px;min-height:32px;box-sizing:border-box;background:var(--ds-control);color:var(--ds-text);border:1px solid var(--ds-rule);border-radius:5px}
.ds-key-plan-values{flex:1;min-width:0}.ds-key-plan-values summary{cursor:pointer;min-height:32px;display:flex;align-items:center;font-size:10px}
.ds-key-plan-values[open]{width:100%}.ds-key-plan-values .ds-placement-fields{position:relative;min-width:180px}
.ds-key-plan-settings:has(.ds-key-plan-values[open]){flex-wrap:wrap}.ds-key-plan-settings:has(.ds-key-plan-values[open]) .ds-key-plan-values{flex-basis:100%}
.ds-key-plan-status{font-size:9px;margin:3px 0;color:var(--ds-muted)}
.ds-placement-panel[data-key-plan-active] .ds-panel-actions{position:static;flex:0 0 auto;background:var(--ds-ground);padding-top:5px;margin-top:3px}
@media(pointer:coarse){.ds-key-plan-toggle,.ds-key-plan-axis button,.ds-key-plan-settings input,.ds-key-plan-values summary,.ds-placement-panel[data-key-plan-active] .ds-panel-actions button{min-width:44px;min-height:44px}.ds-key-plan-arrows{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}}

.ds-key-plan-movement>summary{cursor:pointer;min-height:32px;line-height:32px;font-size:11px}.ds-key-plan-status:empty{display:none}
.ds-placement-panel[data-key-plan-active] .ds-placement-position{margin-top:3px;font-size:10px;overflow-wrap:anywhere}
@media(pointer:coarse){.ds-key-plan-movement>summary{min-height:44px;line-height:44px}}

.drafting-studio .ds-source-entry-summary { white-space:normal; overflow-wrap:anywhere; font-size:11px; line-height:1.4; }
.drafting-studio .ds-popover[data-navigation-source]:not([hidden]) { display:grid; gap:6px; }
.drafting-studio .ds-popover[data-navigation-source] button { min-height:44px; min-width:44px; width:100%; padding:8px; border:1px solid var(--ds-rule); border-radius:8px; background:var(--ds-control); color:var(--ds-text); text-align:left; }
