/* The BackdropKit editor: a Claude Code window with the theme being made playing behind it,
   the way the landing page is drawn. The scene fills the window; the window's parts float on
   frosted glass over it: the Mac menu bar and title row at the top, Layers at the left, the
   inspector at the right, the day in the composer at the bottom. The panels keep one tone
   while the day moves: smoked frost with light ink by default (View > Panels: Dark, Light or
   Follow the scene). The frost is thick enough to read over the brightest scene, a white
   picture filling the window. The scene brings the colour; the interface adds colour only for
   state.

   Every colour, radius, blur, spacing, shadow and size is a token here, so a re-skin is a
   change of this block. */
:root {
  /* Ink and glass (light scenes) */
  --ink: #18212b;
  --ink-2: #4f5b68;
  --ink-3: #5e6976;
  --ink-inv: #ffffff;
  --glass: rgba(255, 255, 255, 0.4);
  --glass-2: rgba(255, 255, 255, 0.66);
  --glass-line: rgba(255, 255, 255, 0.55);
  --panel: rgba(246, 249, 252, 0.92);
  --card: rgba(255, 255, 255, 0.62);
  --solid: rgba(255, 255, 255, 0.97);
  --bubble: rgba(255, 255, 255, 0.86);
  --haze: rgba(244, 248, 252, 0.72);
  --bar: rgba(250, 252, 255, 0.88);
  --title: rgba(246, 249, 252, 0.88);
  --line: rgba(20, 32, 46, 0.1);
  --line-2: rgba(20, 32, 46, 0.18);
  --track: rgba(20, 32, 46, 0.14);
  --shade: rgba(22, 34, 52, 0.14);
  --glow: rgba(20, 32, 46, 0.14);
  --ground: #1b2430;
  --hint-bg: #18212b;
  --hint-ink: #ffffff;
  /* State: the only colour the interface brings */
  --ok: #23845a;
  --warn: #a8650f;
  --err: #c93b3b;
  /* Type */
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, sans-serif;
  --mono: ui-monospace, "SF Mono", "Geist Mono", Menlo, monospace;
  --fs: 13px;
  --fs-s: 12px;
  --fs-xs: 11px;
  /* Radii */
  --r-xs: 5px;
  --r-s: 7px;
  --r-m: 10px;
  --r-l: 14px;
  --r-pill: 999px;
  /* Blur */
  --blur: blur(28px) saturate(1.4);
  --blur-bar: blur(24px) saturate(1.4);
  --blur-band: blur(18px) saturate(1.12);
  /* Spacing (4 px steps) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --gap: 10px;
  /* Shadows */
  --sh-1: 0 1px 2px var(--shade);
  --sh-2: 0 10px 30px var(--shade), 0 1px 2px var(--shade);
  --sh-pop: 0 18px 44px var(--shade), 0 2px 6px var(--shade);
  /* Sizes */
  --col: 730px;
  --bar-h: 26px;
  --title-h: 40px;
  --head: calc(var(--bar-h) + var(--title-h) + env(safe-area-inset-top, 0px));
  --side-l: 276px; /* what the left panel takes, gaps included */
  --side-r: 352px;
  --rail: 62px;
  --dock-h: 112px;
  --row-h: 44px;
  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 120ms;
  --t: 220ms;
  color-scheme: light;
}
:root[data-tone="dark"] {
  --ink: #eef2f6;
  --ink-2: #b2bcc7;
  --ink-3: #97a2ae;
  --ink-inv: #10151c;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.13);
  --glass-line: rgba(255, 255, 255, 0.12);
  --panel: rgba(16, 20, 28, 0.92);
  --card: rgba(255, 255, 255, 0.05);
  --solid: rgba(24, 28, 37, 0.97);
  --bubble: rgba(40, 46, 58, 0.92);
  --haze: rgba(10, 14, 22, 0.66);
  --bar: rgba(14, 18, 26, 0.86);
  --title: rgba(16, 20, 28, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --track: rgba(255, 255, 255, 0.16);
  --shade: rgba(0, 0, 0, 0.34);
  --glow: rgba(255, 255, 255, 0.16);
  --hint-bg: #f1f4f7;
  --hint-ink: #12171e;
  --ok: #5fd39a;
  --warn: #f0b45a;
  --err: #ff8a80;
  color-scheme: dark;
}

/* ---- Base ---- */
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: var(--fs)/1.45 var(--text); -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
input, textarea, select { user-select: text; -webkit-user-select: text }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
h2, h3, h4 { margin: 0 }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-xs) }
svg.i { width: 16px; height: 16px; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round }
svg.i.flipx, .flipx svg.i { transform: scaleX(-1) }
kbd { font: 500 10.5px/1 var(--mono); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums }
.dim { color: var(--ink-3) }

