/* ==========================================================================
   CINEMA LAB · design system
   Matte obsidian body, soft 3D keys and wells (no gloss, no glass), a vintage
   camera feel: leatherette texture, knurled dials, LCD readouts, film strip.

   Palette (kept deliberately small)
     obsidian  #0B0B0C  surfaces #111113 / #161618 / #1C1C1F
     bone      #ECE7DD  text      muted #A8A398   dim #716E67
     brass     #C79A55  the single accent (LED, fills, primary key)
     red       #C4594C  destructive / error only
   Type   Space Grotesk (interface) · IBM Plex Mono (readouts)
   Icons  Feather (assets/icons/sprite.svg)
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0b0c;
  --s: #111113;
  --s2: #161618;
  --s3: #1c1c1f;
  --ink: #f4f0e8;
  --mu: #cbc6ba;
  --dim: #a09c91;
  --ac: #c79a55;
  --ac-hi: #ddb372;
  --ac-soft: rgba(199, 154, 85, 0.14);
  --on: #120e08;
  --red: #c4594c;
  --line: rgba(236, 231, 221, 0.07);
  --line2: rgba(236, 231, 221, 0.2);

  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r1: 4px;
  --r2: 8px;
  --r3: 12px;
  --r4: 16px;

  --bev: inset 0 1px 0 rgba(236, 231, 221, 0.045);
  --sh: 0 1px 2px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.36), 0 12px 22px rgba(0, 0, 0, 0.28);
  --sh2: 0 2px 3px rgba(0, 0, 0, 0.55), 0 8px 14px rgba(0, 0, 0, 0.4), 0 20px 34px rgba(0, 0, 0, 0.4);
  --up: var(--bev), var(--sh);
  --up2: var(--bev), var(--sh2);
  --key: var(--bev), 0 1px 1px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.4);
  --hole: inset 0 3px 7px rgba(0, 0, 0, 0.85), inset 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(236, 231, 221, 0.045);
  --press: inset 0 2px 5px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.45);

  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --nav-h: 92px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- reset + base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 154, 85, 0.35) transparent;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

img {
  -webkit-user-drag: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--ac);
  color: var(--on);
}

:focus-visible {
  outline: 1px solid var(--ac);
  outline-offset: 2px;
  border-radius: var(--r2);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(199, 154, 85, 0.32);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(221, 179, 114, 0.55);
  background-clip: content-box;
}

::-webkit-scrollbar-button {
  display: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--r2);
  background: var(--ac);
  color: var(--on);
  font-weight: 700;
}

.skip:focus {
  top: 8px;
}

.nojs {
  position: relative;
  z-index: 9500;
  padding: 24px;
  font: 15px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
}

/* ---------- icons ---------- */
.i {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.i svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- camera-body texture: film grain + leatherette ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .9 0 0 0 0 .86 0 0 0 .55 -.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 50%, rgba(236, 231, 221, 0.05) 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.35) 0 1.3px, transparent 1.9px);
  background-size:
    220px 220px,
    7px 7px,
    7px 7px;
  background-position:
    0 0,
    0 0,
    3.5px 3.5px;
  opacity: 0.38;
}

/* ---------- loader skeleton + page enter ---------- */
html:not(.ready) .app {
  visibility: hidden;
}

html.ready .app {
  animation: appIn 0.5s ease both;
}

@keyframes appIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

#sk {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(var(--st) + 18px) 20px 20px;
  background: var(--bg);
  transition:
    opacity 0.45s ease,
    visibility 0.45s;
}

html.ready #sk {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sk-b {
  border-radius: var(--r3);
  background: linear-gradient(90deg, #111113 25%, #19191c 50%, #111113 75%) 0 0/220% 100%;
  box-shadow: var(--up);
  animation: shim 1.6s linear infinite;
}

@keyframes shim {
  to {
    background-position: -220% 0;
  }
}

.sk-top,
.sk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sk-top {
  height: 50px;
}

.sk-t {
  width: 150px;
  height: 26px;
  margin-right: auto;
}

