:root{--bg:#0f1720;--panel:rgb(11, 18, 32);--accent:#0ea5ff;--muted:#94a3b8}
*{box-sizing:border-box;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Roboto,Arial}
body{margin:0;background:linear-gradient(180deg,#071024,#0b1220);color:#e6eef8}
.title{font-weight:600}
.bigbuttons{display:flex;gap:10px}
.big{background:transparent;border:1px solid rgba(255,255,255,0.06);padding:10px 16px;border-radius:8px;font-size:16px;cursor:pointer}
.big.active{background:var(--accent);color:#04243a}
#toolbar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:rgba(11, 18, 32, 0.9);gap:10px;position:sticky;top:0;left:0;right:0;z-index:9999;width:100%;backdrop-filter:blur(6px);box-shadow:0 6px 18px rgba(2,6,23,0.5)}
.title{font-weight:600}
.bigbuttons{display:flex;gap:10px}
.big{background:transparent;border:1px solid rgba(255,255,255,0.06);padding:10px 16px;border-radius:8px;font-size:16px;cursor:pointer}
.big.active{background:var(--accent);color:#04243a}
input,button{border:1px solid rgba(255,255,255,0.06);background:transparent;color:inherit;padding:6px;border-radius:6px}
#canvasWrap{position:relative;margin:6px;display:block;overflow:auto}
#bg{max-width:none;max-height:none;border:1px solid rgba(255,255,255,0.04);display:block}
#overlay{position:absolute;left:0;top:0;cursor:crosshair}
#info{padding:10px 14px;font-size:14px}
#results{margin-top:6px;color:var(--accent)}

.measurement{background:rgba(0,0,0,0.4);padding:6px;border-radius:6px;border:1px solid rgba(255,255,255,0.03)}

@media (max-width:700px){#toolbar{flex-direction:column;align-items:stretch}.bigbuttons{flex-wrap:wrap}}

/* When embedded in an iframe we want the page to auto-fit image to the iframe viewport */
/* Embedded (iframe) layout: fill available area and center the image */
html,body{height:100%}
body.embedded{height:100%;margin:0}
body.embedded #canvasWrap{overflow:hidden;height:100%;display:flex;align-items:center;justify-content:center}
body.embedded #bg{max-width:100%;max-height:100%;width:auto;height:auto;display:block;margin:0}