/* ---- The scene behind everything ---- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--ground); overflow: hidden }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated }
.backdrop, .playing { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 100% }
.backdrop { opacity: 0; transition: opacity 0.9s ease }
.backdrop.on { opacity: 1 }
body:not(.starting) .backdrop { display: none }
body.starting #view { visibility: hidden }
.playing { z-index: 1; object-fit: fill }

/* ---- Mac menu bar and the window's title row ---- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bar) }
.top { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); z-index: 20 }
.menubar, .titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding-left: max(var(--s2), env(safe-area-inset-left, 0px)); padding-right: max(var(--s3), env(safe-area-inset-right, 0px));
  -webkit-backdrop-filter: var(--blur-bar); backdrop-filter: var(--blur-bar);
}
.menubar { height: var(--bar-h); background: var(--bar); font-size: var(--fs); line-height: 1 }
.titlebar { height: var(--title-h); background: var(--title); border-bottom: 1px solid var(--line); font-size: 13.5px }
.side { display: flex; align-items: center; gap: 2px; min-width: 0 }
.mb-item { display: inline-flex; align-items: center; gap: 7px; height: 21px; padding: 0 9px; border: 0; border-radius: var(--r-xs); background: none; text-decoration: none; cursor: default; white-space: nowrap }
button.mb-item:hover, .mb-item.open { background: var(--glass-2) }
.mb-app { font-weight: 650 }
.mb-now { color: var(--ink-2) }
.mb-clock { font-variant-numeric: tabular-nums }
.mark { width: 14px; height: 14px; display: block; flex: none }
.title { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 0; background: none; border-radius: var(--r-s); white-space: nowrap; min-width: 0; font-weight: 550 }
.title span { overflow: hidden; text-overflow: ellipsis }
.title svg.i { width: 13px; height: 13px; color: var(--ink-3) }
.title:hover, .tb-btn:hover { background: var(--glass) }
.tb-btn { height: 28px; min-width: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); font-size: var(--fs); white-space: nowrap; transition: background var(--t-fast) ease, color var(--t-fast) ease }
.tb-btn svg.i { width: 17px; height: 17px }
.tb-btn[aria-pressed="true"] { color: var(--ink); background: var(--glass-2) }
.tb-btn.wide { padding: 0 11px 0 9px }
.saved { font-size: var(--fs-s); color: var(--ink-3); opacity: 0; transition: opacity 0.8s ease; white-space: nowrap; margin-left: var(--s1) }
.saved.show { opacity: 1 }
.saved.err { color: var(--err) }
body.starting .titlebar .tb-btn, body.starting .saved { visibility: hidden }
body.starting .titlebar #guide-btn { visibility: visible }
/* The guide, not yet opened: filled like a primary button, steady (no motion). */
#guide-btn { position: relative }
#guide-btn.fresh, #guide-btn.fresh:hover { color: var(--ink-inv); background: var(--ink); box-shadow: 0 0 0 3px var(--glass-2), 0 0 16px var(--glow) }

/* ---- Floating panels ---- */
.panel {
  position: fixed; z-index: 10; top: calc(var(--head) + var(--gap)); bottom: var(--gap);
  background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--r-l);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.side-l { left: var(--gap); width: calc(var(--side-l) - 2 * var(--gap)) }
.side-r { right: var(--gap); width: calc(var(--side-r) - 2 * var(--gap)) }
body.starting .panel, body.starting .dock, body.playing .panel, body.playing .dock, body.nopanels .panel { display: none }
.scroll { overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent }

/* Buttons */
.btn {
  height: 30px; padding: 0 var(--s3); border-radius: var(--r-s); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: var(--fs); font-weight: 500; text-decoration: none; border: 1px solid var(--line-2); background: var(--card); white-space: nowrap;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn:hover { background: var(--glass-2) }
.btn.primary { background: var(--ink); color: var(--ink-inv); border-color: var(--ink) }
.btn.primary:hover { opacity: 0.9 }
.btn.danger:hover { color: var(--err); border-color: var(--err) }
.btn:disabled { opacity: 0.45; cursor: default }
.btn svg.i { width: 15px; height: 15px }
label.btn { position: relative; cursor: pointer }
label.btn input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100% }
.ib { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); flex: none; transition: background var(--t-fast) ease }
.ib:hover { background: var(--glass-2); color: var(--ink) }
.link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); font-size: inherit }
.link:hover { text-decoration-color: var(--ink) }

