:root { --ink: #1f3a6e; --paper: #f5f8fc; --line: #d5dde8; --muted: #66758a; --bg: #eef2f6; --panel: #ffffff;
  --measured: #2f9e55; --estimated: #e0a030; --assumed: #d9534f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #1d2733; background: var(--bg); }
body { display: grid; grid-template-rows: auto 1fr auto; }
#bar { display: flex; gap: 18px; align-items: center; padding: 8px 14px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 600; }
.eyebrow { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.tools { display: flex; gap: 12px; flex-wrap: wrap; }
.grp { display: flex; align-items: center; gap: 3px; }
.k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-right: 3px; }
button { font: inherit; font-size: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
button:hover { background: rgba(255,255,255,.18); }
button.on { background: #fff; color: var(--ink); border-color: #fff; }
#main { display: grid; min-height: 0; grid-template-columns: 250px 1fr 1fr; position: relative; }
#main.plan { grid-template-columns: 250px 1fr; } #main.plan #viewpane { display: none; }
#main.three { grid-template-columns: 250px 1fr; } #main.three #planpane { display: none; }
#side { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; padding: 10px 12px; }
#side h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 0 6px; }
#side section:first-child h2 { margin-top: 2px; }
.layer { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.layer .n { margin-left: auto; color: var(--muted); font-size: 11px; }
.gaps { margin: 2px 0 6px 22px; padding: 0; color: var(--muted); font-size: 11px; }
.gaps li { margin: 2px 0; }
.gaps summary { cursor: pointer; color: #9a5b00; }
.badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 9px; color: #fff; white-space: nowrap; }
.badge.measured { background: var(--measured); } .badge.estimated { background: var(--estimated); } .badge.assumed { background: var(--assumed); }
.legend-row { display: flex; gap: 6px; align-items: center; margin: 3px 0; font-size: 12px; }
.bar { height: 8px; border-radius: 4px; background: #e6ebf1; overflow: hidden; display: flex; margin: 4px 0 2px; }
.bar i { display: block; height: 100%; }
#planpane { position: relative; background: var(--paper); border-right: 1px solid var(--line); overflow: hidden; min-width: 0; }
#plan, #plan svg { width: 100%; height: 100%; display: block; }
#plan svg { cursor: grab; } #plan svg.measuring { cursor: crosshair; }
.plan .grid { stroke: #c7d4e6; stroke-width: 0.03; }
.plan .bub { fill: #fff; stroke: #1f3a6e; stroke-width: 0.06; }
.plan .bubt { font-size: 0.8px; text-anchor: middle; fill: #1f3a6e; font-weight: 600; }
.plan .lbl { font-size: 0.75px; fill: #1f3a6e; text-anchor: middle; font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 0.25px; pointer-events: none; }
.plan .el { cursor: pointer; }
.plan .el:hover { filter: drop-shadow(0 0 0.25px #ffb100); }
.plan .sel { filter: drop-shadow(0 0 0.35px #ff9f00) drop-shadow(0 0 0.35px #ff9f00); }
.plan .datum circle { fill: #fff; stroke: #c0392b; stroke-width: 0.06; } .plan .datum path { stroke: #c0392b; stroke-width: 0.05; } .plan .datum text { font-size: 0.5px; fill: #c0392b; font-weight: 700; }
#titleblock { position: absolute; right: 10px; bottom: 10px; background: #fff; border: 1.5px solid var(--ink); color: var(--ink); font-size: 11px; width: 250px; }
#titleblock div { padding: 4px 8px; border-top: 1px solid var(--line); } #titleblock div:first-child { border-top: 0; font-weight: 700; font-size: 12px; }
#north { position: absolute; right: 18px; top: 12px; width: 44px; height: 44px; }
#measureout { position: absolute; left: 10px; top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; font-size: 12px; display: none; }
#viewpane { position: relative; min-width: 0; overflow: hidden; }
#stage, #stage canvas { width: 100%; height: 100%; display: block; }
#labels3d { position: absolute; inset: 0; pointer-events: none; }
.l3 { position: absolute; transform: translate(-50%, -100%); background: rgba(31,58,110,.9); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.blueprint .l3 { background: rgba(255,255,255,.9); color: var(--ink); }
#info { position: absolute; right: 12px; bottom: 12px; width: 340px; max-height: calc(100% - 24px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(20,40,70,.18); padding: 12px 14px; z-index: 5; }
#info.hidden { display: none; }
#info h3 { margin: 0 0 2px; font-size: 15px; color: var(--ink); }
#info .meta { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
#info table { width: 100%; border-collapse: collapse; margin: 6px 0; }
#info td { border-top: 1px solid #eef1f5; padding: 4px 4px; vertical-align: top; font-size: 12px; }
#info td.v { white-space: nowrap; font-weight: 600; }
#info .note { color: var(--muted); font-size: 11px; }
#info h4 { margin: 10px 0 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#info ul { margin: 0; padding-left: 18px; }
#info .x { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 16px; }
#stamp { font-size: 10.5px; color: var(--muted); padding: 4px 14px; background: #fff; border-top: 1px solid var(--line); }
@media (max-width: 900px) { #main, #main.plan, #main.three { grid-template-columns: 1fr; grid-template-rows: auto 50vh 50vh; } #side { max-height: 30vh; } }

#viewpane { position: relative; }
#keyhint { position: absolute; left: 10px; bottom: 10px; font: 11px/1.3 system-ui, sans-serif; color: #1f3a6e; background: rgba(255,255,255,.78); padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.mk { position: absolute; transform: translate(-50%, -50%); background: #d9480f; color: #fff; font: 700 30px/1 system-ui, sans-serif; padding: 6px 11px; border-radius: 22px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap; }
/* ui=0: picture only (handout screenshots) */
body.noui { grid-template-rows: 1fr; } .noui #bar, .noui #side, .noui #stamp, .noui #keyhint, .noui #info, .noui #planpane { display: none !important; } .noui #main { grid-template-columns: 1fr !important; }

/* ---------- Customize: bottom tray, corner box, size tag ---------- */
#viewpane { position: relative; }
#ctray { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(28,33,40,.94); color: #eef2f6; padding: 8px 10px 10px; font-size: 12px; box-shadow: 0 -6px 18px rgba(0,0,0,.18); }
#ctray.hidden, #cbox.hidden, #ctag.hidden, #cname.hidden { display: none; }
#cname input { font: inherit; width: 150px; padding: 3px 6px; border-radius: 6px; border: 1px solid #56606c; background: #fff; color: #1b2633; }
#ctray .ctop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
#ctray .ctop b { color: #ffb15c; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
#ctray select, #ctray button { font: inherit; background: #3a424d; color: #eef2f6; border: 1px solid #56606c; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
#ctray button:hover { background: #4a5462; }
#ctray details { position: relative; } #ctray summary { cursor: pointer; }
#ctray details > div { position: absolute; bottom: 26px; left: 0; min-width: 260px; max-height: 200px; overflow: auto; background: #fff; color: #1b2633; border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#ctray details a { color: #c25400; margin-left: 6px; } #ctray .dim, #cbox .dim { color: #8a96a3; }
#ctray .csave { margin-left: auto; color: #9fb0c0; font-size: 11px; }
#ctray .citems { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.citem { flex: none; width: 112px; background: #3a424d; border: 1px solid #56606c; border-radius: 8px; padding: 4px 4px 6px; text-align: center; cursor: grab; user-select: none; touch-action: none; }
.citem:hover { border-color: #ffb15c; } .citem img { width: 104px; height: 78px; display: block; margin: 0 auto 2px; }
.citem small { color: #9fb0c0; font-size: 10px; } .citem.add { cursor: help; border-style: dashed; background: transparent; }
.citem .plus { height: 78px; line-height: 78px; font-size: 30px; color: #ffb15c; }
#cbox { position: absolute; right: 12px; top: 12px; z-index: 7; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(20,40,70,.18); padding: 10px 12px; font-size: 12px; color: var(--ink); }
#cbox .ch { display: flex; justify-content: space-between; align-items: center; font-size: 14px; } #cbox .x { cursor: pointer; font-size: 18px; color: #66758a; }
#cbox .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
#cbox input { width: 64px; font: inherit; padding: 2px 4px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; } #cbox button { font: inherit; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: #f3f6f9; color: var(--ink); cursor: pointer; }
#cbox button.danger { color: #b3261e; border-color: #e3b6b2; background: #fff5f4; }
#ctag { position: absolute; z-index: 6; transform: translate(-50%, -100%); background: #1b2633; color: #fff; font: 600 12px/1.3 system-ui, sans-serif; padding: 3px 7px; border-radius: 5px; pointer-events: none; white-space: nowrap; text-align: center; }
#ctag span { font-weight: 400; color: #ffcf99; font-size: 11px; }
body.customizing #keyhint { bottom: 186px; }
