:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 232px;
  --sidebar-mini: 72px;
  --topbar: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --accent: #7c5cff;
  --accent-2: #4fd1ff;
  --danger: #ff5c7a;
  --ok: #3ddc97;
  --warn: #ffb547;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b10;
  --bg-2: #111118;
  --panel: #15151e;
  --panel-2: #1c1c27;
  --panel-3: #252532;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #ececf3;
  --text-2: #a3a3b5;
  --text-3: #6d6d80;
  --star: #ffffff;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --glass: rgba(14, 14, 20, .72);
  --backdrop: rgba(0, 0, 0, .66);
  --hover: rgba(255, 255, 255, .05);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f8;
  --bg-2: #ececf2;
  --panel: #ffffff;
  --panel-2: #f6f6fa;
  --panel-3: #e9e9f1;
  --line: rgba(10, 10, 30, .08);
  --line-2: rgba(10, 10, 30, .15);
  --text: #15151f;
  --text-2: #55556a;
  --text-3: #8b8ba0;
  --star: #111118;
  --shadow: 0 10px 40px rgba(20, 20, 50, .12);
  --glass: rgba(255, 255, 255, .78);
  --backdrop: rgba(10, 10, 25, .5);
  --hover: rgba(10, 10, 30, .045);
}

* { box-sizing: border-box; }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, video { display: block; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Theme switch: crossfade the whole page */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: ease; }
html.theme-fade * { transition: background-color .4s ease, color .4s ease, border-color .4s ease !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; transition: grid-template-columns .35s var(--ease); }
.shell.mini { grid-template-columns: var(--sidebar-mini) 1fr; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 12px 10px; gap: 4px; overflow: hidden; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.brand .logo svg { width: 16px; height: 16px; fill: #fff; stroke: none; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 11px; color: var(--text-2);
  font-weight: 500; white-space: nowrap; position: relative; transition: background .2s, color .2s; cursor: pointer;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item .label { transition: opacity .25s; }
.shell.mini .nav-item .label, .shell.mini .brand .name { opacity: 0; pointer-events: none; }
.nav-item .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 20px; line-height: 18px; }
.shell.mini .nav-item .count { position: absolute; top: 4px; left: 32px; }
.sidebar .spacer { flex: 1; }
.nav-list { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -10px; padding: 0 10px; scrollbar-width: none; }
.nav-spacer { flex: 1; min-height: 8px; }
.nav-divider { height: 1px; background: var(--line-2); margin: 6px 10px; flex: none; }
.nav-item .nav-img { width: 22px; height: 22px; object-fit: cover; border-radius: 6px; flex: none; }
.nav-item.cover { min-height: 64px; background-size: cover; background-position: center; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); align-items: flex-end; font-weight: 700; overflow: hidden; }
.nav-item.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .6)); border-radius: inherit; z-index: 0; }
.nav-item.cover > * { position: relative; z-index: 1; }
.nav-item.cover:hover { filter: brightness(1.12); color: #fff; }
.nav-item.cover.active { box-shadow: inset 0 0 0 2px var(--accent); }
.shell.mini .nav-item.cover { min-height: 46px; }
.nav-item.is-hidden { opacity: .35; }
.brand-box { flex: none; }
.brand .logo.img { background: none; box-shadow: none; object-fit: contain; width: auto; max-width: 160px; height: 34px; border-radius: 0; }
.brand a, a.brand { color: inherit; text-decoration: none; }
h1, h2, h3, .brand .name { font-family: var(--font-head, var(--font)); }
/* viewing as another user (admin) */
.as-banner { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--warn); color: #241500; font-size: 13.5px; font-weight: 500; position: sticky; top: 0; z-index: 20; }
.as-banner svg { width: 18px; height: 18px; }
.as-banner .btn { background: rgba(0, 0, 0, .14); color: #241500; border-color: transparent; }
.shell.as-user { box-shadow: inset 0 0 0 3px var(--warn); }
.collapse-btn { justify-content: flex-start; }
.collapse-btn svg { transition: transform .35s var(--ease); }
.shell.mini .collapse-btn svg { transform: rotate(180deg); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); z-index: 4; flex: none;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.topbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 0 12px; height: 38px; width: min(360px, 34vw); transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.search svg { width: 16px; height: 16px; color: var(--text-3); }
.content { flex: 1; overflow: auto; position: relative; }
.page { padding: 26px 30px 60px; max-width: 1800px; margin: 0 auto; animation: page-in .35s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* theme toggle switch */
.theme-toggle {
  width: 58px; height: 30px; border-radius: 30px; border: 1px solid var(--line-2); background: var(--panel-2);
  position: relative; cursor: pointer; padding: 0; flex: none;
}
.theme-toggle .knob {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); transition: transform .45s var(--spring), background .4s;
}
.theme-toggle .knob svg { width: 14px; height: 14px; }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(28px); background: #2b2b3a; }
.theme-toggle .ico { position: absolute; top: 7px; width: 14px; height: 14px; color: var(--text-3); }
.theme-toggle .ico.sun { left: 8px; } .theme-toggle .ico.moon { right: 8px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s; user-select: none;
}
.btn:hover { background: var(--panel-2); border-color: var(--line-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 30px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; border: 0; background: none; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.input, select.input, textarea.input {
  height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 12px; outline: none;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
textarea.input { height: auto; min-height: 44px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.hint { color: var(--text-3); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grow { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 23px; background: var(--panel-3); position: relative; transition: background .25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; transition: background .2s, color .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--text-2); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.accent { background: color-mix(in srgb, var(--accent) 20%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 12px; opacity: .6; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
.section-head .more { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.section-head .more:hover { color: var(--text); }

svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- clip cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px 16px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 300px); gap: 16px; overflow-x: auto; padding: 4px 4px 14px; margin: 0 -4px; scroll-snap-type: x proximity; }
.strip > * { scroll-snap-align: start; }
.card { position: relative; cursor: pointer; border-radius: var(--radius); outline: none; user-select: none; }
.card .media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--panel-2); transition: transform .3s var(--ease), box-shadow .3s; }
.card:hover .media { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .media img, .card .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .media video { opacity: 0; transition: opacity .3s; }
.card .media video.on { opacity: 1; }
.card .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; transition: opacity .2s; }
.card .badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; }
.card .badges .chip { background: rgba(0, 0, 0, .65); color: #fff; backdrop-filter: blur(6px); }
.card .badges .chip.warn { background: rgba(255, 181, 71, .92); color: #241500; }
/* The slider opens only from the audio icon; it stays open while the pointer moves up into it.
   The rest of the control box lets clicks through (the select bubble, the card). */
.card .audio-ctl { position: absolute; right: 8px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.card .audio-ctl .audio-btn { pointer-events: auto; }
.card .vpop { position: relative; margin-bottom: 6px; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); border-radius: 15px; padding: 10px 0; width: 30px; display: grid; place-items: center; opacity: 0; transform: translateY(6px) scale(.9); pointer-events: none; visibility: hidden; transition: opacity .2s, transform .25s var(--spring), visibility 0s linear .25s; }
.card .vpop::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: -8px; height: 8px; }
.card .audio-ctl:has(.audio-btn:hover) .vpop, .card .vpop:hover { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
input.vslider { writing-mode: vertical-lr; direction: rtl; width: 16px; height: 78px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.card .audio-btn { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s var(--spring); cursor: pointer; backdrop-filter: blur(6px); }
.card .audio-btn svg { width: 15px; height: 15px; }
.card:hover .audio-btn { opacity: 1; transform: none; }
.card .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; z-index: 2; cursor: pointer; display: none; }
.card .media.previewing .pbar { display: block; }
.card .pbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .22); transition: height .15s; }
.card .pbar:hover::before, .card .pbar.drag::before { height: 6px; }
.card .pbar:hover .bar, .card .pbar.drag .bar { height: 6px; }
.card:hover .dur { opacity: 0; }
.card .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 0; transition: height .15s; }
button svg { pointer-events: none; }
a.ulink { color: inherit; text-decoration: none; }
a.ulink:hover { text-decoration: underline; }
.card .meta { display: flex; gap: 10px; padding: 10px 2px 0; align-items: flex-start; }
.card .meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta .s { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.card .meta .s svg { width: 12px; height: 12px; }
.card .meta .info { min-width: 0; flex: 1; }
.card.selected .media { box-shadow: 0 0 0 3px var(--accent), var(--shadow); transform: scale(.97); }
.card .check { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35); display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s; z-index: 2; }
.card .check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.selecting .card .check, .card:hover .check { opacity: 1; }
.card.selected .check { background: var(--accent); border-color: var(--accent); opacity: 1; }
.card.selected .check svg { opacity: 1; }
.stars-mini { display: inline-flex; align-items: center; gap: 3px; }
.stars-mini svg { width: 12px; height: 12px; fill: var(--star); stroke: none; }

.select-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 30; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 18px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(18px); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); transition: transform .4s var(--spring); white-space: nowrap;
}
.select-bar.on { transform: translate(-50%, 0); }
.select-bar:not(.on) { visibility: hidden; pointer-events: none; transition: transform .3s ease, visibility 0s linear .3s; }
.select-bar .n { font-weight: 700; margin-right: 8px; }

/* hero / clip of the day */
.hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 340px; display: grid; grid-template-columns: 1.5fr 1fr; background: var(--panel); border: 1px solid var(--line); }
.hero .hero-media { position: relative; background: #000; cursor: pointer; }
.hero .hero-media video, .hero .hero-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero .hero-info { padding: 28px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.hero .hero-info .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(40px) saturate(1.4); opacity: .25; transform: scale(1.3); }
.hero .hero-info > * { position: relative; }
.hero .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.hero h2 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.02em; }

.dropzone {
  border: 2px dashed var(--line-2); border-radius: 22px; padding: 26px; display: flex; align-items: center; gap: 22px; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent-2) 5%, transparent));
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); transform: translateY(-2px); }
.dropzone.over { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dropzone .big-ico { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.dropzone .big-ico svg { width: 26px; height: 26px; }
.dropzone h3 { margin: 0 0 2px; font-size: 18px; }

/* ---------- layers: modal, toast ---------- */
.backdrop { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .3s ease; }
.backdrop.on { opacity: 1; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); max-width: min(560px, 100%); width: 100%; max-height: calc(100vh - 48px); overflow: auto; transform: translateY(16px) scale(.96); opacity: 0; transition: transform .4s var(--spring), opacity .3s; }
.backdrop.on .modal { transform: none; opacity: 1; }
.modal.wide { max-width: min(1400px, 100%); }
.modal.mid { max-width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; }
.modal-body { padding: 10px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; animation: toast-in .4s var(--spring); pointer-events: auto; max-width: 420px; }
.toast.err { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

.menu { position: fixed; z-index: 120; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; min-width: 190px; animation: menu-in .18s var(--ease); max-height: 60vh; overflow: auto; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu .mi { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu .mi:hover { background: var(--hover); }
.menu .mi svg { width: 16px; height: 16px; color: var(--text-2); }
.menu .mi.danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- clip viewer ---------- */
/* The stage is as wide as the video at the viewer's height (no side bars); past the screen width it
   letterboxes as before. --ar is set per clip. */
.modal.clipview { width: auto; max-width: calc(100vw - 48px); }
.viewer { --vh: min(86vh, 900px); --ar: 1.7778; --stage-w: min(calc(var(--vh) * var(--ar)), calc(100vw - 48px - 382px)); display: grid;
  height: max(min(var(--vh), calc(var(--stage-w) / var(--ar))), min(var(--vh), 460px));
  grid-template-columns: var(--stage-w) 380px; transition: grid-template-columns .3s var(--ease); }
.viewer .stage { background: #000; position: relative; display: flex; flex-direction: column; min-height: 0; border-radius: 20px 0 0 20px; overflow: hidden; }
.viewer .side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.viewer .side .scroll { flex: 1; overflow: auto; padding: 18px; }
.viewer .title-row { display: flex; gap: 8px; align-items: flex-start; }
.viewer .title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; flex: 1; outline: none; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.viewer .title[contenteditable="true"]:hover { background: var(--hover); }
.viewer .title[contenteditable="true"]:focus { background: var(--panel-2); box-shadow: 0 0 0 2px var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 14px 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }

/* player */
.player { position: relative; flex: 1; min-height: 0; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.player video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.player .ctl { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); color: #fff; opacity: 0; transition: opacity .25s; }
.player:hover .ctl, .player.paused .ctl { opacity: 1; }
.player.idle:not(.paused) .ctl { opacity: 0; pointer-events: none; }
.player.idle:not(.paused) { cursor: none; }
@media (hover: none) { .player:not(.idle) .ctl { opacity: 1; } }   /* touch: shown until they idle out */
.player .ctl .row { gap: 6px; }
.player .ctl .icon-btn { color: #fff; width: 34px; height: 34px; }
.player .ctl .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.player .time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; opacity: .9; }
.scrub { position: relative; height: 18px; cursor: pointer; display: flex; align-items: center; margin-bottom: 4px; }
.scrub .rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: height .15s; overflow: hidden; }
.scrub:hover .rail { height: 6px; }
.scrub .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.scrub .buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .25); }
.scrub .knob { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translateX(-50%) scale(0); transition: transform .15s; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent); }
.scrub:hover .knob { transform: translateX(-50%) scale(1); }
.scrub .cut { position: absolute; top: -3px; width: 2px; height: 10px; background: #fff8; }
.player .big-play { position: absolute; width: 74px; height: 74px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: grid; place-items: center; color: #fff; backdrop-filter: blur(8px); opacity: 0; transform: scale(.8); transition: opacity .25s, transform .3s var(--spring); pointer-events: none; }
.player.paused .big-play { opacity: 1; transform: none; }
.player .big-play svg { width: 30px; height: 30px; fill: #fff; stroke: none; margin-left: 4px; }
.player .note { position: absolute; top: 12px; left: 12px; background: rgba(0, 0, 0, .65); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.vol { width: 0; overflow: hidden; transition: width .25s var(--ease); }
.vol-wrap:hover .vol { width: 80px; }
.vol input { width: 76px; accent-color: var(--accent); }

/* stars */
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--star); transition: transform .2s var(--spring); }
.stars button:hover { transform: scale(1.18); }
.stars svg { width: 22px; height: 22px; stroke: var(--star); stroke-width: 1.6; fill: transparent; transition: fill .15s; }
.stars button.on svg { fill: var(--star); }
.stars.readonly button { cursor: default; }
.stars.readonly button:hover { transform: none; }

/* comments */
.comments { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.comment { display: flex; gap: 10px; animation: page-in .3s var(--ease); }
.comment .body { flex: 1; min-width: 0; }
.comment .who { font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.comment .who .when { color: var(--text-3); font-weight: 500; font-size: 12px; }
.comment .text { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.comment .att { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.comment .att img { max-width: 220px; max-height: 200px; border-radius: 10px; cursor: zoom-in; }
.comment .acts { display: flex; gap: 10px; margin-top: 3px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.comment .acts span { cursor: pointer; } .comment .acts span:hover { color: var(--text); }
.comment.reply { margin-left: 40px; }
.composer { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.composer .box { display: flex; align-items: flex-end; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; min-height: 34px; max-height: 140px; padding: 7px 6px; }
.composer .pending { display: flex; gap: 6px; flex-wrap: wrap; }
.composer .pending .pi { position: relative; }
.composer .pending img { height: 64px; border-radius: 8px; }
.composer .pending .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.composer .pending .x svg { width: 12px; height: 12px; }
.replying { font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }

.gif-picker { position: fixed; z-index: 130; width: 380px; height: 440px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: menu-in .2s var(--ease); }
.gif-picker .gp-head { padding: 10px; }
.gif-picker .gp-grid { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 0 10px 10px; display: flex; gap: 6px; align-items: flex-start; }
.gif-picker .gp-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gif-picker .gp-grid img { width: 100%; border-radius: 8px; cursor: pointer; transition: transform .2s; background: var(--panel-2); display: block; }
.gif-picker .gp-grid img:hover { transform: scale(1.03); }
.gif-picker .gp-foot { font-size: 11px; color: var(--text-3); padding: 6px 10px; border-top: 1px solid var(--line); }

/* ---------- uploads ---------- */
.up-list { display: flex; flex-direction: column; gap: 12px; }
.up-card { display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: center; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); animation: page-in .35s var(--ease); transition: border-color .3s, opacity .4s, transform .4s; }
.up-card.done { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.up-card.leaving { opacity: 0; transform: translateX(30px); }
.up-card .thumb { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--panel-2); position: relative; display: grid; place-items: center; color: var(--text-3); }
.up-card .thumb img, .up-card .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.up-card .thumb .stack { position: absolute; right: 6px; top: 6px; }
.up-card .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lines { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.line .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); margin-bottom: 3px; }
.line .lbl .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line .lbl .st { font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; position: relative; }
.progress > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s var(--ease); }
.progress.proc > div { background: linear-gradient(90deg, var(--accent-2), var(--ok)); }
.progress.done > div { background: var(--ok); }
.progress.fail > div { background: var(--danger); }
.progress.indet > div { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { left: -30%; } to { left: 100%; } }
.up-card .acts { display: flex; gap: 8px; }

/* game picker */
.gp-list { max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.gp-item { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.gp-item:hover, .gp-item.hl { background: var(--hover); }
.gp-item img, .gp-item .ph { width: 36px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--panel-3); flex: none; }
.gp-item .nm { font-weight: 600; }
.gp-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 8px 8px 4px; }
.game-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; max-width: 260px; }
.game-btn img, .game-btn .ph { width: 22px; height: 28px; border-radius: 4px; object-fit: cover; background: var(--panel-3); flex: none; }
.game-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- editor ---------- */
.editor { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: editor-in .35s var(--ease); }
@keyframes editor-in { from { opacity: 0; transform: scale(.985); } }
.ed-top { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.ed-top .ttl { font: inherit; font-weight: 700; font-size: 15px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; min-width: 120px; width: min(360px, 32vw); transition: border-color .2s, background .2s; }
.ed-top .ttl:hover { border-color: var(--border); }
.ed-top .ttl:focus { outline: none; border-color: var(--accent); background: var(--panel-2); }
.ed-top .ttl::placeholder { color: var(--text); opacity: .85; }
.ed-view { cursor: pointer; }
.ed-list .it.derived { margin-left: 18px; position: relative; }
.ed-list .it.derived::before { content: ""; position: absolute; left: -11px; top: -6px; width: 8px; height: 50%; border-left: 2px solid var(--border); border-bottom: 2px solid var(--border); border-bottom-left-radius: 6px; }
.ed-main { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.ed-stage { display: flex; flex-direction: column; min-height: 0; padding: 16px; gap: 12px; }
.ed-fit { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.ed-view { --ar: 1.7778; aspect-ratio: var(--ar); width: min(100cqw, calc(100cqh * var(--ar))); background: #000; border-radius: 16px; position: relative; overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow); transition: width .3s var(--ease); }
.ed-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ed-view .note { position: absolute; left: 12px; top: 12px; z-index: 2; }
.ed-view .warn-box { color: #ddd; text-align: center; max-width: 420px; padding: 20px; z-index: 1; }
.ed-transport { display: flex; align-items: center; gap: 8px; }
.ed-transport .time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 140px; }
.ed-side { border-left: 1px solid var(--line); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.ed-side h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.ed-tl { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px 16px; user-select: none; }
.tl-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; position: relative; padding-bottom: 4px; }
.tl-inner { position: relative; height: 96px; }
.tl-ruler { position: absolute; left: 0; right: 0; top: 0; height: 20px; font-size: 10.5px; color: var(--text-3); }
.tl-ruler span { position: absolute; top: 2px; transform: translateX(3px); }
.tl-ruler i { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--line-2); }
.tl-track { position: absolute; left: 0; right: 0; top: 26px; height: 66px; }
.tl-seg { position: absolute; top: 0; bottom: 0; border-radius: 9px; overflow: hidden; background-color: var(--panel-3); background-repeat: repeat-x; background-size: auto 100%; border: 2px solid transparent; cursor: grab; transition: border-color .15s, box-shadow .15s, opacity .2s; }
.tl-seg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .55)); pointer-events: none; }
.tl-seg .lbl { position: absolute; left: 8px; bottom: 4px; color: #fff; font-size: 11px; font-weight: 700; z-index: 1; text-shadow: 0 1px 3px #000; }
.tl-seg.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.tl-seg.dragging { opacity: .6; cursor: grabbing; }
.tl-seg .h { position: absolute; top: 0; bottom: 0; width: 12px; z-index: 2; cursor: ew-resize; display: grid; place-items: center; }
.tl-seg .h::before { content: ""; width: 4px; height: 26px; border-radius: 3px; background: #fff; opacity: .85; box-shadow: 0 0 4px #000; }
.tl-seg .h.l { left: 0; } .tl-seg .h.r { right: 0; }
.tl-head { position: absolute; top: 18px; bottom: 0; width: 2px; background: var(--accent); z-index: 5; pointer-events: none; }
.tl-head::before { content: ""; position: absolute; top: -2px; left: -6px; border: 7px solid transparent; border-top: 9px solid var(--accent); }
.tl-src { position: relative; margin-top: 8px; height: 26px; cursor: pointer; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.tl-src .k { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 40%, transparent); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.tl-src .part { position: absolute; top: 0; height: 4px; background: var(--accent-2); opacity: .7; }
.tl-src .lb { position: absolute; right: 6px; top: 3px; font-size: 10.5px; color: var(--text-3); }
.ed-list { display: flex; flex-direction: column; gap: 6px; }
.ed-list .it { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.ed-list .it:hover { background: var(--hover); }
.ed-list .it.cur { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ed-list .it img, .ed-list .it .ph { width: 72px; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover; background: var(--panel-3); flex: none; }
.kbd { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-2); background: var(--panel-2); }

/* ---------- games ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.game-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--panel-2); transition: transform .35s var(--ease), box-shadow .35s; }
.game-tile:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.game-tile img.cover, .game-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game-tile video { opacity: 0; transition: opacity .5s; }
.game-tile video.on { opacity: 1; }
.game-tile .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; padding: 16px; text-align: center; letter-spacing: -.02em; color: #fff; }
.game-tile .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: #fff; }
.game-tile .info .n { font-weight: 700; font-size: 15px; line-height: 1.2; }
.game-tile .info .c { font-size: 12px; opacity: .8; }
.game-hero { position: relative; min-height: 340px; border-radius: 22px; overflow: hidden; margin-bottom: 16px; background: var(--panel-2); display: flex; }
.game-hero img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: hero-zoom 18s ease-out both; }
.game-hero img.art.blur { filter: blur(30px); transform: scale(1.2); animation: none; }
@keyframes hero-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.game-hero .ov { position: relative; flex: 1; background: linear-gradient(90deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .6) 45%, rgba(0, 0, 0, .1)), linear-gradient(transparent 50%, rgba(0, 0, 0, .5)); display: flex; align-items: flex-end; gap: 24px; padding: 30px; color: #fff; }
.game-hero .ov img.cover { width: 150px; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); flex: none; }
.game-hero h2 { font-size: 38px; margin: 0 0 6px; letter-spacing: -.025em; line-height: 1.1; }
.game-hero .gh-info { min-width: 0; max-width: 720px; }
.game-hero .gh-meta { gap: 8px; font-size: 13.5px; opacity: .92; align-items: center; }
.game-hero .gh-meta > span:not(.chip) + span:not(.chip)::before { content: "·"; margin-right: 8px; opacity: .6; }
.game-hero .chip { background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(6px); }
.game-hero .gh-desc { margin-top: 10px; font-size: 13.5px; line-height: 1.55; opacity: .88; }
.game-hero .gh-desc .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.game-hero .gh-desc .desc.open { -webkit-line-clamp: unset; }
.game-hero .gh-stats { gap: 16px; margin-top: 12px; font-size: 13px; }
.game-hero .gh-stats a { color: #fff; }
.game-hero .faint { color: rgba(255, 255, 255, .7); }
button.linkish { background: none; border: 0; padding: 0; color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; margin-top: 2px; }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 6px; }
.shots img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; cursor: zoom-in; transition: transform .25s var(--ease); }
.shots img:hover { transform: scale(1.03); }

/* ---------- watch party ---------- */
.party { display: grid; grid-template-columns: minmax(0, 1fr) 12px var(--side-w, 300px); gap: 16px 2px; height: calc(100vh - var(--topbar)); padding: 16px; }
.pside-grip { cursor: col-resize; position: relative; touch-action: none; }
.pside-grip::after { content: ""; position: absolute; left: 5px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: var(--line-2); transition: background .15s, top .2s, bottom .2s; }
.pside-grip:hover::after, .pside-grip.on::after { background: var(--accent); top: 10%; bottom: 10%; }
.party.resizing { user-select: none; cursor: col-resize; }
.party.resizing video { pointer-events: none; }
.party .pstage { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.party .pview { flex: none; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--topbar) - 250px); min-height: 0; border-radius: 18px; overflow: hidden; background: #000; position: relative; }
.party .pview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .25s; }
.party .pview .lane-name { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; align-items: center; background: rgba(0, 0, 0, .6); color: #fff; padding: 6px 10px 6px 6px; border-radius: 30px; font-weight: 600; backdrop-filter: blur(8px); z-index: 2; }
.party .pctl { display: flex; align-items: center; gap: 8px; }
.party .pctl .time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 110px; }
.party .pscrub { flex: 1; }
.party .pscrub .scrub .rail { background: var(--panel-3); }
.party .ptl { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.moments { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.moment { flex: none; border-radius: 12px; border: 2px solid transparent; background: var(--panel-2); padding: 6px; cursor: pointer; transition: border-color .2s, transform .2s; }
.moment:hover { transform: translateY(-2px); }
.moment.cur { border-color: var(--accent); }
.moment.drag-over { border-color: var(--accent-2); border-style: dashed; }
.moment .mt { font-size: 11px; color: var(--text-2); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; padding: 0 2px 4px; }
.moment .lanes { position: relative; display: flex; flex-direction: column; gap: 3px; width: var(--w, 160px); }
.moment .lane { position: relative; height: 22px; border-radius: 5px; background: var(--panel-3); overflow: hidden; }
.moment .lane .clipbar { position: absolute; top: 0; bottom: 0; border-radius: 5px; background-size: auto 100%; background-repeat: repeat-x; display: flex; align-items: center; padding-left: 4px; gap: 4px; }
.moment .lane .clipbar .avatar { width: 16px; height: 16px; font-size: 8px; box-shadow: 0 0 0 1.5px #000a; }
.moment .lane.on .clipbar { box-shadow: inset 0 0 0 2px var(--accent); }
.moment .phead { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; box-shadow: 0 0 6px #000; z-index: 2; pointer-events: none; }
.party .pside { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.party .pside .panel { padding: 14px; }
.lane-pick { display: flex; flex-direction: column; gap: 6px; }
.lane-pick .lp { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.lane-pick .lp:hover { background: var(--hover); }
.lane-pick .lp.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lane-pick .lp.off { opacity: .45; }
.party-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.party-card { padding: 18px; border-radius: 18px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--panel)), var(--panel)); border: 1px solid var(--line); }
.party-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth .blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .35; animation: drift 18s ease-in-out infinite alternate; }
.auth .blob.a { background: var(--accent); top: -25vmax; left: -15vmax; }
.auth .blob.b { background: var(--accent-2); bottom: -30vmax; right: -20vmax; animation-delay: -6s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
.auth .card-box { position: relative; width: min(400px, 100%); padding: 30px; border-radius: 24px; background: var(--glass); backdrop-filter: blur(24px); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: page-in .5s var(--ease); }
.auth h1 { margin: 14px 0 4px; font-size: 26px; letter-spacing: -.02em; }

/* tables (admin) */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr { transition: background .15s; }
.table tbody tr:hover { background: var(--hover); }
.logs { font: 12.5px/1.55 ui-monospace, "JetBrains Mono", monospace; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; max-height: calc(100vh - 230px); overflow: auto; }
.logs .l { display: grid; grid-template-columns: 150px 50px 110px 1fr; gap: 10px; padding: 2px 0; white-space: pre-wrap; word-break: break-word; }
.logs .l .lv-warn { color: var(--warn); } .logs .l .lv-error { color: var(--danger); } .logs .l .lv-info { color: var(--text-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; display: inline-flex; gap: 8px; align-items: center; }
.tabs button.on { color: var(--text); border-color: var(--accent); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.settings-grid .panel { padding: 20px; }
.settings-grid h3 { margin: 0 0 14px; font-size: 16px; }
.group-card { padding: 18px; }
.group-card .members { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.group-card .m { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border-radius: 20px; padding: 3px 10px 3px 3px; font-size: 13px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.share-page { max-width: 1100px; margin: 0 auto; padding: 30px 20px 60px; }
.share-page .player { border-radius: 18px; aspect-ratio: 16/9; }

@media (max-width: 1100px) {
  .modal.clipview { width: 100%; }
  .viewer { grid-template-columns: 1fr; height: auto; }
  .viewer .stage { border-radius: 20px 20px 0 0; aspect-ratio: var(--ar); max-height: 70vh; }
  .viewer .side { border-left: 0; max-height: 60vh; }
  .hero { grid-template-columns: 1fr; }
  .hero .hero-media { aspect-ratio: 16/9; }
  .ed-main { grid-template-columns: 1fr; }
  .ed-side { display: none; }
  .party { grid-template-columns: 1fr; height: auto; }
  .pside-grip { display: none; }
}
/* ---------- phones: bottom tab bar, full-screen sheets, bigger touch targets ---------- */
@media (max-width: 760px) {
  .shell, .shell.mini { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  .main { order: 1; flex: 1; min-height: 0; height: auto; }
  .sidebar { order: 2; flex: none; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); gap: 0;
    border-right: 0; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); }
  .sidebar .brand-box, .sidebar .collapse-btn, .nav-spacer, .nav-divider { display: none; }
  .nav-list { flex-direction: row; margin: 0; padding: 0; gap: 0; overflow-x: auto; overflow-y: hidden; }
  .nav-item { flex: 1 1 0; min-width: 42px; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 4px; font-size: 10.5px; font-weight: 600; border-radius: 12px; min-height: 52px; }
  .nav-item svg, .nav-item .nav-img { width: 22px; height: 22px; }
  .shell .nav-item .label, .shell.mini .nav-item .label { opacity: 1; pointer-events: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-item.active::before { left: 30%; right: 30%; top: -4px; bottom: auto; width: auto; height: 3px; }
  .nav-item .count, .shell.mini .nav-item .count { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; }
  .nav-item.cover { min-height: 52px; align-items: center; }
  .topbar { padding: env(safe-area-inset-top) 12px 0; height: calc(var(--topbar) + env(safe-area-inset-top)); gap: 8px; }
  .topbar h1 { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > .row { flex: none; }
  .topbar > .row .btn { padding: 0 10px; }
  .page { padding: 16px 14px 40px; }
  .section-head { margin: 24px 0 10px; }
  .up-card { grid-template-columns: 112px minmax(0, 1fr); gap: 10px 12px; align-items: start; }
  .up-card .acts { grid-column: 1 / -1; flex-wrap: wrap; }
  .up-card .t { font-size: 13.5px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px 12px; }
  .strip { grid-auto-columns: 80vw; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .dropzone { padding: 12px 14px; gap: 12px; }
  .dropzone .big-ico { width: 42px; height: 42px; border-radius: 12px; }
  .dropzone .big-ico svg { width: 20px; height: 20px; }
  .dropzone h3 { font-size: 15px; }
  .dropzone .muted { display: none; }
  .hero-info { padding: 16px; }
  .game-hero { min-height: 260px; }
  .game-hero .ov { flex-direction: column; align-items: flex-start; padding: 18px; gap: 12px; }
  .game-hero .ov img.cover { width: 84px; }
  .game-hero h2 { font-size: 26px; }
  .panel:has(> .table) { overflow-x: auto; }
  .panel > .table { min-width: 680px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; }
  /* dialogs become sheets from the bottom; the clip viewer and admin view take the whole screen */
  .backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100% !important; width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal.clipview, .modal.adminview-modal { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .viewer { height: 100%; display: flex; flex-direction: column; }
  .viewer .stage { border-radius: 0; max-height: 42dvh; flex: none; }
  .viewer .side { max-height: none; flex: 1; min-height: 0; }
  .adminview { height: 100%; }
  .gif-picker, .emoji-picker { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); height: 60dvh; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: center; }
  .select-bar { bottom: calc(72px + env(safe-area-inset-bottom)); left: 8px; right: 8px; transform: translateY(30px); opacity: 0; flex-wrap: wrap; justify-content: center; white-space: normal; transition: transform .3s var(--ease), opacity .2s; }
  .select-bar.on { transform: none; opacity: 1; }
  .as-banner { font-size: 12px; padding: 6px 10px; flex-wrap: wrap; }
  /* editor */
  .ed-top { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .ed-top .ttl { width: 46vw; min-width: 0; }
  .ed-stage { padding: 8px; }
  .ed-fit { min-height: 30vh; }
  .ed-transport .faint { display: none; }
  .tl-tools { flex-wrap: wrap; gap: 4px; }
  .tl-tools .btn.sm { padding: 0 8px; }
  /* watch party */
  .party { padding: 8px; gap: 10px; }
  .party .pctl { flex-wrap: wrap; gap: 4px; }
  .party .pscrub { order: -1; flex-basis: 100%; }
  .party .pctl input[type=range]:not(.speed input) { width: 70px; }
  .party .psocial { min-height: 360px; }
  .cz-bar { display: none; }
  .cz-savebar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .cz-savebar > span { flex-basis: 100%; }
  .cz-savebar > .grow { display: none; }
  .cz-savebar > .btn { flex: 1 1 0; min-width: 0; }
}
/* touch screens: no hover previews to steer, so the hover-only bits stay out of the way */
@media (hover: none) {
  .card .audio-ctl, .card .pbar { display: none; }
  .card .check { opacity: 1; }
}
/* installed as an app: room for the status bar */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}

/* type-ahead people picker */
.user-picker { margin-top: 12px; position: relative; }
.user-picker > .row { gap: 8px; background: var(--panel-2); border-radius: 12px; padding: 4px 4px 4px 12px; border: 1px solid var(--line-2); }
.user-picker > .row:focus-within { border-color: var(--accent); }
.user-picker .input { border: 0; background: transparent; flex: 1; height: 34px; padding: 0; }
.user-picker .input:focus { box-shadow: none; }
.user-picker .up-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); z-index: 20; overflow: hidden; display: none; animation: menu-in .18s var(--ease); max-height: 300px; overflow-y: auto; }
.user-picker .up-list.on { display: block; }
.user-picker .up-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; }
.user-picker .up-row.cur { background: var(--hover); }
.user-picker .up-row .chip { opacity: 0; transition: opacity .15s; }
.user-picker .up-row.cur .chip { opacity: 1; }
.group-card { overflow: visible; }
.party .side-h { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.party .pview .q-note { position: absolute; right: 14px; top: 14px; z-index: 2; background: rgba(0, 0, 0, .55); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; backdrop-filter: blur(8px); opacity: .75; }
.party .pview .q-note.web { background: rgba(255, 181, 71, .85); color: #241500; }
.auth .brand { padding: 0; }
.auth-bg { position: absolute; inset: 0; }
.auth-bg img, .auth-bg video { width: 100%; height: 100%; object-fit: cover; }
.auth-bg .dim { position: absolute; inset: 0; }

/* status pills (Clip Processor colors) */
:root[data-theme="light"] {
  --s-queued: #2b5fb8; --s-queued-bg: #e2ecff; --s-processing: #0b7a75; --s-processing-bg: #d9f5f2; --s-done: #2c7a35; --s-done-bg: #e1f4e3;
  --s-failed: #b42318; --s-failed-bg: #fde4e1; --s-unsupported: #6b6f76; --s-unsupported-bg: #ececee; --s-joined: #6b4fbf; --s-joined-bg: #eee8ff;
  --s-window: #1f5fd1; --s-window-bg: #dce8ff; --s-nowin: #6b6f76; --s-nowin-bg: #ececee; --s-winok: #0f7a8a; --s-winok-bg: #d9f2f5;
  --s-cropped: #4b5a6b; --s-cropped-bg: #e3e9f0; --s-uploading: #8a6d00; --s-uploading-bg: #fff4cc; --s-uploaded: #6b4fbf; --s-uploaded-bg: #eee8ff;
  --s-cancelled: #6b6f76; --s-cancelled-bg: #ececee; --s-rebuilding: #8a4d00; --s-rebuilding-bg: #ffe9c7;
}
:root[data-theme="dark"] {
  --s-queued: #8fb4ff; --s-queued-bg: #1d2a45; --s-processing: #5fd6cf; --s-processing-bg: #123634; --s-done: #7fd38a; --s-done-bg: #18311c;
  --s-failed: #ff8a80; --s-failed-bg: #3d1a17; --s-unsupported: #a7adb5; --s-unsupported-bg: #2a2e34; --s-joined: #b9a3ff; --s-joined-bg: #2c2545;
  --s-window: #7fb0ff; --s-window-bg: #172a4a; --s-nowin: #a7adb5; --s-nowin-bg: #2a2e34; --s-winok: #6fd0dc; --s-winok-bg: #133a40;
  --s-cropped: #a9b8c9; --s-cropped-bg: #26303b; --s-uploading: #f2c94c; --s-uploading-bg: #3a3112; --s-uploaded: #b9a3ff; --s-uploaded-bg: #2c2545;
  --s-cancelled: #a7adb5; --s-cancelled-bg: #2a2e34; --s-rebuilding: #ffc46b; --s-rebuilding-bg: #3d2c12;
}
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; border: 0; font-family: inherit; line-height: 1.6; }
button.pill { cursor: pointer; }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.pill.s-queued { color: var(--s-queued); background: var(--s-queued-bg); } .pill.s-processing { color: var(--s-processing); background: var(--s-processing-bg); }
.pill.s-done { color: var(--s-done); background: var(--s-done-bg); } .pill.s-failed { color: var(--s-failed); background: var(--s-failed-bg); }
.pill.s-unsupported { color: var(--s-unsupported); background: var(--s-unsupported-bg); } .pill.s-joined { color: var(--s-joined); background: var(--s-joined-bg); }
.pill.s-window { color: var(--s-window); background: var(--s-window-bg); } .pill.s-nowin { color: var(--s-nowin); background: var(--s-nowin-bg); }
.pill.s-winok { color: var(--s-winok); background: var(--s-winok-bg); } .pill.s-cropped { color: var(--s-cropped); background: var(--s-cropped-bg); }
.pill.s-uploading { color: var(--s-uploading); background: var(--s-uploading-bg); } .pill.s-uploaded { color: var(--s-uploaded); background: var(--s-uploaded-bg); }
.pill.s-cancelled { color: var(--s-cancelled); background: var(--s-cancelled-bg); } .pill.s-rebuilding { color: var(--s-rebuilding); background: var(--s-rebuilding-bg); }

/* Admin View */
.modal.adminview-modal { max-width: min(1500px, 100%); }
.adminview { display: flex; flex-direction: column; height: min(90vh, 980px); }
.av-top { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.av-title { font-size: 18px; font-weight: 700; }
.av-body { display: grid; grid-template-columns: minmax(0, 1fr) 420px; min-height: 0; flex: 1; }
.av-left { display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 10px; }
.av-stage { flex: 1; min-height: 0; background: #000; border-radius: 14px; overflow: hidden; display: flex; }
.av-stage video { width: 100%; height: 100%; object-fit: contain; }
.av-src { gap: 6px; }
.av-side { border-left: 1px solid var(--line); overflow: auto; padding: 6px 16px 16px; }
.av-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.av-sec:last-child { border-bottom: 0; }
.av-sec h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.av-lines { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.av-note { margin-top: 6px; font-size: 12.5px; color: var(--warn); }
.av-tracks td { padding: 5px 6px; font-size: 13px; }
.av-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.av-levels label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.av-levels .input { width: 76px; }
.av-orig { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.av-rb { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-top: 10px; border-radius: 12px; background: var(--s-rebuilding-bg); color: var(--s-rebuilding); }
.av-rb.err { background: var(--s-failed-bg); color: var(--s-failed); }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input.sm { height: 30px; padding: 0 8px; font-size: 13px; }
.input.mono { font-family: ui-monospace, monospace; font-size: 12px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.adv-proc .adv-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.adv-proc h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
@media (max-width: 1100px) { .av-body { grid-template-columns: 1fr; } .av-side { border-left: 0; } .adminview { height: auto; } .av-stage { aspect-ratio: 16/9; } }

/* Customize */
.cz-intro { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel)); }
.cz-savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 16px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line-2); z-index: 5; }
.cz-wide { grid-column: 1 / -1; }
.cz-brand-prev { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); }
.cz-brand-prev .brand { padding: 0; }
.cz-color { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.cz-color input[type=color], .cz-prop input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.cz-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cz-swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); cursor: pointer; transition: transform .15s var(--spring); }
.cz-swatch:hover { transform: scale(1.15); }
.cz-login-prev { position: relative; height: 140px; border-radius: 12px; overflow: hidden; margin: 6px 0 12px; }
.cz-login-prev img, .cz-login-prev video { width: 100%; height: 100%; object-fit: cover; }
.cz-login-prev .dim { position: absolute; inset: 0; }
.cz-nav { display: flex; flex-direction: column; gap: 4px; }
.cz-nav-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: grab; }
.cz-nav-row.over { border-color: var(--accent); }
.cz-nav-row.off { opacity: .5; }
.cz-nav-row.sp { border-style: dashed; background: transparent; }
.cz-nav-row svg { width: 18px; height: 18px; flex: none; }
.cz-nav-row .input { flex: 1; max-width: 240px; }
.cz-nav-row select.input { max-width: 200px; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.cz-rule { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.cz-rule code { font-size: 12px; }
/* interactive mode */
.cz-box { position: fixed; z-index: 9990; pointer-events: none; border: 2px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 4000px rgba(0, 0, 0, .12); display: none; transition: all .08s ease-out; }
.cz-box::after { content: attr(data-name); position: absolute; left: -2px; top: -24px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px 6px 6px 0; white-space: nowrap; }
.cz-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9995; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); width: min(860px, calc(100vw - 32px)); animation: toast-in .4s var(--spring); }
.cz-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.cz-panel { position: fixed; right: 16px; top: 76px; bottom: 84px; width: 330px; z-index: 9994; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; padding: 12px 14px; transform: translateX(calc(100% + 30px)); transition: transform .35s var(--spring); font-size: 13px; }
.cz-panel.on { transform: none; }
.cz-head { display: flex; align-items: center; margin-bottom: 8px; }
.cz-sec { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 6px; }
.cz-sec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.cz-prop { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cz-prop > label { width: 82px; color: var(--text-2); flex: none; }
.cz-prop input[type=range] { flex: 1; accent-color: var(--accent); }
.cz-prop select.input { flex: 1; min-width: 0; }
.cz-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.cz-foot code { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-on .nav-spacer { min-height: 26px; border: 1.5px dashed var(--line-2); border-radius: 10px; position: relative; }
.cz-on .nav-divider { position: relative; height: 3px; }
.cz-draggable { cursor: grab; }
.cz-draggable.dragging { opacity: .4; }
.cz-draggable.over { box-shadow: 0 -3px 0 var(--accent); }
.cz-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--panel-3); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cz-x svg { width: 12px; height: 12px; }
.cz-prop > label.switch { width: auto; color: var(--text); }
.cz-on .nav-list { position: relative; }
.cz-drop-line { position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 3px; background: var(--accent); pointer-events: none; z-index: 5; }
.cz-draggable { touch-action: none; user-select: none; }
.cz-draggable.dragging { opacity: .75; z-index: 6; position: relative; box-shadow: var(--shadow); background: var(--panel-2); }
.progress.rebuild > div { background: repeating-linear-gradient(45deg, var(--s-rebuilding) 0 8px, color-mix(in srgb, var(--s-rebuilding) 70%, transparent) 8px 16px); }

/* home: game rows with a poster on the left */
.game-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; }
.game-poster { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--panel-2); color: #fff; text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s; }
.game-poster:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.game-poster img, .game-poster .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game-poster .ph { display: grid; place-items: center; text-align: center; padding: 10px; font-weight: 800; }
.game-poster .gp-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; }
.game-poster .gp-n b { font-size: 13px; }
.game-poster .gp-n span { opacity: .8; }
@media (max-width: 700px) { .game-row { grid-template-columns: 96px minmax(0, 1fr); } }
.profile-head { gap: 18px; margin-bottom: 4px; }

/* likes / views */
.rate-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rate-row .views { display: inline-flex; align-items: center; gap: 4px; }
.rate-row .views svg, .likes-mini svg { width: 13px; height: 13px; }
.like-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: color .2s, background .2s, transform .25s var(--spring); }
.like-btn:hover { color: #ff4d6d; }
.like-btn svg { width: 18px; height: 18px; }
.like-btn.on { color: #ff4d6d; background: color-mix(in srgb, #ff4d6d 14%, transparent); border-color: color-mix(in srgb, #ff4d6d 40%, transparent); }
.like-btn.on svg { fill: currentColor; }
.like-btn.pop { animation: like-pop .45s var(--spring); }
@keyframes like-pop { 40% { transform: scale(1.3); } }
.likes-mini { display: inline-flex; align-items: center; gap: 3px; }

/* party: fade between moments, speed, fullscreen dock */
.party .pdock { display: flex; flex-direction: column; gap: 12px; }
.party .pview .pfade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 1; }
.party .pview .pfade.on { animation: pfade .55s ease; }
@keyframes pfade { 0% { opacity: 1; } 100% { opacity: 0; } }
.party .speed { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.party .speed svg { width: 17px; height: 17px; }
.party .speed input { width: 96px; accent-color: var(--accent); }
.party .speed.ro input { display: none; }
.party .speed-lbl { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; min-width: 38px; cursor: default; user-select: none; }
.party .pin-btn { display: none; }
.party .pstage.fs { background: #000; padding: 0; gap: 0; overflow: hidden; position: relative; display: block; }
.party .pstage.fs .pview { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; }
.party .pstage.fs .pdock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px 16px 14px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line-2); transform: translateY(100%); transition: transform .35s var(--ease); }
.party .pstage.fs.dock-on .pdock { transform: none; }
.party .pstage.fs .pin-btn { display: inline-flex; }
.party .pstage.fs.pinned { display: flex; flex-direction: column; }
.party .pstage.fs.pinned .pview { position: relative; inset: auto; flex: 1; min-height: 0; height: auto; }
.party .pstage.fs.pinned .pdock { position: static; transform: none; }
.party .pstage.fs .ptl { max-height: 32vh; overflow: auto; }

/* party social card + reactions floating off the watcher's avatar */
.psocial { transition: opacity .18s ease, transform .18s ease; }
.psocial.swap { opacity: 0; transform: translateY(6px); }
.psocial .ps-head { gap: 8px; margin-bottom: 10px; }
.psocial .resync { display: none; }
.psocial .resync.on { display: inline-flex; }
.psocial .ps-comments { max-height: 260px; overflow: auto; margin: 10px 0 8px; }
.psocial .composer { padding: 0; border: 0; }
.party .member { position: relative; }
.react-float { position: absolute; left: 4px; top: 0; z-index: 3; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); pointer-events: none; animation: react-float 1.5s var(--ease) forwards; }
.react-float svg { width: 13px; height: 13px; }
.react-float.star { color: #ffc93c; } .react-float.star svg { fill: currentColor; }
.react-float.like { color: #ff4d6d; } .react-float.like svg { fill: currentColor; }
.react-float.comment { color: var(--accent); }
@keyframes react-float {
  0% { transform: scale(.3); opacity: 0; }
  18% { transform: scale(1.25); opacity: 1; }
  35% { transform: scale(1); opacity: 1; }
  100% { transform: translate(46px, -56px) scale(.8); opacity: 0; }
}
.party .pside { overflow-y: auto; padding-bottom: 8px; }
/* Admin settings: Processing spans both columns when the advanced settings are open; its
   groups flow into two columns without splitting. */
.admin-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-settings.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.admin-settings .panel { padding: 20px; }
.admin-settings h3 { margin: 0 0 14px; font-size: 16px; }
.proc-panel.wide .adv-proc { columns: 2; column-gap: 28px; }
.proc-panel .adv-proc .adv-group { break-inside: avoid; }
.proc-panel.wide .adv-proc > .row { column-span: all; }
@media (max-width: 1100px) { .proc-panel.wide .adv-proc { columns: 1; } }
@media (max-width: 760px) { .admin-settings, .admin-settings.wide { grid-template-columns: 1fr; } }
.party .sw-hint { margin: -4px 0 2px 50px; }
.games-top { margin-bottom: 20px; max-width: 420px; }
.game-search { margin-top: 0; z-index: 10; }
.game-search .gs-cover { width: 34px; height: 45px; border-radius: 6px; object-fit: cover; flex: none; }
.nav-item .count.bell { display: inline-flex; align-items: center; gap: 3px; background: var(--warn); color: #241500; }
.nav-item .count.bell svg { width: 11px; height: 11px; }
.card .badges .chip.new { background: var(--accent); color: #fff; gap: 4px; }
.card .badges .chip.new svg { width: 12px; height: 12px; }

/* emoji picker + :shortcode: suggestions */
.emoji-picker { position: fixed; z-index: 130; width: 350px; height: 400px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: menu-in .2s var(--ease); }
.emoji-picker .ep-head { padding: 10px 10px 6px; }
.emoji-picker .ep-tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emoji-picker .ep-tab { flex: none; width: 30px; height: 28px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 17px; display: grid; place-items: center; color: var(--text-2); }
.emoji-picker .ep-tab:hover { background: var(--hover); }
.emoji-picker .ep-tab svg { width: 16px; height: 16px; }
.emoji-picker .ep-body { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.emoji-picker .ep-h { position: sticky; top: 0; background: var(--panel); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 8px 2px 4px; z-index: 1; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.ep-e { border: 0; background: none; font-size: 22px; height: 38px; border-radius: 8px; cursor: pointer; transition: transform .15s var(--spring), background .15s; }
.ep-e:hover { background: var(--hover); transform: scale(1.18); }
.composer { position: relative; }
.ep-suggest { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); display: none; overflow: hidden; z-index: 20; }
.ep-suggest.on { display: block; }
.ep-s { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.ep-s.cur { background: var(--hover); }
.ep-s .ep-big { font-size: 20px; }
/* GIF favorites */
.gif-wrap { position: relative; }
.gif-wrap > img { display: block; width: 100%; }
.gif-fav { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s, transform .2s var(--spring); }
.gif-wrap:hover .gif-fav, .gif-fav.on { opacity: 1; }
.gif-fav:hover { transform: scale(1.12); }
.gif-fav svg { width: 15px; height: 15px; }
.gif-fav.on { color: #ffc93c; }
.gif-fav.on svg { fill: currentColor; }
.gif-picker .gp-tabs { display: flex; gap: 6px; padding: 0 10px 8px; }
.gif-picker .gp-tabs button { border: 1px solid var(--line-2); background: none; color: var(--text-2); border-radius: 20px; padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.gif-picker .gp-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.gif-picker .gp-tabs svg { width: 13px; height: 13px; }
.comment .att .gif-wrap { display: inline-block; max-width: 220px; }
.comment .att .gif-wrap img { border-radius: 10px; }
/* party: taller clip card that fills with comments; fullscreen timeline above the controls */
.party .psocial { display: flex; flex-direction: column; min-height: 440px; }
.party .psocial .ps-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.party .psocial .ps-comments { flex: 1; min-height: 200px; max-height: none; overflow: auto; }
.party .pstage.fs .pdock { flex-direction: column-reverse; }
.imp-list { gap: 6px; max-height: 300px; overflow: auto; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 120px; gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 760px) { .party .ptl .hint { display: none; } }

/* sideways scrollbars on clip reels and the party timeline: tall enough to grab */
.strip::-webkit-scrollbar, .moments::-webkit-scrollbar, .tl-scroll::-webkit-scrollbar { height: 16px; }
.strip::-webkit-scrollbar-thumb, .moments::-webkit-scrollbar-thumb, .tl-scroll::-webkit-scrollbar-thumb { border: 4px solid var(--bg); border-radius: 16px; background: var(--panel-3); }
.strip::-webkit-scrollbar-thumb:hover, .moments::-webkit-scrollbar-thumb:hover, .tl-scroll::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, var(--panel-3)); }
.ptl .moments::-webkit-scrollbar-thumb { border-color: var(--panel); }
.ed-tl .tl-scroll::-webkit-scrollbar-thumb { border-color: var(--panel); }
@-moz-document url-prefix() { .strip, .moments, .tl-scroll { scrollbar-width: auto; } }
.tabs .tab-n { background: var(--warn); color: #241500; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 20px; line-height: 18px; }
/* stickers */
.gif-picker .gp-tabs .grow { flex: 1; min-width: 12px; }
.gif-picker .gp-grid:has(.stk-grid) { display: block; }
.stk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.stk, .stk-add { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; min-width: 0; }
.stk img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; transition: transform .2s var(--spring); }
.stk img:hover { transform: scale(1.06); }
.stk-add { border: 2px dashed var(--line-2); color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0; }
.stk-add:hover { border-color: var(--accent); color: var(--text); }
.stk-add svg { width: 26px; height: 26px; }
.stk-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.stk:hover .stk-del { opacity: 1; }
.stk-del svg { width: 12px; height: 12px; }
@media (hover: none) { .stk-del { opacity: 1; } }
.comment .att img.sticker { max-width: 140px; max-height: 140px; border-radius: 0; cursor: default; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .box .icon-btn { width: 34px; height: 34px; flex: none; }
/* the icon on the empty-state button keeps button size */
.empty .btn svg { width: 17px; height: 17px; margin: 0; opacity: 1; }
@media (max-width: 760px) { .composer .emoji-btn { display: none; } }

/* ---------- phones, round 5 ---------- */
html { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
.m-back, .p-back { display: none; }
.c-file { max-width: 300px; }
.up-table .c-status { width: 250px; }
@media (max-width: 760px) {
  * { -webkit-tap-highlight-color: transparent; }
  button, a, .card, .nav-item, .scrub, .moment, .lane, video { -webkit-touch-callout: none; }
  /* Back button on every dialog (they cover the tab bar) */
  .m-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; padding: 12px 14px 4px; cursor: pointer; }
  .m-back svg { width: 20px; height: 20px; }
  .modal.clipview .m-back { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; z-index: 6; padding: 0; width: 38px; height: 38px; border-radius: 50%; justify-content: center; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(8px); }
  .modal.clipview .m-back span { display: none; }
  .modal.clipview { position: relative; }
  .modal.adminview-modal .m-back { display: none; }
  .p-back { display: grid; flex: none; }
  .gp-head, .ep-head { display: flex; gap: 6px; align-items: center; }
  /* home: the game poster scrolls with that game's clips */
  .game-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 4px 14px; margin: 0 -4px; }
  .game-row > .game-poster { flex: none; width: 34vw; align-self: flex-start; scroll-snap-align: start; }
  .game-row > .strip { flex: none; overflow: visible; padding: 0; margin: 0; }
  /* wide tables become stacked cards: everything visible, scroll only down */
  .panel:has(> .table.stack) { overflow: visible; }
  .panel > .table.stack { min-width: 0; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody { display: block; }
  .table.stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .table.stack td { display: block; border: 0; padding: 0; width: auto !important; }
  .table.stack .c-file { max-width: none; flex: 1 1 100%; font-weight: 600; }
  .table.stack .c-file .ell { white-space: normal; word-break: break-word; }
  .table.stack .c-status { min-width: 0; }
  .table.stack .c-prog, .table.stack .c-status, .table.stack .c-acts { flex: 1 1 100%; }
  .table.stack .c-acts .row { justify-content: flex-start !important; }
  .table.stack .c-thumb:empty { display: none; }
  .table.stack .c-thumb img { width: 96px !important; }
  .users-table td:first-child { flex: 1 1 100%; }
  .users-table .c-n::before { content: attr(data-l) ": "; color: var(--text-3); font-size: 12px; }
  .users-table .c-n { font-size: 13px; }
  .logs .l { grid-template-columns: auto auto 1fr; }
  .logs .l > span:last-child { grid-column: 1 / -1; }
  .imp-row { grid-template-columns: minmax(0, 1fr) auto; }
  .imp-row .progress { grid-column: 1 / -1; }
  .cz-nav-row { flex-wrap: wrap; }
  .av-tracks { display: block; overflow-x: auto; }
}
/* party controls wrap when the side column is dragged wide */
.party .pctl { flex-wrap: wrap; row-gap: 4px; }
.party .pscrub { min-width: 180px; }
.party .pstage { overflow-x: hidden; }
.pill.s-deleted { color: var(--s-failed); background: var(--s-failed-bg); }
.up-th { width: 72px; height: 41px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); color: var(--text-3); }
.up-th svg { width: 18px; height: 18px; }
.up-th.gone { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--panel-2)); }
.up-card .thumb.gone { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--panel-2)); flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.up-card.deleted { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
/* party: the stage always fits the window (video shrinks), so the timeline stays in view without a scrollbar */
@media (min-width: 1101px) {
  .party .pstage { overflow: hidden; }
  .party .pstage:not(.fs) .pview { flex: 0 1 auto; aspect-ratio: 16 / 9; min-height: 160px; max-height: none; }
  .party .pstage:not(.fs) .pdock { flex: none; }
  .party .pstage:not(.fs) .ptl { max-height: 38vh; overflow-y: auto; }
}
/* editor on phones: Done · title · Apply, then status · clip n/m · Revert; the video at its own height;
   tools as a tidy grid (cut tools, then undo/zoom, then save/reset) */
.ed-nav { display: flex; align-items: center; gap: 4px; }
.ed-br { display: none; }
@media (max-width: 760px) {
  .ed-top { display: flex; flex-wrap: wrap; align-items: center; height: auto; gap: 6px 8px; padding: calc(6px + env(safe-area-inset-top)) 10px 8px; }
  .ed-top .ed-done { order: 1; padding: 0 8px 0 2px; }
  .ed-top .ttl { order: 2; flex: 1; width: auto; min-width: 0; }
  .ed-top > .btn.primary { order: 3; padding: 0 12px; }
  .ed-top .ed-br { display: block; order: 4; flex-basis: 100%; height: 0; }
  .ed-top > .chip { order: 5; }
  .ed-top > .grow { order: 6; }
  .ed-top .ed-nav { order: 7; }
  .ed-top .ed-revert { order: 8; padding: 0 8px; }
  .ed-main { display: flex; flex-direction: column; }
  .ed-stage { flex: none; padding: 8px 10px 4px; gap: 6px; }
  .ed-fit { flex: none; min-height: 0; container-type: normal; display: block; }
  .ed-view { width: 100%; border-radius: 12px; }
  .ed-transport { justify-content: center; }
  .ed-tl { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); margin-top: auto; }
  .tl-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .tl-tools .btn.sm { width: 100%; padding: 0 4px; font-size: 12.5px; gap: 5px; height: 34px; }
  .tl-tools .tl-gap, .tl-tools .grow { display: none; }
  .tl-tools .t-undo, .tl-tools .t-redo, .tl-tools .t-zout, .tl-tools .t-zin { order: 1; }
  .tl-tools .t-new, .tl-tools .t-reset { order: 2; }
  .tl-tools .t-new { grid-column: span 3; }
  .editor { overflow-y: auto; }
}