/* ---- Left: tools, layers, your art ---- */
.tools { padding: var(--s2) var(--s2) var(--s2); border-bottom: 1px solid var(--line); display: grid; gap: 6px }
.trow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px }
.trow.sub { display: flex; align-items: center; gap: var(--s2); min-height: 28px; padding: 0 2px }
.tool { height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); transition: background var(--t-fast) ease, color var(--t-fast) ease }
.tool:hover { background: var(--glass); color: var(--ink) }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--ink-inv) }
.cur { width: 26px; height: 26px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: none; flex: none }
.cur i { display: block; width: 100%; height: 100%; border-radius: 3px; box-shadow: 0 0 0 1px var(--line) inset }
.cur i.none { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line-2) 3px 4px) !important }
.sizes { display: inline-flex; gap: 2px; margin-left: auto }
.sz { width: 28px; height: 26px; border: 0; border-radius: var(--r-s); background: none; display: grid; place-items: center; color: var(--ink-2) }
.sz i { display: block; background: currentColor; border-radius: 1px }
.sz:hover { background: var(--glass) }
.sz[aria-pressed="true"] { color: var(--ink); background: var(--glass-2) }
.tnote { font-size: var(--fs-s); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lhead { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s2) var(--s1) var(--s3) }
.lhead h2 { font: 600 var(--fs-s)/1 var(--text); color: var(--ink-2); letter-spacing: 0.01em }
.art-head { margin-top: var(--s2); border-top: 1px solid var(--line); padding-top: var(--s3) }
.lscroll { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-bottom: var(--s3); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; scrollbar-gutter: stable }
.layers { list-style: none; margin: 0; padding: 0 6px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px }
.lrow {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: var(--s2);
  height: var(--row-h); padding: 0 2px 0 4px; border-radius: var(--r-s); cursor: default; position: relative;
  transition: background var(--t-fast) ease;
}
.lrow:hover { background: var(--glass) }
.lrow[aria-selected="true"] { background: var(--glass-2) }
.lrow[aria-selected="true"] .lkind { color: var(--ink-2) }
.lt { width: 48px; height: 30px; border-radius: 4px; display: block; background: var(--shade); box-shadow: 0 0 0 1px var(--line) inset }
.lmeta { min-width: 0; display: grid; line-height: 1.25 }
.lname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lkind { font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lrow .eye, .lrow .more { width: 24px; height: 24px; border: 0; background: none; color: var(--ink-3); border-radius: var(--r-xs); display: grid; place-items: center; opacity: 0; transition: opacity var(--t-fast) ease }
.lrow:hover .eye, .lrow:hover .more, .lrow[aria-selected="true"] .more, .lrow.off .eye, .lrow .more.open { opacity: 1 }
.lrow .eye:hover, .lrow .more:hover { color: var(--ink); background: var(--glass) }
.lrow.off .lname, .lrow.off .lt { opacity: 0.4 }
.lrow.away .lt { opacity: 0.55 }
.lrow.dragging { opacity: 0.35 }
.lrow.above::before, .lrow.below::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 1px; background: var(--ink) }
.lrow.above::before { top: -1px }
.lrow.below::after { bottom: -1px }
.lempty { list-style: none; padding: var(--s2) var(--s2) var(--s1); color: var(--ink-2); font-size: var(--fs) }
.lempty p { margin: 0 0 4px }
.lhint { list-style: none; padding: var(--s2) var(--s2) var(--s1); color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.4 }
.art { padding: 0 var(--s2) }
.artdrop { width: 100%; display: grid; justify-items: center; gap: 6px; padding: var(--s4) var(--s3); border: 1px dashed var(--line-2); border-radius: var(--r-m); background: none; color: var(--ink-2); font-size: var(--fs-s); line-height: 1.4; text-align: center; transition: background var(--t-fast) ease, color var(--t-fast) ease }
.artdrop:hover { background: var(--glass); color: var(--ink) }
.artline { margin: var(--s2) 2px 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-3) }
.assets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px }
.asset { position: relative; padding: 0; border: 0; border-radius: var(--r-s); background: var(--shade); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 0 0 1px var(--line) inset; transition: box-shadow var(--t-fast) ease }
.asset canvas { width: 100%; height: 100%; display: block }
.asset:hover { box-shadow: 0 0 0 2px var(--ink) inset }
.asset .used { position: absolute; left: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1.5px var(--solid) }
.asset .frames { position: absolute; right: 4px; bottom: 4px; padding: 1px 4px; border-radius: 4px; background: var(--solid); color: var(--ink); font: 600 9.5px/1.3 var(--mono) }

/* ---- Right: the inspector, a rail of tabs and cards ---- */
.insp { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100%; min-height: 0 }
.rail { display: grid; align-content: start; gap: 2px; padding: var(--s2) 6px; border-right: 1px solid var(--line) }
.rt { display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; border: 0; border-radius: var(--r-m); background: none; color: var(--ink-3); font-size: 10.5px; font-weight: 500; transition: background var(--t-fast) ease, color var(--t-fast) ease }
.rt svg.i { width: 18px; height: 18px }
.rt:hover { color: var(--ink); background: var(--glass) }
.rt[aria-selected="true"] { color: var(--ink); background: var(--glass-2) }
.ipane { display: flex; flex-direction: column; min-height: 0; min-width: 0 }
.iscroll { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding: var(--s2); display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s2); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; scrollbar-gutter: stable }
/* Room for four lines, so a longer help does not push the controls up under the pointer. */
.helpline { flex: none; min-height: calc(4 * 1.45 * var(--fs-s) + 2 * var(--s3) + 1px); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-s); line-height: 1.45; color: var(--ink-2) }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s3) var(--s3) var(--s3); display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--s3); transition: box-shadow var(--t) ease }
.card.found, .ctl.found { box-shadow: 0 0 0 2px var(--ink) }
.chead { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 20px }
.chead h3 { font: 600 var(--fs)/1.2 var(--text) }
.sbody { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--s3) }
.card > .sbody:empty { display: none }
.note { margin: 0; font-size: var(--fs-s); line-height: 1.45; color: var(--ink-2) }
.note.dim { color: var(--ink-3) }
.note.state { color: var(--ink); font-weight: 500 }
.cardnote { padding: 0 var(--s1) }
.empty { padding: var(--s5) var(--s3); display: grid; gap: var(--s2); color: var(--ink-2) }
.empty h3 { color: var(--ink); font: 600 14px/1.3 var(--display) }
.empty p { margin: 0 0 var(--s1); font-size: var(--fs); line-height: 1.5 }
.brow { display: flex; flex-wrap: wrap; gap: 6px }
.brow .btn { height: auto; min-height: 28px; padding: 4px 10px; font-size: var(--fs-s); max-width: 100%; white-space: normal; text-align: left; line-height: 1.25 }

