:root { font: 15px system-ui, sans-serif; color: #eef4f5; background: #10202b; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .85rem 1rem; background: #172e3d; }
header strong { font-size: 1.15rem; }
header span, #fileinfo, #notehint, #partdims, aside label { font-size: .85rem; color: #c5d7e4; }
main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); gap: .9rem; padding: .9rem; }
.viewport { position: relative; }
#view { height: min(72dvh, 900px); min-height: 290px; touch-action: none; overflow: hidden; border-radius: 10px; background: #e8eff1; }
#view canvas { display: block; }
#info { position: absolute; top: .65rem; left: .65rem; pointer-events: none; max-width: calc(100% - 1.3rem); background: #152c3cf2; padding: .55rem .75rem; border-radius: 8px; overflow-wrap: anywhere; }
#dims, #partdims { margin-top: .2rem; }
button, .upload, select { border: 1px solid #587689; background: #294b5e; color: white; padding: .58rem .7rem; border-radius: 8px; font: inherit; }
button, .upload { cursor: pointer; }
button:hover:not(:disabled), .upload:hover, button[aria-pressed=true] { background: #376680; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, textarea:focus-visible, select:focus-visible, .upload:focus-within { outline: 2px solid #85d7f9; outline-offset: 2px; }
.upload { position: relative; display: inline-block; }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.toolbar, .controls { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
#status { min-height: 1.3em; font-size: .85rem; color: #b5d5e7; }
#status[role=alert] { color: #ffd9bd; }
aside { min-width: 0; }
aside details { background: #172e3d; border: 1px solid #476271; border-radius: 9px; padding: .8rem; margin-bottom: .65rem; }
summary { cursor: pointer; font-weight: 650; }
aside label { display: block; margin: .6rem 0 .3rem; }
select, textarea { width: 100%; }
textarea { min-height: 66px; resize: vertical; background: #eef4f5; color: #11232c; padding: .55rem; border-radius: 7px; border: 0; font: inherit; }
aside .check { display: flex; gap: .4rem; align-items: baseline; }
#notes { max-height: 14rem; overflow: auto; padding-left: 1.25rem; }
#notes li { padding: .25rem 0; overflow-wrap: anywhere; }
#notes small { display: block; color: #c5d7e4; }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  main { display: block; padding: .65rem; }
  #view { height: 52dvh; }
  .toolbar, .controls { font-size: .9rem; }
}
#dimension-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#dimension-labels span { position: absolute; transform: translate(-50%, -50%); background: #fff3dd; color: #753313; border-radius: 5px; padding: .18rem .35rem; font-size: .76rem; white-space: nowrap; }
#dimension-summary { font-size: .9rem; line-height: 1.45; }

#view-message { position: absolute; top: 42%; inset-inline: 8%; z-index: 2; margin: 0; padding: .8rem; border-radius: 8px; background: #172e3d; color: #fff; text-align: center; pointer-events: none; }

#component-search { width: 100%; padding: .65rem; border: 1px solid #587689; border-radius: 7px; font: inherit; }
#component-count { font-size: .8rem; color: #c5d7e4; margin: .35rem 0; }