.sk-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r2);
}

.sk-btn.w {
  width: 150px;
}

.sk-bar {
  height: 44px;
}

.sk-bar .sk-b {
  width: 44px;
  height: 44px;
  border-radius: var(--r2);
}

.sk-bar .sk-save {
  width: 96px;
  margin-left: auto;
}

.sk-main {
  display: flex;
  flex: 1;
  gap: 14px;
  min-height: 0;
}

.sk-stage {
  flex: 1;
}

.sk-panel {
  display: none;
  width: 360px;
}

.sk-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  font: 500 0.95rem var(--font);
  color: var(--ink);
  background: rgba(11, 11, 12, 0.86);
}

@media (min-width: 900px) {
  .sk-panel {
    display: block;
  }
}

@media (max-width: 899px) {
  .sk-main {
    flex-direction: column;
  }

  .sk-panel {
    display: block;
    width: auto;
    height: 170px;
  }

  .sk-bar .sk-b:nth-child(3) {
    display: none;
  }
}

/* ---------- shell ---------- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 0 var(--sr) 0 var(--sl);
}

/* ---------- top bar ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(var(--st) + 16px) 22px 10px;
}

.brand {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* knurled camera dial */
.logo {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--s2);
  box-shadow: var(--up);
  color: var(--ac);
}

.logo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(236, 231, 221, 0.11) 0 2.5deg, transparent 2.5deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 0 61%, #000 62%);
  mask: radial-gradient(circle, transparent 0 61%, #000 62%);
}

.logo::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--hole);
}

.logo .i {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
}

.logo-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ttl-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand h1 {
  overflow: hidden;
  font: 600 0.98rem/1.1 var(--font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-credit {
  margin: 0;
  font: 400 0.72rem/1.2 var(--mono);
  color: var(--dim);
  white-space: nowrap;
}

.top-credit a {
  color: var(--mu);
  font-weight: 500;
}

.top-credit a:hover {
  color: var(--ac);
}

.info {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--dim);
}

.info:hover,
.info:focus-visible {
  color: var(--ac);
}

.info .i {
  width: 16px;
  height: 16px;
}

.tb-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.tb-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  font: 500 0.85rem var(--font);
  white-space: nowrap;
  transition:
    color 0.2s,
    transform 0.15s,
    box-shadow 0.15s;
}

.tb-link:hover {
  color: var(--ink);
}

.tb-link:active {
  transform: translateY(1px);
  box-shadow: var(--press);
}

.tb-link.gh {
  width: 44px;
  padding: 0;
}

.tb-link.coffee {
  color: var(--ac);
  font-weight: 600;
}

.tb-link.coffee:hover {
  color: var(--ac-hi);
}

/* ---------- toolbar ---------- */
.toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.sp {
  flex: 1 1 0;
  min-width: 4px;
}

/* LCD readout */
.meta {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r1);
  background: #070708;
  box-shadow: var(--hole);
  color: var(--ac);
  font: 400 0.76rem var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.meta:empty {
  display: none;
}

.hb {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  font: 500 0.84rem var(--font);
  transition:
    color 0.2s,
    transform 0.15s,
    box-shadow 0.15s;
}

.hb:hover:not(:disabled) {
  color: var(--ink);
}

.hb:active:not(:disabled),
.hb.on {
  transform: translateY(1px);
  box-shadow: var(--press);
}

.hb.on {
  color: var(--ac);
}

.hb:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.hb.lbl span:not(.i) {
  display: none;
}

#bDel:hover:not(:disabled) {
  color: var(--red);
}

.hb.save {
  width: auto;
  padding: 0 20px;
  background: var(--ac);
  color: var(--on);
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 3px 6px rgba(0, 0, 0, 0.4);
}

.hb.save:hover:not(:disabled) {
  background: var(--ac-hi);
  color: var(--on);
}

.hb.save:active:not(:disabled) {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35);
}

.svw {
  display: inline-flex;
  flex: none;
}