/* Controls: label at the left, value at the right */
.ctl { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 7px; border-radius: var(--r-s); transition: box-shadow var(--t) ease }
.ctl.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s2) }
.crow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); min-width: 0 }
.crow .cl { min-width: 0 }
.crow .cv { flex: none }
.cl { font-size: var(--fs); color: var(--ink) }
.cv { font: 500 var(--fs-xs)/1 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; cursor: default }
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 0; background: none; cursor: pointer; --p: 50%;
}
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p), var(--track) var(--p)) }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track) }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink) }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--solid); margin-top: -5px; box-shadow: 0 0 0 1px var(--line-2), 0 1px 3px var(--shade); transition: transform var(--t-fast) ease }
.range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--solid); box-shadow: 0 0 0 1px var(--line-2), 0 1px 3px var(--shade) }
.range:active::-webkit-slider-thumb { transform: scale(1.15) }
.segs { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-s); background: var(--glass); border: 1px solid var(--line) }
.segs { min-width: 0 }
.segs.wrap { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)) }
.sg { flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 var(--s2); border: 0; border-radius: var(--r-xs); background: none; color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; transition: background var(--t-fast) ease, color var(--t-fast) ease }
.sg:hover { color: var(--ink) }
.sg[aria-pressed="true"] { background: var(--solid); color: var(--ink); box-shadow: var(--sh-1); font-weight: 500 }
.selwrap { position: relative; display: inline-flex; align-items: center }
.sel { -webkit-appearance: none; appearance: none; height: 28px; padding: 0 28px 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card); font-size: var(--fs-s); max-width: 170px }
.selwrap svg.i { position: absolute; right: 8px; width: 13px; height: 13px; pointer-events: none; color: var(--ink-3) }
.switch { width: 30px; height: 18px; border-radius: var(--r-pill); border: 0; padding: 0; background: var(--track); position: relative; flex: none; transition: background var(--t) var(--ease) }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--solid); box-shadow: var(--sh-1); transition: transform var(--t) var(--ease) }
.switch[aria-checked="true"] { background: var(--ink) }
.switch[aria-checked="true"]::after { transform: translateX(12px) }
.cfield { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; position: relative; padding: 3px 8px 3px 3px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card) }
.csw { width: 20px; height: 20px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line) inset }
.cpick { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0 }
.tinput { width: 100%; height: 32px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--card); padding: 0 10px; font-size: var(--fs) }
.tinput:focus { outline: 2px solid var(--ink); outline-offset: -1px }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { height: 26px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: none; color: var(--ink-3); font-size: var(--fs-s); transition: background var(--t-fast) ease, color var(--t-fast) ease }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-inv); border-color: var(--ink) }
.arow { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); align-items: center }
.athumb { width: 96px; height: 60px; border-radius: var(--r-s); background: var(--shade); box-shadow: 0 0 0 1px var(--line) inset; display: block }
.ameta { min-width: 0; display: grid; gap: 2px }
.aname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.adim { font-size: var(--fs-xs); color: var(--ink-3) }
.vlist { display: grid; gap: var(--s1) }
.vrow { grid-template-columns: 64px minmax(0, 1fr) auto; padding: 4px; border-radius: var(--r-s) }
.vrow .athumb { width: 64px; height: 40px }
.vrow.now { background: var(--glass) }

/* Looks: ready-made, drawn on your art */
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px }
.lk { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; padding: 3px 3px 5px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); font-size: var(--fs-xs); text-align: center; transition: background var(--t-fast) ease }
.lk:hover { background: var(--glass); color: var(--ink) }
.lk[aria-pressed="true"] { background: var(--glass-2); color: var(--ink); font-weight: 500 }
.lthumb { width: 100%; aspect-ratio: 120 / 76; display: block; border-radius: var(--r-xs); image-rendering: pixelated; background: var(--shade); box-shadow: 0 0 0 1px var(--line) inset }
.lk[aria-pressed="true"] .lthumb { box-shadow: 0 0 0 2px var(--ink) }
.costrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: center; font-size: var(--fs-xs); color: var(--ink-2) }
.costbar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden }
.costbar i { display: block; height: 100%; background: var(--ink); border-radius: 2px }
.costbar.warn i { background: var(--warn) }

