:root {
  --yellow:#f5b700; --yellow-soft:#f5b70024; --charcoal:#232019; --light:#fafaf8;
  --panel:#ffffff; --line:#2320191f; --line-strong:#2320193d; --muted:#23201980;
  --danger:#a03232; --radius:.6rem;
}
* { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body { background:var(--light); color:var(--charcoal); font-size:14px; line-height:1.45;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; color:inherit; }

/* ---------- shell ---------- */
#shell { display:flex; flex-direction:column; height:100%; }
header { display:flex; align-items:center; gap:.85rem; padding:.7rem 1.1rem;
  border-bottom:1px solid var(--line); background:var(--panel); flex:none; }
/* The mark is a screen with a slide sitting inside it, from the identity file
   in Corporate identity. */
.mark { width:2rem; height:1.64rem; flex:none; display:block; }
.brand { font-weight:650; letter-spacing:-.01em; }
nav { display:flex; gap:.15rem; margin-left:.9rem; }
nav button { background:none; border:0; padding:.4rem .75rem; border-radius:var(--radius);
  color:var(--muted); cursor:pointer; font-weight:500; }
nav button:hover { background:#2320190a; }
nav button[aria-current="true"] { background:var(--charcoal); color:var(--light); }
.spacer { margin-left:auto; }
.node-tag { font-size:.7rem; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }

/* ---------- buttons ---------- */
.btn { padding:.45rem 1rem; border:1px solid transparent; border-radius:var(--radius);
  background:var(--yellow); font-weight:600; cursor:pointer; white-space:nowrap; }
.btn:disabled { opacity:.45; cursor:default; }
.btn.ghost { background:transparent; border-color:var(--line-strong); font-weight:500; }
.btn.ghost:hover:not(:disabled) { background:#2320190a; }
.btn.danger { background:transparent; border-color:transparent; color:var(--danger); font-weight:500; }
.btn.small { padding:.28rem .6rem; font-size:.82rem; }
.icon-btn { border:0; background:none; cursor:pointer; padding:.25rem .4rem; border-radius:.35rem; color:var(--muted); }
.icon-btn:hover { background:#2320190f; color:var(--charcoal); }

/* ---------- editor layout ---------- */
#view { flex:1; min-height:0; }
.editor { display:grid; grid-template-columns:13rem minmax(0,1fr) 19rem; height:100%; min-height:0; }
.rail { border-right:1px solid var(--line); background:var(--panel); overflow-y:auto; padding:.7rem; }
.inspector { border-left:1px solid var(--line); background:var(--panel); overflow-y:auto; padding:.9rem; }
.stage-wrap { display:flex; flex-direction:column; min-width:0; min-height:0; }
.toolbar { display:flex; align-items:center; gap:.4rem; padding:.55rem .8rem;
  border-bottom:1px solid var(--line); background:var(--panel); flex:none; flex-wrap:wrap; }
.toolbar .sep { width:1px; height:1.3rem; background:var(--line); margin:0 .3rem; }
.stage-pad { flex:1; display:grid; place-items:center; padding:1.4rem; min-height:0; overflow:auto; background:#efefea; }

/* ---------- canvas ---------- */
#canvas { container-type:size; position:relative; aspect-ratio:16/9; width:100%; max-width:min(100%, 62rem);
  background:#111; box-shadow:0 .6rem 2rem #23201926; overflow:hidden; user-select:none; }
.layer { position:absolute; overflow:hidden; }
.layer.text { display:flex; padding:.4em; word-break:break-word; }
.layer img { width:100%; height:100%; display:block; }
.layer.selected { outline:2px solid var(--yellow); outline-offset:0; }
.handle { position:absolute; width:11px; height:11px; background:var(--panel);
  border:2px solid var(--yellow); border-radius:2px; }
.handle.nw { left:-6px; top:-6px; cursor:nwse-resize; }
.handle.ne { right:-6px; top:-6px; cursor:nesw-resize; }
.handle.sw { left:-6px; bottom:-6px; cursor:nesw-resize; }
.handle.se { right:-6px; bottom:-6px; cursor:nwse-resize; }
.empty-canvas { position:absolute; inset:0; display:grid; place-items:center; color:#ffffff5c; font-size:.9rem; }

/* ---------- filmstrip ---------- */
.strip-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:.5rem; }
.strip-head h2, .inspector h2 { font-size:.66rem; letter-spacing:.15em; text-transform:uppercase; color:var(--muted); }
.slide-chip { border:1px solid var(--line); border-radius:var(--radius); padding:.5rem .55rem;
  margin-bottom:.45rem; cursor:pointer; background:var(--panel); }
.slide-chip[aria-current="true"] { border-color:var(--yellow); box-shadow:0 0 0 2px var(--yellow-soft); }
.slide-chip.dragging { opacity:.4; }
.slide-chip.drop-target { border-top:2px solid var(--yellow); }
.slide-chip .name { font-weight:550; font-size:.86rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slide-chip .meta { font-size:.72rem; color:var(--muted); display:flex; gap:.4rem; align-items:center; margin-top:.2rem; }
.slide-chip .meta.stacked { display:block; }
.chip-head { display:flex; align-items:center; gap:.25rem; }
.chip-head .name { flex:1; min-width:0; }
.target-line { display:block; font-size:.72rem; color:var(--charcoal); line-height:1.35;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slide-chip.disabled .name { text-decoration:line-through; color:var(--muted); }
.thumb { container-type:size; aspect-ratio:16/9; border-radius:.3rem; background:#1b1a16; margin-bottom:.35rem;
  position:relative; overflow:hidden; }
.thumb .tl { position:absolute; overflow:hidden; }

/* ---------- inspector ---------- */
.field { margin-bottom:.7rem; }
.field label { display:block; font-size:.74rem; color:var(--muted); margin-bottom:.2rem; }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  width:100%; padding:.38rem .5rem; border:1px solid var(--line-strong); border-radius:.4rem; background:var(--panel); }
.field textarea { min-height:4.5rem; resize:vertical; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.row { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.swatches { display:flex; gap:.3rem; flex-wrap:wrap; }
.swatch { width:1.4rem; height:1.4rem; border-radius:.3rem; border:1px solid var(--line-strong); cursor:pointer; }
.hint { font-size:.76rem; color:var(--muted); }

/* ---------- generic pages ---------- */
.page { max-width:58rem; margin:0 auto; padding:1.6rem; display:grid; gap:1rem; }
.card { border:1px solid var(--line); border-radius:.7rem; background:var(--panel); padding:1.1rem 1.2rem; }
.card h2 { margin-bottom:.8rem; }
.banner { border-radius:.55rem; padding:.7rem .85rem; background:var(--yellow-soft);
  border:1px solid #f5b70066; margin-bottom:.5rem; }
.banner.bad { background:#a032321a; border-color:#a0323244; }
table { width:100%; border-collapse:collapse; }
th,td { text-align:left; padding:.45rem .35rem; border-bottom:1px solid var(--line); }
th { font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); font-weight:600; }
.muted { color:var(--muted); }
.pill { font-size:.7rem; padding:.1rem .45rem; border-radius:1rem; background:#2320190f; }
.pill.on { background:var(--yellow-soft); }

/* ---------- dialog ---------- */
dialog { border:0; border-radius:.8rem; padding:0; max-width:30rem; width:calc(100% - 2rem);
  box-shadow:0 1.2rem 3rem #23201933; }
dialog::backdrop { background:#23201966; }
dialog .body { padding:1.2rem; }
dialog h2 { margin-bottom:.8rem; }
.target { display:flex; align-items:center; gap:.6rem; padding:.5rem; border:1px solid var(--line);
  border-radius:var(--radius); margin-bottom:.35rem; cursor:pointer; }
.target:hover { background:#2320190a; }
.target[aria-selected="true"] { border-color:var(--yellow); background:var(--yellow-soft); }

/* ---------- sign in ---------- */
.signin { max-width:22rem; margin:4rem auto; }
.err { color:var(--danger); font-size:.85rem; margin-top:.5rem; }
.dirty-dot { width:.45rem; height:.45rem; border-radius:50%; background:var(--yellow); display:inline-block; }

/* ---------- shape picker ---------- */
.shape-picker { margin-bottom:.8rem; }
.tabs { display:flex; gap:.15rem; margin-bottom:.5rem; }
.tab { flex:1; border:0; background:none; padding:.3rem .2rem; border-radius:.35rem; font-size:.78rem;
  color:var(--muted); cursor:pointer; }
.tab:hover { background:#2320190a; }
.tab[aria-selected="true"] { background:var(--charcoal); color:var(--light); }
.shape-picker input[type=text] { width:100%; padding:.35rem .5rem; margin-bottom:.5rem;
  border:1px solid var(--line-strong); border-radius:.4rem; }
.shape-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:.25rem;
  max-height:13rem; overflow-y:auto; padding:.1rem; }
.shape-tile { aspect-ratio:1; display:grid; place-items:center; padding:.28rem; cursor:pointer;
  border:1px solid var(--line); border-radius:.4rem; background:var(--panel); color:var(--charcoal); }
.shape-tile:hover { background:#2320190a; }
.shape-tile[aria-selected="true"] { border-color:var(--yellow); box-shadow:0 0 0 2px var(--yellow-soft); }
.shape-tile svg { width:100%; height:100%; }
.solid-preview { width:80%; height:70%; background:currentColor; border-radius:1px; }
.licence { margin-top:.4rem; font-size:.7rem; }

/* ---------- where a slide plays ---------- */
.targets { display:grid; gap:.15rem; }
.target-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; align-items:center;
  gap:.4rem; padding:.3rem .4rem; border:1px solid var(--line); border-radius:.4rem;
  cursor:pointer; background:var(--panel); }
.target-row:hover { background:#2320190a; }
.target-row[aria-selected="true"] { border-color:var(--yellow); background:var(--yellow-soft); }
.target-row.covered { cursor:default; color:var(--muted); background:#2320190a; border-style:dashed; }
.target-row.covered:hover { background:#2320190a; }
.target-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.84rem; }
.tick { color:#2f8f4f; font-weight:700; width:1rem; text-align:center; }
.seconds { width:3rem; min-width:0; padding:.15rem .25rem; border:1px solid var(--line-strong);
  border-radius:.3rem; font-size:.8rem; text-align:right; }
.seconds::-webkit-outer-spin-button, .seconds::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.seconds { -moz-appearance:textfield; }
.sec { font-size:.72rem; }

/* ---------- rotation ---------- */
.rotation { display:grid; grid-template-columns:minmax(0,1fr) 3.4rem auto; gap:.35rem; align-items:center; }
.rotation input[type=range] { width:100%; accent-color:var(--yellow); }
.rotation input[type=number] { width:100%; padding:.25rem .3rem; border:1px solid var(--line-strong);
  border-radius:.3rem; font-size:.8rem; text-align:right; }

/* ---------- colour wheel ---------- */
.wheel { width:1.4rem; height:1.4rem; border-radius:.3rem; cursor:pointer; overflow:hidden; position:relative;
  border:1px solid var(--line-strong); flex:none;
  background:conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); }
.wheel input { position:absolute; inset:-25%; width:150%; height:150%; opacity:0; cursor:pointer; border:0; padding:0; }

/* ---------- widgets ---------- */
.widget-choices { display:flex; gap:.25rem; flex-wrap:wrap; margin-bottom:.5rem; }
.widget-choice { border:1px solid var(--line-strong); background:var(--panel); border-radius:.4rem;
  padding:.3rem .6rem; font-size:.82rem; cursor:pointer; }
.widget-choice:hover { background:#2320190a; }
.widget-choice[aria-selected="true"] { background:var(--charcoal); color:var(--light); border-color:var(--charcoal); }

.swatches.used { margin-top:.3rem; padding-top:.3rem; border-top:1px dashed var(--line); }
.multiselect { display:grid; gap:.1rem; max-height:9rem; overflow-y:auto; padding:.25rem;
  border:1px solid var(--line); border-radius:.4rem; }
.multiselect label { font-size:.82rem; }
.canvas-size { font-size:.7rem; color:var(--muted); letter-spacing:.08em; }

/* A guide only exists while something is being dragged onto it. */
.snap-guide { box-shadow:0 0 0 .5px #f5b70066; }

.places { display:grid; gap:.15rem; max-height:9rem; overflow-y:auto; margin-top:.3rem; }
.place { text-align:left; border:1px solid var(--line); background:var(--panel); border-radius:.35rem;
  padding:.25rem .45rem; font-size:.8rem; cursor:pointer; }
.place:hover { background:#2320190a; }