.zoombar,
.urbar {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.zoombar .hb.zl {
  min-width: 58px;
  padding: 0 10px;
  color: var(--ac);
  font: 400 0.76rem var(--mono);
  letter-spacing: 0.03em;
}

/* ---------- workspace ---------- */
.layout {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding-bottom: calc(var(--nav-h) + var(--sb));
}

.center {
  order: 1;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.vp {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 10px 22px 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.vp.fit {
  overflow: hidden;
}

/* viewfinder: matte bezel, dark checker, corner marks */
.stage {
  position: relative;
  flex: none;
  margin: auto;
  overflow: hidden;
  touch-action: none;
  border-radius: 3px;
  background-color: #0f0f11;
  background-image:
    linear-gradient(45deg, #151518 25%, transparent 25%),
    linear-gradient(-45deg, #151518 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #151518 75%),
    linear-gradient(-45deg, transparent 75%, #151518 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 0 0 8px #0e0e10,
    0 0 0 9px var(--line2),
    0 22px 46px rgba(0, 0, 0, 0.6);
}

.stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.4;
  --m: linear-gradient(var(--ink), var(--ink));
  background:
    var(--m) left top / 14px 1px no-repeat,
    var(--m) left top / 1px 14px no-repeat,
    var(--m) right top / 14px 1px no-repeat,
    var(--m) right top / 1px 14px no-repeat,
    var(--m) left bottom / 14px 1px no-repeat,
    var(--m) left bottom / 1px 14px no-repeat,
    var(--m) right bottom / 14px 1px no-repeat,
    var(--m) right bottom / 1px 14px no-repeat;
}

.welcome {
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.drop {
  display: block;
  width: 100%;
  padding: 40px 26px;
  border-radius: var(--r4);
  background: var(--s);
  box-shadow: var(--up2);
  color: var(--ink);
  text-align: center;
  outline: 1px dashed var(--line2);
  outline-offset: -10px;
  transition:
    outline-color 0.25s,
    transform 0.2s;
}

.drop:hover,
.drop.over {
  outline-color: var(--ac);
}

.drop:active {
  transform: translateY(1px);
}

.drop-ic {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--hole);
  color: var(--ac);
}

.drop-ic .i {
  width: 26px;
  height: 26px;
}

.drop .t {
  display: block;
  font: 600 1.2rem/1.25 var(--font);
  letter-spacing: -0.01em;
}

.drop .s {
  display: block;
  margin-top: 8px;
  font: 400 0.82rem var(--mono);
  letter-spacing: 0.03em;
  color: var(--dim);
}

.credit-m {
  display: none;
  margin-top: 18px;
  text-align: center;
  font: 400 0.76rem var(--mono);
  color: var(--dim);
}

.credit-m a {
  color: var(--mu);
  font-weight: 500;
}

/* ---------- tool dock ---------- */
.nav {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(16px + var(--sb));
  display: flex;
  gap: 6px;
  width: min(640px, calc(100% - 24px));
  padding: 8px;
  transform: translateX(-50%);
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up2);
}

.tool {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 54px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  transition:
    color 0.2s,
    transform 0.15s,
    box-shadow 0.15s;
}

.tool .i {
  width: 22px;
  height: 22px;
}

.tool .lbl {
  display: none;
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool:hover:not(.on) {
  color: var(--ink);
}

.tool:active {
  transform: translateY(1px);
}

/* pressed in, with a brass LED */
.tool.on {
  background: var(--bg);
  box-shadow: var(--press);
  color: var(--ac);
}

.tool.on::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--ac);
}

/* video-only tools appear once a video is open */
.tool[data-vo] {
  display: none;
}

body.isvid .tool[data-vo] {
  display: flex;
}

body.isvid .tool[data-t="retouch"] {
  opacity: 0.4;
}

/* ---------- properties panel ---------- */
.props {
  order: 2;
  position: relative;
  display: none;
  flex: none;
  flex-direction: column;
  min-height: 0;
}

.props.open {
  display: flex;
}

.phead {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 14px 6px;
}

.phead > .i {
  color: var(--ac);
}

.phead .ttl {
  font: 500 0.74rem/1.2 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mu);
}

.pclose {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
}

.pclose:hover {
  color: var(--ink);
}

.pclose:active {
  box-shadow: var(--press);
}

.pclose .i {
  width: 16px;
  height: 16px;
}

.pbody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pempty {
  padding: 48px 28px;
  color: var(--mu);
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: center;
}

.pempty .i {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  color: var(--dim);
}

/* plates */
.sec {
  margin-bottom: 14px;
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up);
  overflow: hidden;
}

.sec > .sh {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.sec > .sh:hover {
  color: var(--ac);
}

.sec > .sh .caret {
  display: inline-flex;
  order: 3;
  margin-left: auto;
  color: var(--dim);
  transition: transform 0.25s var(--ease);
}

.sec > .sh .caret .i {
  width: 16px;
  height: 16px;
}

.sec > .sh .sp {
  display: none;
}

.sec > .sh .val {
  padding: 2px 8px;
  border-radius: var(--r1);
  background: var(--bg);
  box-shadow: var(--hole);
  color: var(--ac);
  font: 500 0.72rem var(--mono);
  letter-spacing: 0;
}

.sec.closed > .sh .caret {
  transform: rotate(-90deg);
}

.sec.closed > .sb {
  display: none;
}

.sb {
  display: flex;
  flex-direction: column;
  row-gap: 18px;
  padding: 4px 20px 22px;
}

.sb.fsb {
  padding-top: 18px;
}

.stick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 4px;
}

.hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--dim);
}