/* Palette */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 5px }
.swatches.small { grid-template-columns: repeat(auto-fill, minmax(20px, 1fr)) }
.sw { aspect-ratio: 1; border-radius: var(--r-xs); border: 0; padding: 0; box-shadow: 0 0 0 1px var(--line) inset; transition: transform var(--t-fast) ease }
.sw:hover { transform: scale(1.12) }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--solid) }
.sw.white { background: linear-gradient(135deg, #fff, #dfe6ee) }

/* ---- The dock: the composer, holding the day ---- */
.dock {
  position: fixed; z-index: 12; bottom: 0; left: var(--side-l); right: var(--side-r);
  padding: 0 var(--gap) max(var(--gap), env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; pointer-events: none;
}
body.nopanels .dock { left: 0; right: 0 }
.dbox {
  pointer-events: auto; width: min(100%, calc(var(--col) + 30px));
  background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--r-l);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--sh-2);
  padding: var(--s2) var(--s3) 7px; display: grid; gap: 7px;
}
.dhead { display: flex; align-items: center; gap: var(--s2); min-width: 0 }
.dtime { font: 600 19px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; min-width: 3em }
.dname { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; min-width: 0 }
.dname span { overflow: hidden; text-overflow: ellipsis }
.dname svg.i { width: 12px; height: 12px; color: var(--ink-3) }
.dname:hover { background: var(--glass); color: var(--ink) }
.dhead .grow { flex: 1 }
.dhead .btn { height: 28px; padding: 0 11px; font-size: var(--fs-s) }
.dplay[aria-pressed="true"] { background: var(--ink); color: var(--ink-inv); border-color: var(--ink) }
.status { border: 0; background: none; height: 28px; padding: 0 8px; border-radius: var(--r-s); font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px }
.status:hover { background: var(--glass); color: var(--ink) }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; display: inline-block }
.status.ok .sdot, .okline .sdot { background: var(--ok) }
.status.warn .sdot, .probs .warn .sdot { background: var(--warn) }
.status.err .sdot, .probs .err .sdot { background: var(--err) }
.status.err { color: var(--err) }
.status.est .sdot { background: transparent; box-shadow: 0 0 0 1.5px var(--ink-3) inset }
.status.checking { color: var(--ink-3) }
.status.checking .dots i { width: 3px; height: 3px }
.dline { position: relative; height: 30px; touch-action: none }
.dsegs { position: absolute; inset: 0; border-radius: var(--r-s); overflow: hidden; box-shadow: 0 0 0 1px var(--line) inset; cursor: ew-resize; background: var(--glass) }
.dseg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 var(--s2); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; border-left: 1px solid var(--line); transition: background var(--t) ease, color var(--t) ease }
.dseg:first-child { border-left: 0 }
.dseg::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tint); opacity: 0.85 }
.dseg span { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis }
.dseg.on { background: var(--glass-2); color: var(--ink); font-weight: 500 }
.dknob { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; pointer-events: none; z-index: 3 }
.dknob::before { content: ""; position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--solid) }
.dhandle { position: absolute; top: 4px; bottom: 4px; width: 14px; margin-left: -7px; z-index: 2; cursor: col-resize; display: grid; place-items: center; border: 0; background: none; padding: 0 }
.dhandle::after { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--solid); box-shadow: 0 0 0 1px var(--line-2) }
.dhandle:hover::after, .dhandle.drag::after { background: var(--ink) }
.dtip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 3px 7px; border-radius: var(--r-xs); background: var(--hint-bg); color: var(--hint-ink); font: 500 var(--fs-xs)/1.3 var(--mono); white-space: nowrap; pointer-events: none }
.dticks { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding: 0 1px; min-height: 16px }
.addm { border: 0; background: none; color: var(--ink-2); font-size: var(--fs-xs); padding: 1px 4px; border-radius: 4px; order: 9; margin-left: var(--s2) }
.addm:hover { color: var(--ink); background: var(--glass) }

/* The checks, opened from the dock */
.checks { display: grid; gap: var(--s2); width: min(380px, calc(100vw - 32px)) }
.checks h3 { font: 600 14px/1.3 var(--display) }
.checks h4 { font: 600 var(--fs-s)/1.3 var(--text); color: var(--ink-2); margin-top: var(--s1) }
.meter { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: var(--s2); padding: 5px 6px; margin: 0 -6px; border: 0; border-radius: var(--r-s); background: none; text-align: left; font-size: var(--fs-s) }
.meter:hover { background: var(--glass) }
.mname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.mbar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden }
.mbar i { display: block; height: 100%; background: var(--ink-2); border-radius: 2px }
.meter.err .mbar i { background: var(--err) }
.meter .mono { font-size: var(--fs-xs); color: var(--ink-2) }
.layercost { margin: -4px 0 2px; font-size: var(--fs-xs); color: var(--ink-3) }
.probs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-s) }
.probs li { display: grid; grid-template-columns: 10px 1fr auto; gap: var(--s2); align-items: baseline }
.okline { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: var(--fs-s); color: var(--ink-2) }

