:root {
    --bg: #0b0f14;
    --panel: #121821;
    --panel-2: #1a2230;
    --text: #e8eef7;
    --muted: #9fb0c3;
    --accent: #4da3ff;
    --accent-2: #2dd4bf;
    --danger: #ef4444;
    --border: #233043;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}
.container {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100vh;
}
.sidebar {
    border-right: 1px solid var(--border);
    background: var(--panel);
    padding: 16px;
    overflow: auto;
}
.main {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
}
h2 {
    margin: 0 0 12px 0;
    font-size: 16px;
    letter-spacing: .3px;
}
.group { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type="file"], select, input[type="color"], input[type="number"], input[type="range"], button, .btn {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 14px;
}
input[type="range"] { padding: 0; height: 34px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.small { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); background: var(--panel); align-items: center; }
.toolbar .btn { width: auto; }
.btn { cursor: pointer; background: var(--panel-2); border: 1px solid var(--border); }
.btn.primary { background: linear-gradient(180deg, var(--accent), #397dd1); border-color: #2c6ab6; color: #001223; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.canvas-wrap { position: relative; display: grid; place-items: center; height: calc(100vh - 160px); overflow: auto; background: #0d131b; }
canvas { background: #111; max-width: 100%; height: auto; box-shadow: 0 10px 30px rgba(0,0,0,.3); border-radius: 8px; }
.overlay {
    position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.hint { background: rgba(20,28,40,.9); border: 1px dashed var(--border); padding: 12px 16px; border-radius: 8px; color: var(--muted); }
.stage {
    position: relative; display: inline-block; line-height: 0;
}
.handle { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-2); border: 2px solid #0b141e; transform: translate(-50%, -50%); cursor: grab; box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.handle.qr { background: #f59e0b; }
.guide { position: absolute; background: #60a5fa; opacity: 0; pointer-events: none; z-index: 5; }
.guide.v { width: 1px; height: 100%; left: 50%; top: 0; transform: translateX(-0.5px); }
.guide.h { height: 1px; width: 100%; top: 50%; left: 0; transform: translateY(-0.5px); }
.guide.active { opacity: .9; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: #0f1622; color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.text { background: var(--accent-2); }
.dot.qr { background: #f59e0b; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--panel-2); }
.radio input { margin: 0; }
.flex { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; color: var(--muted); }
.footer { padding: 10px 12px; border-top: 1px solid var(--border); background: var(--panel); display: flex; justify-content: space-between; align-items: center; }
.warn { color: #ffd166; font-size: 12px; }
.ok { color: #42d392; font-size: 12px; }
.error { color: var(--danger); font-size: 12px; }