/* ---------- sliders: groove, ticks, brass-marked knob ---------- */
.srow {
  min-width: 0;
}

.sh2 {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.sh2 label {
  font: 500 0.86rem var(--font);
  color: var(--mu);
}

.sh2 .val {
  margin-left: auto;
  font: 400 0.8rem var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.srow.dirty .sh2 .val {
  margin-right: 28px;
  color: var(--ac);
}

.sh2 .rst {
  position: absolute;
  right: -6px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--dim);
  transform: translateY(-50%);
  visibility: hidden;
}

.srow.dirty .sh2 .rst {
  visibility: visible;
}

.sh2 .rst:hover {
  color: var(--ink);
}

.sh2 .rst .i {
  width: 13px;
  height: 13px;
}

input[type="range"] {
  --p: 50%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 30px;
  background:
    repeating-linear-gradient(90deg, rgba(236, 231, 221, 0.16) 0 1px, transparent 1px 10%) 0 100% / 100% 5px no-repeat,
    transparent;
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--ac) 0, var(--ac) var(--p), #050506 var(--p), #050506 100%);
  box-shadow: var(--hole);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #050506;
  box-shadow: var(--hole);
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--ac);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ac) 0 2px, #26262a 2.5px);
  box-shadow: var(--key);
}

input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ac) 0 2px, #26262a 2.5px);
  box-shadow: var(--key);
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb {
  background: radial-gradient(circle, var(--ac-hi) 0 2.5px, #2b2b30 3px);
}

/* ---------- segmented control, keys, chips ---------- */
.seg {
  display: flex;
  flex: 1;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r2);
  background: var(--bg);
  box-shadow: var(--hole);
}

.seg button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: var(--r1);
  color: var(--mu);
  font: 500 0.84rem var(--font);
  transition:
    color 0.2s,
    background 0.2s;
}

.seg button:hover {
  color: var(--ink);
}

.seg button.on {
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--ac);
}

.seg .i {
  width: 17px;
  height: 17px;
}

.pbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--ink);
  font: 500 0.88rem var(--font);
  transition:
    color 0.2s,
    transform 0.15s,
    box-shadow 0.15s;
}

.pbtn:hover {
  color: var(--ac-hi);
}

.pbtn:active {
  transform: translateY(1px);
  box-shadow: var(--press);
}

.pbtn.primary {
  background: var(--ac);
  color: var(--on);
  font-weight: 700;
}

