/* Light theme */
:root{
  --bg: #f6f8ff;
  --panel: #ffffff;
  --panel2:#f0f4ff;
  --muted:#4b5f86;
  --text:#0f172a;
  --accent:#2563eb;
  --danger:#e11d48;
  --ok:#16a34a;
  --line:#d9e3ff;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.10);
  --radius:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  color:var(--text);
  background: radial-gradient(1200px 800px at 20% 0%, #eaf0ff 0%, transparent 60%),
              radial-gradient(1200px 800px at 100% 30%, #f3f7ff 0%, transparent 65%),
              var(--bg);
  overflow:hidden;
}

.app{height:100%; display:grid; grid-template-rows:auto 1fr;}
header{
  display:flex; gap:10px; align-items:center; padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
}
header .brand{font-weight:750; letter-spacing:.2px}
header .pill{
  padding:6px 10px; border:1px solid var(--line); border-radius:999px;
  background:rgba(240,244,255,.8); color:var(--muted)
}
header .spacer{flex:1}

button, input, select{
  font:inherit; color:inherit;
  border:1px solid var(--line); background:rgba(255,255,255,.9);
  border-radius:10px; padding:9px 10px;
  outline:none;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
input[type="number"]{width:92px}
input[type="range"]{padding:0; border:none; background:transparent}
button{cursor:pointer}
button:hover{border-color:#b6c7ff}

.btn-primary{
  background:linear-gradient(180deg, rgba(37,99,235,.18), rgba(37,99,235,.06));
  border-color:rgba(37,99,235,.35);
}
.btn-danger{
  background:linear-gradient(180deg, rgba(225,29,72,.16), rgba(225,29,72,.05));
  border-color:rgba(225,29,72,.28);
}
.btn-ok{
  background:linear-gradient(180deg, rgba(22,163,74,.18), rgba(22,163,74,.06));
  border-color:rgba(22,163,74,.30);
}
.btn-ghost{background:rgba(240,244,255,.75)}
button.active{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 2px rgba(37,99,235,.12) inset;
}

.row{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.stack{display:flex; flex-direction:column; gap:6px}
.sep{width:1px; height:30px; background:var(--line); margin:0 6px}
.main{
  height:100%;
  display:grid;
  grid-template-columns: 340px 1fr;
  min-height:0;
}
aside{
  min-height:0;
  border-right:1px solid var(--line);
  background:rgba(255,255,255,.55);
  display:grid;
  grid-template-rows:auto 1fr auto;
}
.drop{
  margin:12px; padding:12px;
  border:1px dashed rgba(75,95,134,.35);
  border-radius:var(--radius);
  background:rgba(240,244,255,.65);
  color:var(--muted);
}
.drop strong{color:var(--text)}
.list{min-height:0; overflow:auto; padding:0 12px 12px}
.item{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.85);
  margin-top:10px;
  cursor:pointer;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.item.selected{
  border-color:rgba(37,99,235,.45);
  box-shadow: 0 0 0 2px rgba(37,99,235,.10) inset, var(--shadow);
}
.thumb{
  width:64px; height:64px; border-radius:12px; overflow:hidden;
  background:#eef2ff; border:1px solid rgba(217,227,255,.9);
  display:flex; align-items:center; justify-content:center; color:var(--muted)
}
.thumb img{width:100%; height:100%; object-fit:cover; display:block}
.meta{min-width:0}
.meta .name{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.meta .sub{color:var(--muted); font-size:12px; margin-top:2px}
.meta .actions{display:flex; gap:8px; margin-top:8px}
.meta .actions button{padding:7px 9px; border-radius:10px}

.footerActions{
  padding:12px; border-top:1px solid var(--line);
  display:flex; gap:8px; flex-wrap:wrap;
  background:rgba(255,255,255,.65);
}

.content{
  min-height:0;
  display:grid;
  grid-template-rows:auto 1fr auto;
}
.toolbar{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  background:rgba(255,255,255,.55);
}
.toolbar .hint{color:var(--muted)}

.editor{
  min-height:0;
  display:grid;
  grid-template-columns: 1fr 340px;
  gap:12px;
  padding:12px;
}
.canvasWrap{
  min-height:0;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.72);
  display:grid;
  grid-template-rows:auto 1fr;
  overflow:hidden;
  box-shadow: var(--shadow);
}
.canvasTop{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  background:rgba(240,244,255,.75);
}
.canvasTop .small{color:var(--muted); font-size:12px}
canvas{width:100%; height:100%; display:block; background:#ffffff}

.sidePanel{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.72);
  padding:12px;
  display:flex; flex-direction:column; gap:10px;
  min-height:0;
  box-shadow: var(--shadow);
}

.card{
  border:1px solid rgba(217,227,255,.95);
  border-radius:14px;
  background:rgba(240,244,255,.55);
  padding:10px;
}
.card h3{margin:0 0 8px 0; font-size:13px; color:var(--muted); font-weight:750}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.k{color:var(--muted); font-size:12px}
.v{font-weight:750}
.tiny{font-size:12px}

.videoControls{display:none}
.videoControls.show{display:block}

.statusBar{
  padding:10px 14px;
  border-top:1px solid var(--line);
  color:var(--muted);
  display:flex; gap:12px; flex-wrap:wrap;
  background:rgba(255,255,255,.55);
}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding:2px 6px; border:1px solid rgba(217,227,255,.95);
  border-radius:7px; background:rgba(255,255,255,.9); color:var(--text); font-size:12px
}
.toast{
  position:fixed; bottom:14px; left:50%; transform:translateX(-50%);
  background:rgba(255,255,255,.96);
  border:1px solid rgba(217,227,255,.95);
  border-radius:999px; padding:10px 14px; color:var(--text);
  box-shadow: 0 18px 60px rgba(15,23,42,.15);
  display:none;
}
.toast.show{display:block}
.muted{color:var(--muted)}
code{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;}