/* ---- Popovers and menus ---- */
.pop {
  position: fixed; z-index: 50; min-width: 200px; max-width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto;
  background: var(--solid); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-pop); padding: 5px;
  animation: pop var(--t-fast) var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(3px) } }
.pop.pad { padding: var(--s3) 14px 14px }
.pop.wide { max-width: min(560px, calc(100vw - 16px)) }
.menu { display: grid; gap: 1px }
.mi { display: flex; align-items: center; gap: 10px; justify-content: space-between; width: 100%; text-align: left; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: none; font-size: var(--fs); white-space: nowrap }
.mi:hover:not(:disabled), .mi:focus-visible { background: var(--ink); color: var(--ink-inv); outline: 0 }
.mi:hover:not(:disabled) kbd { color: var(--ink-inv); border-color: transparent }
.mi:disabled { opacity: 0.4; cursor: default }
.mi .lab { display: inline-flex; align-items: center; gap: 9px }
.mi .lab svg.i { width: 15px; height: 15px }
.mi .ck { width: 12px; flex: none; text-align: center }
.msep { height: 1px; background: var(--line); margin: 4px 6px }
.mhead { padding: 6px 10px 4px; font-size: var(--fs-xs); color: var(--ink-3) }
.pop h3 { margin: 0 0 4px; font: 600 14px/1.3 var(--display) }
.pop p { margin: 0 0 10px; color: var(--ink-2); font-size: var(--fs); line-height: 1.45 }
.pop .row { display: flex; gap: var(--s2); align-items: center; justify-content: flex-end; margin-top: var(--s3) }
.pop .stack { display: grid; gap: 10px; min-width: 260px }
.tlabel { display: grid; gap: 5px; font-size: var(--fs-s); color: var(--ink-2) }
.tlabel .note { font-size: var(--fs-xs); color: var(--ink-3) }
.err-text { color: var(--err); font-size: var(--fs-s) }
.keys { display: grid; gap: var(--s3) }
.pop.keys-pop { width: min(880px, calc(100vw - 16px)); max-width: none; padding: var(--s4) var(--s5) var(--s5) }
.kgrid { columns: 3 230px; column-gap: var(--s6) }
.kgrid section { break-inside: avoid; padding-bottom: var(--s4) }
.kgrid h4 { font: 600 var(--fs-s)/1 var(--text); color: var(--ink-2); margin: 0 0 var(--s2) }
.kgrid dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s3); margin: 0; align-items: baseline }
.kgrid dt { text-align: right }
.kgrid dd { margin: 0; font-size: var(--fs-s); color: var(--ink) }