.pbtn.primary:hover {
  background: var(--ac-hi);
  color: var(--on);
}

.pbtn .i {
  width: 18px;
  height: 18px;
}

.prow {
  display: flex;
  gap: 12px;
}

.prow.acts {
  flex-direction: column;
  margin-top: 6px;
}

.grid2,
.grid3 {
  display: grid;
  gap: 12px;
}

.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pbtn.tile {
  flex-direction: column;
  gap: 8px;
  min-height: 76px;
  padding: 0 6px;
  font-size: 0.76rem;
  line-height: 1.15;
  text-align: center;
}

.pbtn.tile .i {
  width: 24px;
  height: 24px;
}

.docinfo {
  font: 400 0.84rem/1.7 var(--mono);
  color: var(--mu);
}

/* ---------- filters ---------- */
.gfilt {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gitem {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 5px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  font: 400 0.72rem var(--mono);
  text-align: center;
  transition:
    color 0.2s,
    box-shadow 0.15s;
}

.gitem:hover {
  color: var(--ink);
}

.gitem .thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r1);
  background: #0f0f11;
  pointer-events: none;
}

.gitem .nm {
  padding: 8px 2px 4px;
  overflow: hidden;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gitem.on {
  background: var(--bg);
  box-shadow:
    var(--press),
    0 0 0 1px var(--ac);
  color: var(--ac);
}

.gitem.sq {
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  font: 500 0.84rem var(--font);
}

.gitem.fx {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.fstrip {
  display: flex;
  gap: 12px;
  padding: 14px 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fstrip::-webkit-scrollbar {
  display: none;
}

.fstrip .gitem {
  flex: none;
  width: 74px;
}

.fstrip .gitem .nm {
  padding: 6px 0 2px;
  font-size: 0.66rem;
}

.fstrip .fhead {
  display: grid;
  flex: none;
  place-items: center;
  align-self: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
}

.fstrip .fhead.on {
  background: var(--bg);
  box-shadow:
    var(--press),
    0 0 0 1px var(--ac);
  color: var(--ac);
}

.fint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 20px 16px;
}

.fint .lbl {
  font: 500 0.74rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mu);
  white-space: nowrap;
}

.fint .srow {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fint input[type="range"] {
  flex: 1;
}

.fint .val {
  min-width: 34px;
  font: 400 0.78rem var(--mono);
  color: var(--ink);
  text-align: right;
}

.fint .srow.dirty .val {
  color: var(--ac);
}

.chips {
  display: flex;
  gap: 10px;
  padding: 14px 20px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  font: 500 0.82rem var(--font);
  white-space: nowrap;
}

.chip:hover {
  color: var(--ink);
}

.chip.on {
  background: var(--bg);
  box-shadow: var(--press);
  color: var(--ac);
}

.gdot {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r1);
  background: var(--ac-soft);
  color: var(--ac-hi);
  font: 500 0.68rem var(--mono);
}

.stabs {
  display: flex;
  gap: 26px;
  padding: 8px 20px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.stabs::-webkit-scrollbar {
  display: none;
}

.stab {
  position: relative;
  flex: none;
  margin-bottom: -1px;
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  color: var(--mu);
  font: 500 0.84rem var(--font);
}

.stab.on {
  border-bottom-color: var(--ac);
  color: var(--ink);
}

.stab.dirty:not(.on)::after {
  content: "";
  position: absolute;
  top: 9px;
  right: -7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ac);
}

.swatches {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 16px 20px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.swatches::-webkit-scrollbar {
  display: none;
}

.sw {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 50%;
}

.sw i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--sw);
  opacity: 0.85;
}

.sw.on {
  border-color: var(--ink);
}

.sw.dirty::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--s);
  border-radius: 50%;
  background: var(--ink);
}

