:root {
  color-scheme: dark;
  background: #121924;
  color: #f0f3f7;
  --panel: #1c2635;
  --raised: #253248;
  --line: #45536a;
  --muted: #bdc7d5;
  --orange: #ff9b55;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #f0f3f7; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
header,footer { padding: 12px max(16px,calc((100% - 1230px)/2)); display:flex; align-items:center; gap: 15px; font-size:14px; }
header { justify-content:space-between; border-bottom: 1px solid var(--line); }
.brand { display:flex; align-items:center; gap:8px; font-weight:740; text-decoration:none; }
.brand img { border-radius:7px; }
main { width:min(1230px,calc(100% - 32px)); margin:clamp(23px,4vw,48px) auto 15px; }
h1 { margin:0; font-size:clamp(35px,6vw,63px); line-height:1.05; letter-spacing:-.05em; }
.intro { color:var(--muted); margin:10px 0 18px; }
.topbar { padding:11px; display:flex; flex-wrap:wrap; gap:9px; align-items:center; border:1px solid var(--line); border-radius:10px; background:var(--panel); margin-bottom:10px; }
button, select, input { font:inherit; }
button, .file { color:#f0f3f7; background:var(--raised); border:1px solid var(--line); border-radius:7px; padding:8px 10px; font-weight:680; font-size:13px; cursor:pointer; }
button:disabled { opacity:.45; cursor:default; }
button[aria-pressed=true], .mark[aria-current=true] { color:#1d2732; background:#dce7f7; }
.file { position:relative; display:inline-flex; }
.file input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.file:focus-within { outline:3px solid var(--orange); }
.orange { background:var(--orange); color:#252325; border-color:var(--orange); }
#download { margin-left:auto; }
#dimensions, #hint, #status, #empty, footer { color:var(--muted); font-size:13px; }
.workspace { display:grid; grid-template-columns:minmax(0,1fr) 286px; gap:10px; }
.stage { min-width:0; min-height:390px; display:grid; place-items:center; border-radius:10px; border:1px solid var(--line); overflow:hidden; background:#0d131c; }
#empty { text-align:center; margin:20px; }
canvas { display:block; width:auto; height:auto; max-width:100%; max-height:680px; touch-action:none; cursor:crosshair; }
canvas[data-mode=select] { cursor:grab; }
aside { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px; }
.toolrow { display:flex; flex-wrap:wrap; gap:5px; }
.color { display:flex; align-items:center; gap:10px; margin-top:10px; font-size:13px; }
select, .coordinates input { color:#f0f3f7; background:var(--raised); border:1px solid #5f6c81; padding:5px 6px; border-radius:6px; }
#hint { min-height:2em; }
.list-head { display:flex; justify-content:space-between; align-items:center; }
#marks { list-style:none; margin:9px 0; padding:0; max-height:175px; overflow:auto; display:grid; gap:5px; }
.mark { text-align:left; width:100%; }
.coordinates { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.coordinates label { display:grid; gap:4px; font-size:12px; min-width:0; margin-bottom:6px; }
.coordinates input { width:100%; min-width:0; }
#status { min-height:18px; }
#status.error { color:#ffb1b7; }
footer { flex-wrap:wrap; }
.info { max-width:730px; line-height:1.65; }
.info h1 { font-size:42px; }
@media(max-width:760px) {
  .workspace { grid-template-columns:minmax(0,1fr); }
  .stage { min-height:220px; }
}
@media(max-width:430px) {
  #dimensions { order:3; width:100%; }
}