/* ---- Search ---- */
.search { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-content: start; padding-top: calc(var(--head) + 48px); background: rgba(0, 0, 0, 0.12) }
.sbox { width: min(580px, calc(100vw - 24px)); background: var(--solid); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-pop); overflow: hidden; animation: pop var(--t-fast) var(--ease) both }
.shead { display: flex; align-items: center; gap: 10px; padding: 0 var(--s3) 0 var(--s4); height: 50px; border-bottom: 1px solid var(--line); color: var(--ink-3) }
.sinput { flex: 1; height: 100%; border: 0; background: none; font-size: 15px; color: var(--ink); outline: 0 }
.sinput::-webkit-search-cancel-button { display: none }
.sresults { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60vh); overflow: auto }
.sr { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s3); align-items: center; height: 36px; padding: 0 10px; border-radius: var(--r-s); cursor: pointer }
.sr[aria-selected="true"] { background: var(--glass-2) }
.sl { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

.sr .swh { white-space: nowrap; font-size: var(--fs-s); color: var(--ink-3) }
.snone { padding: var(--s3); color: var(--ink-3) }

/* ---- The chat column ---- */
.chatcol { position: fixed; z-index: 5; top: var(--head); bottom: 0; left: var(--side-l); right: var(--side-r); pointer-events: none }
body.nopanels .chatcol, body.playing .chatcol, body.starting .chatcol { left: 0; right: 0 }
.chatcol .band {
  position: absolute; top: 0; bottom: 0; left: 50%; width: min(920px, 100%); transform: translateX(-50%);
  background: var(--haze); -webkit-backdrop-filter: var(--blur-band); backdrop-filter: var(--blur-band);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.chat {
  position: absolute; inset: 0; overflow-y: auto; pointer-events: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  padding: 28px max(var(--s4), env(safe-area-inset-right, 0px)) calc(var(--dock-h) + 30px) max(var(--s4), env(safe-area-inset-left, 0px));
  display: grid; align-content: start; gap: 22px; font-size: 15px; user-select: text; -webkit-user-select: text;
}
body.starting .chat { padding-bottom: 40px }
.chat > * { width: 100%; max-width: var(--col); margin: 0 auto; min-width: 0 }
.msg { min-width: 0 }
.msg p { margin: 0 0 var(--s3) }
.msg p:last-child { margin-bottom: 0 }
.user { display: flex; justify-content: flex-end }
.user > div { max-width: 86%; padding: var(--s3) var(--s4); border-radius: 11px; background: var(--bubble); border: 1px solid var(--line); box-shadow: var(--sh-1) }
.who { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: var(--fs); font-weight: 600 }
.who .mark { width: 15px; height: 15px }
.fine { font-size: var(--fs-s); color: var(--ink-2); text-align: center; margin: 4px auto 0 }
.glink { text-align: left; margin: var(--s3) 0 0 -10px }
.glink a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-size: var(--fs) }
.glink a:hover { color: var(--ink); background: var(--glass) }
.answers { display: grid; gap: var(--s2); margin-top: 14px }
.answer {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: var(--s3); text-align: left; width: 100%;
  padding: var(--s3) 14px var(--s3) var(--s3); border-radius: 12px; background: var(--bubble); border: 1px solid var(--line);
  box-shadow: var(--sh-1); transition: transform var(--t) var(--ease), box-shadow var(--t) ease;
}
.answer:hover { transform: translateY(-1px); box-shadow: var(--sh-2) }
.answer .ai { width: 32px; height: 32px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--glass-2); color: var(--ink) }
.answer b { display: block; font-weight: 600; font-size: 14.5px }
.answer span.d { display: block; font-size: var(--fs); color: var(--ink-2); margin-top: 1px }
.answer .go { color: var(--ink-3) }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); margin-top: 14px }
.thumbs.three { grid-template-columns: repeat(3, 1fr) }
.tcard { display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; align-content: start }
.tcard .pic { aspect-ratio: 16 / 10; border-radius: var(--r-m); overflow: hidden; background: var(--shade); box-shadow: var(--sh-1); transition: transform var(--t) var(--ease), box-shadow var(--t) ease; display: block }
.tcard img, .tcard canvas { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated }
.tcard:hover .pic { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--ink) }
.tcard b { font-size: var(--fs); font-weight: 600; padding-left: 2px }
.tcard span.d { font-size: var(--fs-s); color: var(--ink-2); padding-left: 2px; line-height: 1.35 }
/* Several pictures of one scene: each with the moment it shows at. */
.vers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: var(--s3); margin: 14px 0 var(--s2) }
.ver { display: grid; gap: 6px; min-width: 0; align-content: start }
.ver .pic { aspect-ratio: 16 / 10; border-radius: var(--r-m); overflow: hidden; background: var(--shade); box-shadow: var(--sh-1); display: block }
.ver canvas { width: 100%; height: 100%; display: block; object-fit: contain }
.vname { font-size: var(--fs-s); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px }
.vchip { justify-self: start; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); border-color: var(--line-2); padding: 0 8px 0 10px }
.vchip:hover { background: var(--glass-2) }
.hours { font-size: var(--fs-s); color: var(--ink-2); margin: 0 0 4px }
.cardbox { margin-top: var(--s3); padding: 14px var(--s4); border-radius: 12px; background: var(--bubble); border: 1px solid var(--line); box-shadow: var(--sh-2); display: grid; gap: var(--s3); font-size: 13.5px }
.cardbox .row, .msg .row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s3) }
.msg .row + p { margin-top: var(--s4) }
.cardbox .row { margin-top: 0 }
.cardbox .row.end { justify-content: flex-end }
.dots { display: inline-flex; gap: 3px }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-2); animation: dot 1.4s ease-in-out infinite }
.dots i:nth-child(2) { animation-delay: 0.2s }
.dots i:nth-child(3) { animation-delay: 0.4s }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25 } 40% { opacity: 1 } }
.msg .tool { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 14px; margin: 2px 0 var(--s2) }
.msg .tool svg.i { width: 14px; height: 14px }
.code { margin: 10px 0 var(--s3); border-radius: var(--r-m); background: var(--bubble); border: 1px solid var(--line); padding: var(--s3) 14px; font: 12.5px/1.6 var(--mono); white-space: pre; overflow: auto }
.tasks { margin: var(--s3) 0 0; padding: var(--s3) 14px; border-radius: 11px; background: var(--glass); border: 1px solid var(--glass-line); display: grid; gap: 2px; list-style: none }
.tasks li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 4px 0 }
.tasks .dot { width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; display: grid; place-items: center }
.tasks .todo { border: 1.5px dashed var(--ink-3) }
.tasks .done { background: var(--ink); color: var(--ink-inv) }
.tasks .done svg.i { width: 10px; height: 10px; stroke-width: 2.4 }
.prompt { margin-top: var(--s3); border-radius: 11px; background: var(--bubble); border: 1px solid var(--line); overflow: hidden }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px var(--s2) 7px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2) }
.prompt pre { margin: 0; padding: var(--s3) 14px; max-height: 260px; overflow: auto; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: break-word; user-select: text }
.prompt pre span { display: block }
.prompt pre .hang { padding-left: 3ch; text-indent: -3ch }
.prompt .btn { height: 26px; padding: 0 10px; font-size: 12.5px }