.mixname {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- video: panels ---------- */
.vpan {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 8px 20px 22px;
}

.vgrp {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vsub {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.vrow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vrow.off {
  opacity: 0.4;
}

.vrow label {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 500 0.86rem var(--font);
  color: var(--mu);
}

.vrow label .i {
  width: 17px;
  height: 17px;
  color: var(--dim);
}

.vrow label span {
  flex: 1;
}

.vrow label b {
  font: 400 0.8rem var(--mono);
  color: var(--ink);
}

.vrule {
  position: relative;
  height: 32px;
  margin: 0 10px;
}

.vrule i {
  position: absolute;
  top: 0;
  width: 1px;
  height: 7px;
  background: var(--line2);
}

.vrule em {
  position: absolute;
  top: 12px;
  transform: translateX(-50%);
  font: 400 0.74rem var(--mono);
  font-style: normal;
  color: var(--mu);
  cursor: pointer;
}

.vrule em.on {
  color: var(--ac);
}

.vhr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vmini {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--mu);
  font: 500 0.78rem var(--font);
}

.vmini:hover {
  color: var(--ac-hi);
}

.vmini:active {
  box-shadow: var(--press);
}

.vmini .i {
  width: 16px;
  height: 16px;
}

.vmrow {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.vcard {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r2);
  background: var(--bg);
  box-shadow: var(--hole);
}

.vcard .ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r1);
  background: var(--s2);
  box-shadow: var(--key);
  color: var(--ac);
}

.vcard .tx {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vcard .tx b {
  overflow: hidden;
  font: 500 0.84rem var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vcard .tx span {
  font: 400 0.74rem var(--mono);
  color: var(--dim);
}

.vmb {
  flex: none;
  width: 44px;
  padding: 0;
}

.vvols {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vfx {
  padding: 0 20px 16px;
}

/* ---------- video: film-strip timeline ---------- */
.vtl {
  flex: none;
  padding: 0 22px 12px;
}

.vtb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}

#vTime {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r1);
  background: #070708;
  box-shadow: var(--hole);
  color: var(--ac);
  font: 400 0.76rem var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.vtb .hb {
  height: 38px;
}

.vscroll {
  overflow-x: auto;
  border-radius: var(--r2);
  background: #060607;
  box-shadow: var(--hole);
}

.vinner {
  position: relative;
  min-width: 100%;
  padding-bottom: 12px;
}

.vruler {
  position: relative;
  height: 24px;
}

.vruler span {
  position: absolute;
  top: 8px;
  height: 11px;
  padding-left: 5px;
  border-left: 1px solid var(--line2);
  font: 400 0.68rem/11px var(--mono);
  color: var(--dim);
  pointer-events: none;
}

.vruler {
  cursor: col-resize;
}

.vtrack {
  position: relative;
  display: flex;
  height: 58px;
  margin-left: 12px;
}

.vclip {
  position: relative;
  flex: none;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 3px;
  background-color: #19191c;
  background-repeat: repeat-x;
  background-size: auto 100%;
  cursor: grab;
  touch-action: none;
}

/* sprocket holes along both edges */
.vclip::before,
.vclip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 8px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(236, 231, 221, 0.28) 4px 8px, transparent 8px 12px) 0 50% / 100% 3px no-repeat,
    rgba(6, 6, 7, 0.82);
}

.vclip::before {
  top: 0;
}

.vclip::after {
  bottom: 0;
}

.vclip.sel {
  border-color: var(--ac);
}

.vclip.drag {
  z-index: 3;
  opacity: 0.88;
  cursor: grabbing;
  box-shadow: var(--sh2);
}

.vh {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 12px;
  background: var(--ac);
  cursor: ew-resize;
}

.vh.l {
  left: 0;
}

.vh.r {
  right: 0;
}

.vh::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: var(--on);
  transform: translate(-50%, -50%);
}

.vcl {
  position: absolute;
  left: 14px;
  bottom: 11px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: var(--r1);
  background: rgba(6, 6, 7, 0.78);
  font: 400 0.66rem var(--mono);
  color: var(--ink);
  pointer-events: none;
}

.vmus {
  margin: 8px 0 0 12px;
}

.vmus:empty {
  display: none;
}

.vmbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid rgba(199, 154, 85, 0.35);
  border-radius: 3px;
  background: var(--ac-soft);
  font: 400 0.74rem var(--mono);
  color: var(--ink);
  white-space: nowrap;
}

.vmbar .i {
  width: 15px;
  height: 15px;
  color: var(--ac);
}

.vmbar span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vx {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--mu);
}

.vx:hover {
  color: var(--ink);
}

.vx .i {
  width: 12px;
  height: 12px;
}

.vhead {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 2px;
  margin-left: -1px;
  background: var(--ac);
  pointer-events: none;
}

.vhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 11px;
  height: 9px;
  background: var(--ac);
  transform: translateX(-50%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.vind {
  position: absolute;
  top: 24px;
  z-index: 4;
  width: 2px;
  height: 58px;
  background: var(--ac-hi);
  pointer-events: none;
}

.vprog {
  position: fixed;
  z-index: 7000;
  top: 50%;
  left: 50%;
  padding: 14px 22px;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--up2);
  color: var(--ac);
  font: 500 0.84rem var(--mono);
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---------- toasts, tooltip, storage notice ---------- */
.nt-host {
  position: fixed;
  z-index: 7000;
  top: calc(var(--st) + 84px);
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.nt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 15px 16px;
  overflow: hidden;
  border-radius: var(--r2);
  background: var(--s2);
  box-shadow: var(--up2);
  color: var(--ink);
  font: 500 0.88rem/1.4 var(--font);
  pointer-events: auto;
  animation: ntIn 0.28s var(--ease) both;
}

.nt.out {
  animation: ntOut 0.22s ease forwards;
}

.nt .ti {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--ac);
}

.nt.err .ti {
  color: var(--red);
}

.nt .tc {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.nt .tx {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--dim);
  transition: color 0.2s;
}

.nt .tx:hover {
  color: var(--ink);
}

.nt .i {
  width: 18px;
  height: 18px;
}

.nt .tx .i {
  width: 15px;
  height: 15px;
}

.nt .tbar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--ac);
  transform-origin: left center;
  animation: ntBar var(--dur, 4200ms) linear forwards;
}

.nt.err .tbar {
  background: var(--red);
}

.nt:hover .tbar {
  animation-play-state: paused;
}

@keyframes ntIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes ntOut {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes ntBar {
  to {
    transform: scaleX(0);
  }
}

.tip {
  position: fixed;
  z-index: 8000;
  max-width: 260px;
  padding: 10px 14px;
  border-radius: var(--r2);
  background: var(--s3);
  box-shadow: var(--up2);
  color: var(--ink);
  font: 400 0.78rem/1.5 var(--mono);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 0.16s,
    transform 0.16s;
}

.tip.on {
  opacity: 1;
  transform: none;
}

.ck {
  position: fixed;
  z-index: 7500;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + var(--sb) + 12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  padding: 20px;
  border-radius: var(--r3);
  background: var(--s2);
  box-shadow: var(--up2);
  animation: ntIn 0.4s ease both;
}

.ck h2 {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ac);
}

.ck p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--mu);
}

.ck .row {
  display: flex;
  justify-content: flex-end;
}

.ck button {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r2);
  font: 600 0.84rem var(--font);
}

.ck .ok {
  background: var(--ac);
  color: var(--on);
}

.ck .ok:hover {
  background: var(--ac-hi);
}

/* ---------- 404 ---------- */
.page-nf {
  display: grid;
  place-items: center;
  min-height: 100%;
  overflow: auto;
}

.nf {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 520px;
  padding: 56px 24px;
  text-align: center;
}

.nf-reel {
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin-bottom: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 46%, var(--s2) 47%),
    repeating-conic-gradient(var(--bg) 0 18deg, var(--s2) 18deg 60deg);
  box-shadow: var(--up2);
}

.nf-reel::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--hole);
}

.nf-reel span {
  position: relative;
  color: var(--ac);
  font: 500 1.7rem var(--mono);
  letter-spacing: 0.06em;
}