/* ---- Hints, toasts, busy, drop, play ---- */
.hint {
  position: fixed; z-index: 90; pointer-events: none; padding: 5px var(--s2); border-radius: var(--r-s); max-width: 300px;
  background: var(--hint-bg); color: var(--hint-ink); font-size: var(--fs-s); line-height: 1.35; box-shadow: var(--sh-2);
  display: flex; align-items: center; gap: var(--s2); animation: pop var(--t-fast) var(--ease) both;
}
.hint kbd { color: inherit; border-color: rgba(127, 127, 127, 0.45) }
.toast {
  position: fixed; z-index: 85; bottom: calc(var(--dock-h) + 22px); left: 50%; transform: translateX(-50%);
  max-width: min(600px, calc(100vw - 24px)); padding: var(--s2) 10px var(--s2) 14px; border-radius: var(--r-m); display: flex; align-items: center; gap: var(--s3);
  background: var(--solid); border: 1px solid var(--line); box-shadow: var(--sh-pop); font-size: var(--fs); line-height: 1.4; animation: pop var(--t) var(--ease) both;
}
body.starting .toast, body.playing .toast { bottom: 28px }
.toast .btn { height: 26px; padding: 0 10px; font-size: var(--fs-s); flex: none }
.toast.err { box-shadow: var(--sh-pop), inset 3px 0 0 var(--err) }
.busy {
  position: fixed; z-index: 86; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: var(--s3) var(--s4); border-radius: 12px; background: var(--solid); border: 1px solid var(--line); box-shadow: var(--sh-pop);
  display: flex; align-items: center; gap: var(--s3); color: var(--ink-2); font-size: 13.5px;
}
.dropnote { position: fixed; inset: var(--gap); z-index: 95; display: grid; place-items: center; border: 2px dashed var(--ink-2); border-radius: var(--r-l); background: var(--haze); -webkit-backdrop-filter: var(--blur-band); backdrop-filter: var(--blur-band); pointer-events: none }
.dropnote div { display: grid; justify-items: center; gap: 6px; padding: var(--s5) var(--s6); border-radius: var(--r-l); background: var(--solid); box-shadow: var(--sh-pop); text-align: center }
.dropnote b { font: 600 15px/1.3 var(--display) }
.dropnote span { color: var(--ink-2); font-size: var(--fs-s) }
.dropnote svg.i { width: 22px; height: 22px }
.playbar {
  position: fixed; z-index: 21; bottom: max(18px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center; padding: 6px 6px 6px 8px; border-radius: var(--r-l);
  background: var(--panel); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--sh-2);
  font-size: var(--fs-s); color: var(--ink-2); transition: opacity 0.6s ease, transform 0.6s var(--ease); max-width: calc(100vw - 24px);
}
.playbar .ptext { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.playbar .ptext.warn { color: var(--err) }
body.playing .top { transition: opacity 0.6s ease }
body.playing.rest .top, body.playing.rest .playbar { opacity: 0 }
body.playing.rest .playbar { transform: translate(-50%, 8px) }
body.playing.rest { cursor: none }

/* ---- Narrow screens: the panels become sheets ---- */
@media (max-width: 860px) {
  :root { --side-l: 0px; --side-r: 0px; --dock-h: 104px }
  .mb-now, .mb-clock { display: none }
  .tb-btn.wide span { display: none }
  .tb-btn.wide { padding: 0 7px }
  .panel {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; height: min(64vh, 580px); border-radius: var(--r-l) var(--r-l) 0 0; z-index: 25;
    transform: translateY(105%); transition: transform var(--t) var(--ease); display: flex !important; visibility: hidden;
  }
  .side-l, .side-r { width: auto; left: 0; right: 0 }
  body.sheet-l .side-l, body.sheet-r .side-r { transform: none; visibility: visible }
  /* With a sheet up, notes show at the top instead of over it. */
  body.sheet-l .toast, body.sheet-r .toast { bottom: auto; top: calc(var(--head) + 10px) }
  body.starting .panel, body.playing .panel { display: none !important }
  .dock { left: 0; right: 0; padding: 0 6px max(6px, env(safe-area-inset-bottom, 0px)) }
  .dtime { font-size: 16px; min-width: 2.8em }
  .dbox { padding: 7px var(--s2) 6px }
  .dplay span, .dexport span { display: none }
  .dhead .btn { padding: 0 8px }
  .thumbs { grid-template-columns: repeat(2, 1fr) }
  .thumbs.three { grid-template-columns: repeat(3, 1fr) }
  .chat { font-size: 14.5px }
}
@media (max-width: 480px) {
  .dname { display: none }
  .status { padding: 0 4px }
  .menubar .mb-item { padding: 0 6px }
  .titlebar { gap: var(--s1) }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}