.nf-kicker {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.nf h1 {
  font: 600 1.6rem/1.2 var(--font);
  letter-spacing: -0.01em;
}

.nf-text {
  color: var(--mu);
  line-height: 1.6;
}

.nf-btn {
  margin-top: 10px;
  padding: 14px 26px;
  border-radius: var(--r2);
  background: var(--ac);
  box-shadow: var(--key);
  color: var(--on);
  font: 700 0.9rem var(--font);
  transition: transform 0.15s;
}

.nf-btn:hover {
  background: var(--ac-hi);
}

.nf-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* desktop: panel on the right */
@media (min-width: 900px) {
  .layout {
    flex-direction: row;
  }

  .props {
    width: 360px;
    margin: 0 22px 0 0;
  }

  .vp {
    padding: 14px 26px 20px;
  }

  .tool .lbl {
    display: block;
  }

  .tool {
    height: 60px;
  }

  .hb.lbl span:not(.i) {
    display: none;
  }

  .vtb .hb.lbl {
    padding: 0 14px;
  }

  .vtb .hb.lbl span:not(.i) {
    display: inline;
  }
}

/* mobile: panel sits above the dock */
@media (max-width: 899px) {
  .props {
    order: 2;
    margin: 0 16px;
    max-height: 42dvh;
  }

  .phead {
    display: none;
  }

  .pbody {
    flex: none;
    max-height: 40dvh;
    padding-bottom: 6px;
  }

  .sec {
    margin-bottom: 0;
  }

  .sec > .sh {
    display: none;
  }

  .sec.closed > .sb {
    display: grid;
  }

  .sb {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
    row-gap: 16px;
    padding: 16px 20px 20px;
  }

  .sb.one,
  .sb.mixrows {
    grid-template-columns: 1fr;
  }

  .sb .hint,
  .sb .prow,
  .sb .grid2,
  .sb .grid3 {
    grid-column: 1 / -1;
  }

  .sb .hint {
    margin-bottom: -4px;
  }

  .prow.acts {
    flex-direction: row;
  }

  .prow.acts .pbtn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .sh2 label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .srow:not(.dirty) .sh2 .rst {
    display: none;
  }

  #pContent:has(.stabs) .sh2 label {
    display: none;
  }

  .stick {
    padding: 14px 20px 2px;
  }

  .vp {
    padding: 8px 18px 12px;
  }

  .toolbar {
    padding: 8px 18px 12px;
    gap: 8px;
  }

  .toolbar > .sp {
    display: none;
  }

  .svw {
    margin-left: auto;
  }

  .meta {
    display: none;
  }

  .hb,
  .hb.save {
    min-width: 40px;
    height: 40px;
  }

  .hb.save {
    padding: 0 16px;
  }

  .vtl {
    padding: 0 18px 10px;
  }

  .vpan {
    gap: 18px;
    padding: 12px 20px 18px;
  }

  #zFit {
    display: none;
  }

  .ck {
    left: 12px;
  }
}

@media (max-width: 639px) {
  .topbar {
    padding: calc(var(--st) + 14px) 18px 8px;
    gap: 10px;
  }

  .top-credit {
    display: none;
  }

  .credit-m {
    display: block;
  }

  .tb-link {
    height: 42px;
  }

  .tb-link.gh {
    width: 42px;
  }

  .tb-link.coffee {
    padding: 0 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 420px) {
  .logo,
  .info {
    display: none;
  }

  .brand h1 {
    font-size: 0.82rem;
    letter-spacing: 0.14em;
  }

  .tb-actions {
    gap: 8px;
  }

  .tb-link.coffee {
    gap: 7px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .nav {
    width: calc(100% - 16px);
    padding: 6px;
    gap: 5px;
  }

  .tool {
    height: 50px;
  }
}

@media (max-width: 480px) {
  #zOut,
  #zIn {
    display: none;
  }
}

@media (max-width: 340px) {
  .brand h1 {
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: normal;
  }

  .zoombar .zl {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
